internal bool Build(MSBuildEngine.ProjectToBuild ptb) { LoggingService.Debug("Run MSBuild on " + ptb.file); if (!string.IsNullOrEmpty(ptb.configuration)) { engine.GlobalProperties.SetProperty("Configuration", ptb.configuration); } if (!string.IsNullOrEmpty(ptb.platform)) { engine.GlobalProperties.SetProperty("Platform", ptb.platform); } Microsoft.Build.BuildEngine.Project project = buildRun.LoadProject(engine, ptb.file); if (project == null) { LoggingService.Debug("Error loading " + ptb.file); return false; } foreach (string additionalTargetFile in MSBuildEngine.AdditionalTargetFiles) { project.AddNewImport(additionalTargetFile, null); } bool success; if (string.IsNullOrEmpty(ptb.targets)) { success = engine.BuildProject(project); } else { success = engine.BuildProject(project, ptb.targets.Split(';')); } logger.FlushCurrentError(); ReleaseOutput(); LoggingService.Debug("MSBuild on " + ptb.file + " finished " + (success ? "successfully" : "with error")); return success; }
/* * Warning MSB3644: The reference assemblies for framework * ".NETFramework,Version=v4.0,Profile=Client" were not found. To resolve this, * install the SDK or Targeting Pack for this framework version or retarget * your application to a version of the framework for which you have the SDK * or Targeting Pack installed. Note that assemblies will be resolved from * the Global Assembly Cache (GAC) and will be used in place of reference assemblies. * Therefore your assembly may not be correctly targeted for the framework you intend. */ public IMSBuildChainedLoggerFilter CreateFilter(MSBuildEngine engine, IMSBuildChainedLoggerFilter nextFilter) { if (engine.ProjectMinimumSolutionVersion >= Solution.SolutionVersionVS2010) { return new TargetingPackWarningWorkaroundChainEntry(nextFilter); } else { return nextFilter; } }
public IMSBuildChainedLoggerFilter CreateFilter(MSBuildEngine engine, IMSBuildChainedLoggerFilter nextFilter) { if (nextFilter == null) throw new ArgumentNullException("nextFilter"); // ensure the engine gets notified about start/end of this task engine.InterestingTasks.Add(taskname); // Create a Filter that tracks whether the task is active. // If active, forward to 'baseFilter', otherwise forward to 'nextFilter'. return new TaskBoundLoggerFilter(this, engine, nextFilter); }
internal MSBuildEngineWorker(MSBuildEngine parentEngine, MSBuildEngine.BuildRun buildRun) { this.parentEngine = parentEngine; this.buildRun = buildRun; engine = buildRun.CreateEngine(); logger = new SharpDevelopLogger(this); engine.RegisterLogger(logger); foreach (IMSBuildAdditionalLogger loggerProvider in MSBuildEngine.AdditionalMSBuildLoggers) { engine.RegisterLogger(loggerProvider.CreateLogger(this)); } }
public TaskBoundAdditionalLogger(TaskBoundAdditionalLoggerDescriptor desc, MSBuildEngine engine) { this.desc = desc; this.engine = engine; }
public TaskBoundLoggerFilter(TaskBoundLoggerFilterDescriptor desc, MSBuildEngine engine, IMSBuildChainedLoggerFilter nextFilter) { this.desc = desc; this.engine = engine; this.nextFilter = nextFilter; }
public ILogger CreateLogger(MSBuildEngine engine) { engine.InterestingTasks.Add(taskname); return new TaskBoundAdditionalLogger(this, engine); }
public SharpDevelopLogger(MSBuildEngine engine) { this.worker = engine; }
public static void StartBuild(IProject project, ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IEnumerable<string> additionalTargetFiles) { if (project == null) throw new ArgumentNullException("project"); if (options == null) throw new ArgumentNullException("options"); if (feedbackSink == null) throw new ArgumentNullException("feedbackSink"); if (additionalTargetFiles == null) throw new ArgumentNullException("additionalTargetFiles"); MSBuildEngine engine = new MSBuildEngine(project, options, feedbackSink); engine.additionalTargetFiles = additionalTargetFiles; engine.StartBuild(); }
public FxCopLoggerImpl(MSBuildEngine engineWorker, IMSBuildChainedLoggerFilter nextChainElement) { this.engineWorker = engineWorker; this.nextChainElement = nextChainElement; }
public BuildRun(Solution solution, IProject project, BuildOptions options, MSBuildEngine parentEngine) { this.solution = solution; this.project = project; this.options = options; this.parentEngine = parentEngine; }
public SharpDevelopLogger(MSBuildEngine engine) { this.engine = engine; }
public FxCopLoggerImpl(MSBuildEngine engineWorker) { this.engineWorker = engineWorker; }
public EndOfChain(MSBuildEngine engine) { this.engine = engine; }
internal static void RunMSBuild(Solution solution, IProject project, string configuration, string platform, BuildOptions options) { WorkbenchSingleton.Workbench.GetPad(typeof(CompilerMessageView)).BringPadToFront(); MSBuildEngine engine = new MSBuildEngine(); engine.Configuration = configuration; engine.Platform = platform; engine.MessageView = TaskService.BuildMessageViewCategory; engine.Run(solution, project, options); }
public ILogger CreateLogger(MSBuildEngine engine) { engine.InterestingTasks.Add(taskname); return(new TaskBoundAdditionalLogger(this, engine)); }
public IMSBuildChainedLoggerFilter CreateFilter(MSBuildEngine engine, IMSBuildChainedLoggerFilter nextFilter) { return new VbcLoggerImpl(nextFilter); }
public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink) { MSBuildEngine.StartBuild(this, options, feedbackSink, MSBuildEngine.AdditionalTargetFiles); }
public IMSBuildChainedLoggerFilter CreateFilter(MSBuildEngine engine, IMSBuildChainedLoggerFilter nextFilter) { engine.OutputTextLine(StringParser.Parse("${res:ICSharpCode.CodeAnalysis.RunningFxCopOn} " + Path.GetFileNameWithoutExtension(engine.ProjectFileName))); return new FxCopLoggerImpl(engine, nextFilter); }
public static void StartBuild(IProject project, ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IEnumerable<string> additionalTargetFiles) { if (project == null) throw new ArgumentNullException("project"); if (options == null) throw new ArgumentNullException("options"); if (feedbackSink == null) throw new ArgumentNullException("feedbackSink"); if (additionalTargetFiles == null) throw new ArgumentNullException("additionalTargetFiles"); MSBuildEngine engine = new MSBuildEngine(project, options, feedbackSink); engine.additionalTargetFiles = additionalTargetFiles.ToList(); if (project.MinimumSolutionVersion >= Solution.SolutionVersionVS2010) { engine.additionalTargetFiles.Add(Path.Combine(Path.GetDirectoryName(typeof(MSBuildEngine).Assembly.Location), "SharpDevelop.TargetingPack.targets")); } engine.StartBuild(); }
public ILogger CreateLogger(MSBuildEngine engineWorker) { return new FxCopLoggerImpl(engineWorker); }