[xbuild] Fix incremental build of TargetFrameworkAttribute
authorMikayla Hutchinson <m.j.hutchinson@gmail.com>
Tue, 23 Aug 2016 02:52:31 +0000 (22:52 -0400)
committerMikayla Hutchinson <m.j.hutchinson@gmail.com>
Tue, 23 Aug 2016 02:52:31 +0000 (22:52 -0400)
The targets depended on a feature that doesn't exist in
xbuild (https://bugzilla.xamarin.com/show_bug.cgi?id=43645)
and as a consequence would fail to add the generated file to
the build when the GenerateTargetFrameworkMonikerAttribute
target was up to date.

mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
mcs/tools/xbuild/data/14.0/Microsoft.Common.targets
mcs/tools/xbuild/data/4.0/Microsoft.Common.targets

index ffe1f63b83831bf76308f05d066a6bcd62b5828e..b28194f9a2f441490d755fa04051c20e84eac87b 100644 (file)
                <FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
        </ItemGroup>
 
-       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+       <Target Name="_GenerateTargetFrameworkMonikerAttribute"
                DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
                Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
-               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
-               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
+               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
 
                <WriteLinesToFile
                        File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
                        ContinueOnError="true"
                        Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
                />
+       </Target>
+
+       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+               DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute"
+               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
 
                <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
                        <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
index 433cffe8e69a8bfb86808755e4bfa26911c7d77a..89afe6502c780f8661c658ba53f8843818a90537 100644 (file)
                <FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
        </ItemGroup>
 
-       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+       <Target Name="_GenerateTargetFrameworkMonikerAttribute"
                DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
                Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
-               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
-               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
+               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
 
                <WriteLinesToFile
                        File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
                        ContinueOnError="true"
                        Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
                />
+       </Target>
+
+       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+               DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute"
+               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
 
                <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
                        <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
index 152dd2b985e906f5ed3e6ac13142dd6e90198390..ff82f8195fe89bb67b6a224cb89bea9ae8bd9112 100644 (file)
                <FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
        </ItemGroup>
 
-       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+       <Target Name="_GenerateTargetFrameworkMonikerAttribute"
                DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
                Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
-               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
-               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
+               Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)">
 
                <WriteLinesToFile
                        File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
                        ContinueOnError="true"
                        Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
                />
+       </Target>
+
+       <Target Name="GenerateTargetFrameworkMonikerAttribute"
+               DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute"
+               Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
 
                <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
                        <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>