Skip to content

Commit 79bc4ec

Browse files
committed
CheckIncludedAssemblies works
1 parent 5050e30 commit 79bc4ec

File tree

1 file changed

+16
-4
lines changed
  • src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests

1 file changed

+16
-4
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,25 @@ public void CheckDebugModeWithTrimming ([Values (AndroidRuntime.MonoVM, AndroidR
8484

8585
[Test]
8686
[NonParallelizable] // Commonly fails NuGet restore
87-
public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblyStores)
87+
public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblyStores, [Values (AndroidRuntime.MonoVM, AndroidRuntime.CoreCLR)] AndroidRuntime runtime)
8888
{
89+
if (!usesAssemblyStores && runtime == AndroidRuntime.CoreCLR) {
90+
Assert.Ignore ("CoreCLR only supports builds with assembly stores.");
91+
return;
92+
}
93+
8994
var proj = new XamarinAndroidApplicationProject {
9095
IsRelease = true
9196
};
9297

9398
AndroidTargetArch[] supportedArches = new[] {
94-
AndroidTargetArch.Arm,
99+
runtime switch {
100+
AndroidRuntime.MonoVM => AndroidTargetArch.Arm,
101+
AndroidRuntime.CoreCLR => AndroidTargetArch.Arm64,
102+
_ => throw new NotSupportedException ($"Unsupported runtime '{runtime}'")
103+
}
95104
};
96-
105+
proj.SetRuntime (runtime);
97106
proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyStores.ToString ());
98107
proj.SetRuntimeIdentifiers (supportedArches);
99108
proj.PackageReferences.Add (new Package {
@@ -130,9 +139,12 @@ public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblySto
130139
"System.Collections.dll",
131140
"System.Collections.Concurrent.dll",
132141
"System.Text.RegularExpressions.dll",
133-
"libarc.bin.so",
134142
};
135143

144+
if (runtime == AndroidRuntime.MonoVM) {
145+
expectedFiles.Add ("libarc.bin.so");
146+
}
147+
136148
using (var b = CreateApkBuilder ()) {
137149
Assert.IsTrue (b.Build (proj), "build should have succeeded.");
138150
var apk = Path.Combine (Root, b.ProjectDirectory,

0 commit comments

Comments
 (0)