-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] refactor symbol files targets (#2394)
~~ _ConvertPdbFiles, _CopyPdbFiles, and _CopyMdbFiles ~~ These targets were building incrementally, but not optimally: - `<CopyMdbFiles/>` (duplicate of `<CopyIfChanged/>`) was copying the symbol files. - The `Outputs` of these targets were all being touched, after the `<CopyIfChanged/>` call, even if they didn't change. - These targets contained vestigial support for XBuild and was writing directly to `$(IntermediateOutputPath)$(CleanFile)` instead of adding to `@(FileWrites)`. The file would continue to grow with duplicates on incremental builds. - Several `<ItemGroup/>` transforms were duplicated throughout the targets. Changes: - Removed `<CopyMdbFiles/>` and use `<CopyIfChanged/>` instead. - Use "stamp" files as per our convention as `Outputs`. - Declare new `<ItemGroup/>` values where necessary, instead of using wildcards or repetitive transforms. - Verified that `@(FileWrites)` was correct. ~~ _CopyIntermediateAssemblies ~~ It appears the `Inputs` should actually be `@(ResolvedAssemblies)`, since that is the `<ItemGroup/>` used throughout this target. Other refactoring: - Fixed duplicate item transforms, by using private `<ItemGroup/>` - Added files to `@(FileWrites)` ~~ _PrepareAssemblies ~~ Since removing the direct writing to `$(CleanFile)` (01be8ac), I discovered most of the targets run during `_PrepareAssemblies` were not properly adding to `@(FileWrites)` due to the ordering of MSBuild targets. I added `BeforeTargets="_CleanGetCurrentAndPriorFileWrites"`, but set it up to optionally happen only if `$(AndroidApplication)`=True. This made any targets that run during `_PrepareAssemblies` appropriately add to `@(FileWrites)`. ~~ _LinkAssemblies and _LinkAssembliesNoShrink ~~ Both targets need to add files to `@(FileWrites)`. Additionally, `_LinkAssembliesNoShrink` has another problem: `_LinkAssembliesNoShrink` should be using `$(MonoAndroidIntermediateAssemblyDir)` for `@(_LinkAssembliesNoShrinkFiles)`, which are any files in `$(IntermediateOutputPath)android\assets`. ~~ _CleanGetCurrentAndPriorFileWrites ~~ I've found the only way to make sure an MSBuild target runs *before* `IncrementalClean` is to add: BeforeTargets="_CleanGetCurrentAndPriorFileWrites" I adjusted the `_AddFilesToFileWrites` target to run before the `_CleanGetCurrentAndPriorFileWrites` target. I documented my findings, see details here: <dotnet/msbuild#3916> ~~ Tests ~~ `AppProjectTargetsDoNotBreak` - added checks for these targets: `_ConvertPdbFiles`, `_CopyPdbFiles`, and `_CopyMdbFiles`.
- Loading branch information
1 parent
3caf3ed
commit 539954c
Showing
7 changed files
with
224 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.