diff options
author | Greg Munn <greg@sgmunn.com> | 2015-10-30 21:09:59 +0300 |
---|---|---|
committer | Greg Munn <greg@sgmunn.com> | 2015-11-03 19:02:27 +0300 |
commit | f80c269f8b73d7b00f9762477a85d5d40d9afbbb (patch) | |
tree | 077dd5cb9dff849a283b50315bf3876dd605d7a5 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools | |
parent | b76f704c382851a2d11ec3c31c783ba7e98b4882 (diff) |
[Ide] Support for CoreCompileDependsOn and Generators in project file items.
Context: https://mhut.ch/journal/2015/06/30/build_time_code_generation_msbuild
When a project is loaded, we look for targets defined in CoreCompileDependsOn and
the CompileItem results of these targets are included as source files into the
type system.
Whenever any file is changed that has a Generator value, we also run those targets
and notify the type system of changes in those extra included files. This is
performed by the existing MSBuildCustomTool processor.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs index 06b7289a52..9aa1db8a5e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs @@ -28,6 +28,9 @@ using MonoDevelop.Core; using MonoDevelop.Projects;
using System.CodeDom.Compiler;
using System.Threading.Tasks;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
namespace MonoDevelop.Ide.CustomTools
{
@@ -42,7 +45,8 @@ namespace MonoDevelop.Ide.CustomTools public async Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- var buildResult = await file.Project.RunTarget (monitor, targetName, IdeApp.Workspace.ActiveConfiguration);
+ var buildResult = await file.Project.PerformGeneratorAsync (monitor, IdeApp.Workspace.ActiveConfiguration, this.targetName);
+
foreach (var err in buildResult.BuildResult.Errors) {
result.Errors.Add (new CompilerError (err.FileName, err.Line, err.Column, err.ErrorNumber, err.ErrorText) {
IsWarning = err.IsWarning
|