diff --git a/Tasks.cs b/Tasks.cs index ff0a582..58d8d88 100644 --- a/Tasks.cs +++ b/Tasks.cs @@ -668,6 +668,13 @@ public ITaskItem[] ComputedSources private set; } + [Output] + public string[] GeneratedPaths + { + get; + private set; + } + protected abstract string ToolName { get; @@ -711,6 +718,7 @@ public virtual Dictionary GetOptions(ITaskItem item) public override bool Execute() { List computed = new List(); + List generatedPaths = new List(); foreach(ITaskItem source in Sources) { bool skip = true; @@ -728,6 +736,8 @@ public override bool Execute() var generatedItems = GeneratedItems(source); FileInfo generatedInfo = null; FileInfo dependInfo = null; + + generatedPaths.AddRange(generatedItems.Select(item => item.GetMetadata("FullPath"))); // // Check if the Slice compiler is older than the source file // @@ -922,6 +932,7 @@ public override bool Execute() computed.Add(computedSource); } ComputedSources = computed.ToArray(); + GeneratedPaths = generatedPaths.ToArray(); return true; } } diff --git a/msbuild/zeroc.icebuilder.msbuild.cpp.targets b/msbuild/zeroc.icebuilder.msbuild.cpp.targets index 9881de7..07c2cc6 100644 --- a/msbuild/zeroc.icebuilder.msbuild.cpp.targets +++ b/msbuild/zeroc.icebuilder.msbuild.cpp.targets @@ -75,6 +75,10 @@ ItemName = "_SliceCompile" TaskParameter = "ComputedSources"/> + + @@ -102,17 +106,11 @@ a persistent way. If the extension is not enabled or we are building from the command line we just add the missing items in a transient way. - First create a property `_SliceCompileGeneratedItems` to hold the paths of all generated items, then we - create a ItemGroup to add a ClCompile item for each generated item that is not part of the project. Using an - intermediate property for the ClCompile Include avoids _SliceCompile item metadata being copied to the - generated ClCompile item. + The builder's depend task has an output property named GeneratedPaths that contains the paths of all generated items. --> - - - - diff --git a/msbuild/zeroc.icebuilder.msbuild.csharp.targets b/msbuild/zeroc.icebuilder.msbuild.csharp.targets index 7f06df0..e53f034 100644 --- a/msbuild/zeroc.icebuilder.msbuild.csharp.targets +++ b/msbuild/zeroc.icebuilder.msbuild.csharp.targets @@ -69,6 +69,10 @@ ItemName = "_SliceCompile" TaskParameter = "ComputedSources"/> + + @@ -88,18 +92,11 @@ a persistent way. If the extension is not enabled or we are building from the command line we just add the missing items in a transient way. - First create a property `_SliceCompileGeneratedItems` to hold the paths of all generated items, then we - create a ItemGroup to add a Compile item for each generated item that is not part of the project. Using an - intermediate property for the Compile Include avoids _SliceCompile item metadata being copied to the - generated Compile item. + The builder's depend task has an output property named GeneratedPaths that contains the paths of all generated items. --> - - - - -