88using System . Xml . Linq ;
99using System . Collections . Generic ;
1010using System . Globalization ;
11+ using Xamarin . Android . Tasks ;
1112
1213namespace 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 ()
656662public class TestJavaClass2 {
657663
658664 public String test(){
659-
665+
660666 return ""Java is called"";
661667 }
662668}" ,
@@ -674,7 +680,7 @@ public String test(){
674680public class TestJavaClass {
675681
676682 public String test(){
677-
683+
678684 return ""Java is called"";
679685 }
680686}" ,
0 commit comments