Skip to content

Commit 23a5d24

Browse files
committed
InstallWithoutSharedRuntime, BaseZip and RunWithLLVMEnabled work
1 parent f7ba721 commit 23a5d24

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ string [] ListArchiveContents (string archive, bool usesAssembliesBlob)
158158
[Test]
159159
public void BaseZip ()
160160
{
161+
if (runtime == AndroidRuntime.CoreCLR && !usesAssemblyBlobs) {
162+
Assert.Ignore ("CoreCLR does not support builds without assembly stores");
163+
return;
164+
}
165+
161166
var baseZip = Path.Combine (intermediate, "android", "bin", "base.zip");
162167
var contents = ListArchiveContents (baseZip, usesAssemblyBlobs);
163168
var expectedFiles = new List<string> {

tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,8 @@ public void RunWithLLVMEnabled ()
572572
var proj = new XamarinAndroidApplicationProject () {
573573
IsRelease = true,
574574
};
575+
// Mono-only test
576+
proj.SetRuntime (AndroidRuntime.MonoVM);
575577
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");
576578
proj.SetProperty ("EnableLLVM", true.ToString ());
577579

tests/MSBuildDeviceIntegration/Tests/InstallTests.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Xml.Linq;
99
using System.Collections.Generic;
1010
using System.Globalization;
11+
using Xamarin.Android.Tasks;
1112

1213
namespace Xamarin.Android.Build.Tests
1314
{
@@ -164,20 +165,25 @@ public void SwitchConfigurationsShouldRedeploy ()
164165
}
165166

166167
[Test]
167-
public void InstallWithoutSharedRuntime ()
168+
public void InstallWithoutSharedRuntime ([Values (AndroidRuntime.MonoVM, AndroidRuntime.CoreCLR)] AndroidRuntime runtimeType)
168169
{
169170
AssertCommercialBuild ();
170171

171172
var proj = new XamarinAndroidApplicationProject () {
172173
IsRelease = true,
173174
};
175+
proj.SetRuntime (runtimeType);
174176
proj.SetProperty (proj.ReleaseProperties, "Optimize", false);
175177
proj.SetProperty (proj.ReleaseProperties, "DebugType", "none");
176178
// NOTE: in .NET 6, EmbedAssembliesIntoApk=true by default for Release builds
177179
proj.SetProperty (proj.ReleaseProperties, "EmbedAssembliesIntoApk", "false");
178180
proj.SetProperty (proj.ReleaseProperties, "AndroidPackageFormat", "apk");
179181

180-
var abis = new [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" };
182+
string[] abis = runtimeType switch {
183+
AndroidRuntime.MonoVM => new [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" },
184+
AndroidRuntime.CoreCLR => new [] { "arm64-v8a", "x86_64" },
185+
_ => throw new NotSupportedException ($"Unsupported runtime {runtimeType}")
186+
};
181187
proj.SetRuntimeIdentifiers (abis);
182188
using (var builder = CreateApkBuilder ()) {
183189
if (RunAdbCommand ("shell pm list packages Mono.Android.DebugRuntime").Trim ().Length != 0)
@@ -550,7 +556,7 @@ public void IncrementalFastDeployment (string packageFormat)
550556
}
551557

552558
long lib1FirstBuildSize = new FileInfo (Path.Combine (rootPath, lib1.ProjectName, lib1.OutputPath, "Library1.dll")).Length;
553-
559+
554560
using (var builder = CreateApkBuilder (Path.Combine (rootPath, app.ProjectName))) {
555561
builder.Verbosity = LoggerVerbosity.Detailed;
556562
builder.ThrowOnBuildFailure = false;
@@ -656,7 +662,7 @@ public void AppWithAndroidJavaSource ()
656662
public class TestJavaClass2 {
657663
658664
public String test(){
659-
665+
660666
return ""Java is called"";
661667
}
662668
}",
@@ -674,7 +680,7 @@ public String test(){
674680
public class TestJavaClass {
675681
676682
public String test(){
677-
683+
678684
return ""Java is called"";
679685
}
680686
}",

0 commit comments

Comments
 (0)