forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 1
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] target to simplify @(FileWrites) (dotne…
…t#2344) In our "MSBuild Best Practices" guide, the convention for using a "stamp" file has a bit of boilerplate: `<Touch/>` the file, then add the file to the `@(FileWrites)` group: <Target Name="_MyTarget" Inputs="..." Outputs="$(_AndroidStampDirectory)_MyTarget.stamp"> <!--...--> <Touch Files="$(_AndroidStampDirectory)_MyTarget.stamp" AlwaysCreate="True" /> <ItemGroup> <FileWrites Include="$(_AndroidStampDirectory)_MyTarget.stamp" /> </ItemGroup> </Target> It is reasonably easy to mess this up. If we add a new `_AddFilesToFileWrites` target which runs before the `IncrementalClean` target and automatically adds `$(_AndroidStampDirectory)*.stamp` to `@(FileWrites)`, we can simplify things by only requiring the `<Touch/>`: <Target Name="_MyTarget" Inputs="..." Outputs="$(_AndroidStampDirectory)_MyTarget.stamp"> <!--...--> <Touch Files="$(_AndroidStampDirectory)_MyTarget.stamp" AlwaysCreate="True" /> </Target> This should be less prone to mistakes.
- Loading branch information
1 parent
dbc1ad3
commit 3dc914d
Showing
2 changed files
with
16 additions
and
14 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