[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
_CompileJava
target 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:
_UpdateAndroidResgen
updatesR.cs.flag
and uses the file as anoutput
_GenerateJavaDesignerForComponent
now usesR.cs.flag
as aninput
_GenerateJavaStubs
also updates the timestamp onR.cs.flag
.This was added in 970da9e, as a workaround for our two instances
of
ConvertResourcesCases
._GenerateJavaDesignerForComponent
will now run again on the nextbuild.
Since 1886e6f eliminated the second call to
ConvertResourcesCases
,we don't need to update
R.cs.flag
in no. 3 any longer.Removing the call to
<Touch />
R.cs.flag
in_GenerateJavaStubs
fixed the issue, and I added some assertions in relevant tests to
check that the
_CompileJava
and_GenerateJavaDesignerForComponent
targets aren't running on incremental builds.