1
1
using System ;
2
+ using System . Collections . Generic ;
2
3
using System . Diagnostics ;
3
4
using System . IO ;
4
5
using System . Linq ;
@@ -649,7 +650,18 @@ public abstract class MyRunner {
649
650
}"
650
651
} ) ;
651
652
var proj = new XamarinAndroidApplicationProject { IsRelease = true , ProjectName = "App1" } ;
652
- proj . SetRuntimeIdentifiers ( [ "armeabi-v7a" , "arm64-v8a" , "x86" , "x86_64" ] ) ;
653
+
654
+ bool thirtyTwoBitAbisSupported =
655
+ ! TargetRuntimeHelper . UseCoreCLR ||
656
+ ( TargetRuntimeHelper . CoreClrSupportsAbi ( "armeabi-v7a" ) && TargetRuntimeHelper . CoreClrSupportsAbi ( "x86" ) ) ;
657
+
658
+ var rids = new List < string > { "arm64-v8a" , "x86_64" } ;
659
+ if ( thirtyTwoBitAbisSupported ) {
660
+ rids . Add ( "armeabi-v7a" ) ;
661
+ rids . Add ( "x86" ) ;
662
+ }
663
+
664
+ proj . SetRuntimeIdentifiers ( rids ) ;
653
665
proj . References . Add ( new BuildItem . ProjectReference ( Path . Combine ( ".." , "Lib1" , "Lib1.csproj" ) , "Lib1" ) ) ;
654
666
proj . MainActivity = proj . DefaultMainActivity . Replace (
655
667
"base.OnCreate (bundle);" ,
@@ -665,11 +677,15 @@ public abstract class MyRunner {
665
677
666
678
var intermediate = Path . Combine ( Root , b . ProjectDirectory , proj . IntermediateOutputPath ) ;
667
679
var dll = $ "{ lib . ProjectName } .dll";
668
- Assert64Bit ( "android-arm" , expected64 : false ) ;
680
+
669
681
Assert64Bit ( "android-arm64" , expected64 : true ) ;
670
- Assert64Bit ( "android-x86" , expected64 : false ) ;
671
682
Assert64Bit ( "android-x64" , expected64 : true ) ;
672
683
684
+ if ( thirtyTwoBitAbisSupported ) {
685
+ Assert64Bit ( "android-arm" , expected64 : false ) ;
686
+ Assert64Bit ( "android-x86" , expected64 : false ) ;
687
+ }
688
+
673
689
void Assert64Bit ( string rid , bool expected64 )
674
690
{
675
691
var assembly = AssemblyDefinition . ReadAssembly ( Path . Combine ( intermediate , rid , "linked" , "shrunk" , dll ) ) ;
0 commit comments