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 Inputs for _Generate*Java* targets #9174

Merged
merged 1 commit into from
Aug 6, 2024
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 @@ -1655,5 +1655,36 @@ public void SimilarAndroidXAssemblyNames ([Values(true, false)] bool publishTrim
using var builder = CreateApkBuilder ();
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
}

[Test]
public void IncrementalBuildDifferentDevice()
{
var proj = new XamarinAndroidApplicationProject {
Imports = {
new Import (() => "MockPrimaryCpuAbi.targets") {
TextContent = () =>
"""
<Project>
<!-- This target "mocks" what _GetPrimaryCpuAbi does -->
<Target Name="_MockPrimaryCpuAbi" BeforeTargets="_CreatePropertiesCache">
<PropertyGroup>
<RuntimeIdentifier>$(_SingleRID)</RuntimeIdentifier>
<RuntimeIdentifiers></RuntimeIdentifiers>
<AndroidSupportedAbis>$(_SingleABI)</AndroidSupportedAbis>
</PropertyGroup>
</Target>
</Project>
"""
},
},
};
using var builder = CreateApkBuilder ();
builder.Target = "Build";
builder.BuildingInsideVisualStudio = false;
Assert.IsTrue (builder.Build (proj, parameters: [ "_SingleRID=android-arm64", "_SingleABI=arm64-v8a" ]),
"first build should have succeeded.");
Assert.IsTrue (builder.Build (proj, parameters: [ "_SingleRID=android-x64", "_SingleABI=x86_64" ], doNotCleanupOnUpdate: true),
"second build should have succeeded.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ because xbuild doesn't support framework reference assemblies.

<Target Name="_GenerateJavaStubs"
DependsOnTargets="$(_GenerateJavaStubsDependsOnTargets);$(BeforeGenerateAndroidManifest)"
Inputs="@(_AndroidMSBuildAllProjects);@(_ResolvedUserMonoAndroidAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache);@(AndroidEnvironment);@(LibraryEnvironments)"
Inputs="@(_AndroidMSBuildAllProjects);$(_ResolvedUserAssembliesHashFile);@(_ResolvedUserMonoAndroidAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache);@(AndroidEnvironment);@(LibraryEnvironments)"
Outputs="$(_AndroidStampDirectory)_GenerateJavaStubs.stamp">

<PropertyGroup>
Expand Down Expand Up @@ -1691,7 +1691,7 @@ because xbuild doesn't support framework reference assemblies.

<Target Name="_GeneratePackageManagerJava"
DependsOnTargets="$(_GeneratePackageManagerJavaDependsOn)"
Inputs="@(_AndroidMSBuildAllProjects);$(_ResolvedUserAssembliesHashFile);$(MSBuildProjectFile);$(_AndroidBuildPropertiesCache);@(AndroidEnvironment);@(LibraryEnvironments)"
Inputs="@(_AndroidMSBuildAllProjects);$(_ResolvedUserAssembliesHashFile);@(_ResolvedUserMonoAndroidAssemblies);$(_AndroidBuildPropertiesCache);@(AndroidEnvironment);@(LibraryEnvironments)"
Outputs="$(_AndroidStampDirectory)_GeneratePackageManagerJava.stamp">
<!-- Create java needed for Mono runtime -->
<GeneratePackageManagerJava
Expand Down
Loading