Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] fix _CompileJava running too often #2207

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,19 @@ public void SwitchBetweenDesignTimeBuild ()
FileAssert.Exists (designtime_build_props, "designtime/build.props should exist after the second `Build`.");

//NOTE: none of these targets should run, since we have not actually changed anything!
Assert.IsTrue (b.Output.IsTargetSkipped ("_UpdateAndroidResgen"), "`_UpdateAndroidResgen` should be skipped!");
//TODO: We would like for this assertion to work, but the <Compile /> item group changes between DTB and regular builds
// $(IntermediateOutputPath)designtime\Resource.designer.cs -> Resources\Resource.designer.cs
// And so the built assembly changes between DTB and regular build, triggering `_LinkAssembliesNoShrink`
//Assert.IsTrue (b.Output.IsTargetSkipped ("_LinkAssembliesNoShrink"), "`_LinkAssembliesNoShrink` should be skipped!");
var targetsToBeSkipped = new [] {
//TODO: We would like for this assertion to work, but the <Compile /> item group changes between DTB and regular builds
// $(IntermediateOutputPath)designtime\Resource.designer.cs -> Resources\Resource.designer.cs
// And so the built assembly changes between DTB and regular build, triggering `_LinkAssembliesNoShrink`
//"_LinkAssembliesNoShrink",
"_UpdateAndroidResgen",
"_GenerateJavaDesignerForComponent",
"_BuildLibraryImportsCache",
"_CompileJava",
};
foreach (var targetName in targetsToBeSkipped) {
Assert.IsTrue (b.Output.IsTargetSkipped (targetName), $"`{targetName}` should be skipped!");
}

b.Target = "Clean";
Assert.IsTrue (b.Build (proj), "clean should have succeeded.");
Expand Down Expand Up @@ -318,7 +326,9 @@ public void CheckTimestamps ([Values (true, false)] bool isRelease)
var targetsToBeSkipped = new [] {
isRelease ? "_LinkAssembliesShrink" : "_LinkAssembliesNoShrink",
"_UpdateAndroidResgen",
"_GenerateJavaDesignerForComponent",
"_BuildLibraryImportsCache",
"_CompileJava",
};
foreach (var targetName in targetsToBeSkipped) {
Assert.IsTrue (b.Output.IsTargetSkipped (targetName), $"`{targetName}` should be skipped!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ because xbuild doesn't support framework reference assemblies.
ResourceDirectories="$(MonoAndroidResDirIntermediate);@(LibraryResourceDirectories)"
ResourceNameCaseMap="$(_AndroidResourceNameCaseMap)"
/>
<Touch Files="$(IntermediateOutputPath)_javastubs.stamp;$(_AndroidResgenFlagFile)" AlwaysCreate="True" />
<Touch Files="$(IntermediateOutputPath)_javastubs.stamp" AlwaysCreate="True" />
<ItemGroup>
<FileWrites Include="$(IntermediateOutputPath)_javastubs.stamp" />
</ItemGroup>
Expand Down