forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
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] Move DesignTime Designer to `$(BaseInte…
…rmediateOutputPath)`. Fixes dotnet#1286 One of the problems we face with design time builds is MSBuild keeps deleting our files. As a result the design time build keeps failing. The main reason for this is `IncrementalClean` keeps removing the files. But in addition to this the `Clean` target also ends up deleting these files. However our existing `fix` does not work since `IncrementalClean` is not called. So the code we have to save the files is not called. One solution is to move the generated files out from the `$(IntermediateOutputPath)` and into the `$(BaseIntermediateOutputPath)`. The latter is not cleaned by the `IncrementalClean` target in MSBuild. Those does present a problem with our `xbuild` support. xbuild has a target `CoreClean` which is called when `Clean` is called. However it also calls `_GetCleanFileWrites` which populates the `PreviousFileWrites` ItemGroup with files in the `$(CleanFile)`. As a result xbuild deletes the files even if they are in `$(BaseIntermediateOutputPath)`. This behaviour is different from MSBuild. Interestingly `Xamarin.Android.Windows.targets` has some code in it already to determine if we are running under MSBuild or xbuild. It also contains the code for dealing with the `IncrementalClean` target problems. Since we need some of those code on any platform that uses MSBuild (Windows, Mac and Linux) we should move some of that code into the main `Xamarin.Android.Common.targets/props` and reuse some of it to handle this problem. The code to check if we are running on MSBuild or xbuild is now in `Xamarin.Android.Common.props`. The `_RegisterAndroidFilesWithFileWrites` is now in `Xamarin.Android.Common.targets` along side a new target `_OverrideXbuildCleanFileWrites` which will prevent the design time files from being deleted under xbuild. The various tests have been updated to reflect this new setup. A new test to make sure we never delete these files has been added.
- Loading branch information
1 parent
cb68bc3
commit 0cec603
Showing
7 changed files
with
72 additions
and
30 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 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
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