Skip to content

Commit c2d3681

Browse files
jonathanpeppersdellis1972
authored andcommitted
[Xamarin.Android.Build.Tasks] _CopyIntermediateAssemblies uses CopyIfChanged (#2128)
Context: #2088 970da9e was a good step towards "correctness" in building incrementally in the following scenario: - File | New Xamarin.Forms project | NetStandard library - Build - Change XAML - Build In this scenario, there is now a new target rising to the surface we can improve: 276 ms _CopyIntermediateAssemblies 1 calls Looking at the target, it seems we could use the `CopyIfChanged` task here more effectively. This task will automaticaly set the timestamps of files that have been copied, and so we don't need any subsequent `<ItemGroup />` or `<Touch />` elements. It was also touching *all* files instead of just the ones that were changed. After this change: 33 ms _CopyIntermediateAssemblies 1 calls The overall build went from 7.058s to 6.652s, so there must be some other targets that benefit from the timestamps not changing on *all* of these files.
1 parent 2598be5 commit c2d3681

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,20 +1943,15 @@ because xbuild doesn't support framework reference assemblies.
19431943
Outputs="@(ResolvedUserAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension)')"
19441944
DependsOnTargets="_ResolveAssemblies;_ResolveSatellitePaths;_CreatePackageWorkspace;_CreateIntermediateAssembliesDir;_CopyConfigFiles">
19451945
<!-- Make a copy of every assembly we need in assemblies -->
1946-
<Copy
1946+
<CopyIfChanged
19471947
SourceFiles="@(ResolvedAssemblies)"
19481948
DestinationFiles="@(ResolvedAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension)')"
1949-
SkipUnchangedFiles="true" />
1950-
<Copy
1949+
/>
1950+
<CopyIfChanged
19511951
SourceFiles="@(_AndroidResolvedSatellitePaths)"
19521952
DestinationFiles="@(_AndroidResolvedSatellitePaths->'$(MonoAndroidLinkerInputDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
1953-
SkipUnchangedFiles="true"
19541953
/>
19551954
<Delete Files="@(ResolvedAssemblies->'$(MonoAndroidLinkerInputDir)%(Filename)%(Extension).mdb')" />
1956-
<ItemGroup>
1957-
<_IntermediateAssemblyFiles Include="$(MonoAndroidLinkerInputDir)*" />
1958-
</ItemGroup>
1959-
<Touch Files="@(_IntermediateAssemblyFiles)" />
19601955
</Target>
19611956

19621957
<Target Name="_CollectConfigFiles"

0 commit comments

Comments
 (0)