-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AndroidResource Incremental build issue (#9592)
Fixes #9588 Adding a new Android resource to a project causes the incremental build to error with: ``` Resources\layout\activity_two.xml error APT2126: file not found. ``` This error comes from the `Aapt2Compile` task. It is looking for `\obj\Debug\net9.0-android\res\layout\activity_two.xml` but that file doesn't exist. What was happening is the new file had the same modified date as the flag/stamp file that was used to generate it. The user was using `copy Resources\layout\activity_main.xml Resources\layout\activity_two.xml`. So the modified date was not "new". This caused the _GenerateAndroidResourceDir target to get skipped. What we should do is copy what we do in other places, and hash all the input files (and their destinations) into one hash. We can then use that hash file as an input to the target. This allows us to detect when a new file is added, even if it has an old timestamp. A unit test was added as well.
- Loading branch information
1 parent
0cff647
commit 0434024
Showing
3 changed files
with
43 additions
and
1 deletion.
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