Ejemplo n.º 1
0
        private Version GetFrameworkVersion()
        {
            string frameworkVersion = this.TargetFrameworkVersion;

            if (!ExportTaskImplementation <TTask> .PropertyHasValue(frameworkVersion))
            {
                return((Version)null);
            }
            return(new Version(frameworkVersion.TrimStart('v', 'V')));
        }
Ejemplo n.º 2
0
 private bool ValidateToolPath(string toolFileName, string currentValue, Func <Version, string, string> getToolPath, out string foundPath)
 {
     if (ExportTaskImplementation <TTask> .PropertyHasValue(this.TargetFrameworkVersion))
     {
         string toolDirectory = currentValue;
         if (this.TryToGetToolDirForFxVersion(toolFileName, getToolPath, ref toolDirectory))
         {
             foundPath = toolDirectory;
             return(true);
         }
     }
     if (ExportTaskImplementation <TTask> .PropertyHasValue(currentValue) && ExportTaskImplementation <TTask> .TrySearchToolPath(currentValue, toolFileName, out foundPath))
     {
         return(true);
     }
     foundPath = (string)null;
     return(false);
 }
        private void OnDllWrapperNotification(object sender, DllExportNotificationEventArgs e)
        {
            MessageImportance messageImportance = ExportTaskImplementation <TTask> .GetMessageImportance(e.Severity);

            string             file = string.IsNullOrEmpty(e.FileName) ? this._ActualTask.BuildEngine.ProjectFileOfTaskNode : e.FileName;
            SourceCodePosition sourceCodePosition1 = e.StartPosition ?? new SourceCodePosition(0, 0);
            SourceCodePosition sourceCodePosition2 = e.EndPosition ?? new SourceCodePosition(0, 0);
            string             message             = e.Message;

            if (e.Severity > 0 && e.Context != (NotificationContext)null && e.Context.Name != null)
            {
                message = e.Context.Name + ": " + message;
            }
            var data = new
            {
                startPos = sourceCodePosition1,
                endPos   = sourceCodePosition2,
                fileName = file,
                Severity = e.Severity,
                Code     = e.Code,
                Message  = message
            };

            if (this._LoggedMessages.ContainsKey((object)data))
            {
                return;
            }
            this._LoggedMessages.Add((object)data, message);
            if (e.Severity == 1)
            {
                this._ActualTask.Log.LogWarning("Export", e.Code, (string)null, file, sourceCodePosition1.Line, sourceCodePosition1.Character, sourceCodePosition2.Line, sourceCodePosition2.Character, message);
            }
            else if (e.Severity > 1)
            {
                ++this._ErrorCount;
                this._ActualTask.Log.LogError("Export", e.Code, (string)null, file, sourceCodePosition1.Line, sourceCodePosition1.Character, sourceCodePosition2.Line, sourceCodePosition2.Character, message);
            }
            else
            {
                this._ActualTask.Log.LogMessage(messageImportance, message);
            }
        }
Ejemplo n.º 4
0
        private bool ValidateLibToolPath()
        {
            string str1 = (string)null;

            if (ExportTaskImplementation <TTask> .PropertyHasValue(this.LibToolPath))
            {
                if (ExportTaskImplementation <TTask> .TrySearchToolPath(this.LibToolPath, "lib.exe", out str1))
                {
                    this.LibToolPath = str1;
                }
                else
                {
                    this._ActualTask.Log.LogMessage(MessageImportance.Low, Resources.Cannot_find_lib_exe_in_0_, (object)this.LibToolPath);
                    this.LibToolPath = (string)null;
                    return(false);
                }
            }
            else
            {
                this.LibToolPath = (string)null;
                string str2 = Null.NullIfEmpty(Environment.GetEnvironmentVariable("DevEnvDir")) ?? ExportTaskImplementation <TTask> .GetVsPath();

                if (ExportTaskImplementation <TTask> .PropertyHasValue(str2))
                {
                    if (ExportTaskImplementation <TTask> .TrySearchToolPath(str2, "lib.exe", out str1) || ExportTaskImplementation <TTask> .TrySearchToolPath(Path.Combine(str2, "VC"), "lib.exe", out str1) || ExportTaskImplementation <TTask> .TrySearchToolPath(Path.Combine(Path.Combine(str2, "VC"), "bin"), "lib.exe", out str1))
                    {
                        this.LibToolPath = str1;
                    }
                    else
                    {
                        this._ActualTask.Log.LogMessage(MessageImportance.Low, Resources.Cannot_find_lib_exe_in_0_, (object)this.LibToolPath);
                        this.LibToolPath = (string)null;
                        return(true);
                    }
                }
            }
            if (!ExportTaskImplementation <TTask> .PropertyHasValue(str1))
            {
                str1 = (string)null;
            }
            if (!ExportTaskImplementation <TTask> .PropertyHasValue(this.LibToolDllPath))
            {
                if (!ExportTaskImplementation <TTask> .PropertyHasValue(str1))
                {
                    this.LibToolDllPath = (string)null;
                }
                else
                {
                    DirectoryInfo directoryInfo = new DirectoryInfo(str1);
                    while (directoryInfo != null && !Directory.Exists(Path.Combine(Path.Combine(directoryInfo.FullName, "Common7"), "IDE")))
                    {
                        directoryInfo = directoryInfo.Parent;
                    }
                    if (directoryInfo != null)
                    {
                        string path = Path.Combine(Path.Combine(directoryInfo.FullName, "Common7"), "IDE");
                        if (Directory.Exists(path))
                        {
                            this.LibToolDllPath = path;
                        }
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
 public DllExportAppDomainIsolatedTask(ResourceManager taskResources, string helpKeywordPrefix)
     : base(taskResources, helpKeywordPrefix)
 {
     this._ExportTaskImplementation = new ExportTaskImplementation <DllExportAppDomainIsolatedTask>(this);
 }
Ejemplo n.º 6
0
 public DllExportAppDomainIsolatedTask(ResourceManager taskResources)
     : base(taskResources)
 {
     this._ExportTaskImplementation = new ExportTaskImplementation <DllExportAppDomainIsolatedTask>(this);
 }
Ejemplo n.º 7
0
 public DllExportAppDomainIsolatedTask()
 {
     this._ExportTaskImplementation = new ExportTaskImplementation <DllExportAppDomainIsolatedTask>(this);
 }
Ejemplo n.º 8
0
 public DllExportTask()
 {
     this._ExportTaskImplementation = new ExportTaskImplementation <DllExportTask>(this);
 }