[xbuild] Fix incremental build of TargetFrameworkAttribute
[mono.git] / mcs / tools / xbuild / data / 12.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)"/>