[Xamarin.Android.Build.Tasks] fix _CompileJava running too often #2207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #2088
Context: #2129
Context: #2199
In 4deec52, I fixed the #deletebinobj problem we discovered.
However...
I introduced a regression to incremental builds, I noticed that the
_CompileJavatarget is now running on a second build with nochanges. Third build? oddly it gets skipped...
It seems to be due to our use of flag files:
_UpdateAndroidResgenupdatesR.cs.flagand uses the file as anoutput
_GenerateJavaDesignerForComponentnow usesR.cs.flagas aninput
_GenerateJavaStubsalso updates the timestamp onR.cs.flag.This was added in 970da9e, as a workaround for our two instances
of
ConvertResourcesCases._GenerateJavaDesignerForComponentwill now run again on the nextbuild.
Since 1886e6f eliminated the second call to
ConvertResourcesCases,we don't need to update
R.cs.flagin no. 3 any longer.Removing the call to
<Touch />R.cs.flagin_GenerateJavaStubsfixed the issue, and I added some assertions in relevant tests to
check that the
_CompileJavaand_GenerateJavaDesignerForComponenttargets aren't running on incremental builds.