Esempio n. 1
0
        private void AddItem(bool local, TargetType type, ITaskItem item)
        {
            string path = item.ItemSpec;

            string src    = EnsureRelativePath(path);
            string target = (item != null) ? EnsureRelativePath(CalculateTarget(item)) : src;

            if (!ProjectOutput.ContainsKey(target))
            {
                ProjectOutput.Add(new TargetItem(target, src, local ? type : (TargetType)((int)type | 0x10)));
            }
        }
Esempio n. 2
0
        public virtual void PostParseBuildResult()
        {
            if (string.IsNullOrEmpty(TargetPath) || string.IsNullOrEmpty(ProjectPath))
            {
                return;
            }

            if ((DebugSrc == null) || (DebugId == null))
            {
                string targetFile = GetFullPath(TargetPath);

                if (QQnPath.IsAssemblyFile(targetFile) && File.Exists(targetFile))
                {
                    DebugReference reference = AssemblyUtils.GetDebugReference(targetFile);

                    if (reference != null)
                    {
                        string   pdbSrc    = EnsureRelativePath(QQnPath.Combine(ProjectPath, Path.GetDirectoryName(TargetPath), reference.PdbFile));
                        FileInfo pdbTarget = new FileInfo(Path.GetFullPath(QQnPath.Combine(ProjectPath, Path.GetDirectoryName(TargetPath), Path.GetFileName(pdbSrc))));

                        if (pdbTarget.Exists)
                        {
                            FileInfo pdbFrom = new FileInfo(GetFullPath(pdbSrc));

                            if (!pdbFrom.Exists || ((pdbFrom.Length == pdbTarget.Length) && (pdbFrom.LastWriteTime == pdbTarget.LastWriteTime)))
                            {
                                pdbSrc = EnsureRelativePath(pdbTarget.FullName);
                            }
                        }

                        DebugSrc = pdbSrc;
                        DebugId  = reference.DebugId;
                    }
                    else
                    {
                        string pdbFile = Path.ChangeExtension(targetFile, ".pdb");

                        if (ProjectOutput.ContainsKey(pdbFile) && File.Exists(pdbFile))
                        {
                            pdbFile = EnsureRelativePath(pdbFile);

                            DebugSrc = pdbFile;
                        }
                    }
                }
            }
        }