File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
src/main/java/org/moe/gradle Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,14 @@ public URI getSdkDir() {
9999 return Require .nonNull (sdkDir );
100100 }
101101
102+ @ Nullable
103+ private Boolean remoteAARCH64 ;
104+
105+ @ NotNull
106+ public boolean isRemoteAARCH64 () {
107+ return Require .nonNull (remoteAARCH64 );
108+ }
109+
102110 @ Nullable
103111 private Task moeRemoteServerSetupTask ;
104112
@@ -202,13 +210,19 @@ public void connect() {
202210 throw new GradleException (e .getMessage (), e );
203211 }
204212
213+ fetchArchitecture ();
205214 setupUserHome ();
206215 setupBuildDir ();
207216 prepareServerMOE ();
208217 });
209218 });
210219 }
211220
221+ private void fetchArchitecture () {
222+ String arch = exec ("get arch" , "arch" );
223+ remoteAARCH64 = arch .equals ("arm64" );
224+ }
225+
212226 private void prepareServerMOE () {
213227 final MoeSDK sdk = plugin .getSDK ();
214228
Original file line number Diff line number Diff line change @@ -251,7 +251,12 @@ protected void run() {
251251 "mkdir -p `dirname " + remoteDestArt + "` && " +
252252 "mkdir -p `dirname " + remoteDestOat + "`" );
253253
254- remoteServer .exec ("dex2oat" , dex2oatExec + " " +
254+ String optionalRosetta = "" ;
255+ if (remoteServer .isRemoteAARCH64 () && !Arch .FAMILY_ARM64 .equalsIgnoreCase (getArchFamily ())) {
256+ optionalRosetta = "arch --x86_64 " ;
257+ }
258+
259+ remoteServer .exec ("dex2oat" , optionalRosetta + dex2oatExec + " " +
255260 "--instruction-set=" + Arch .validateArchFamily (getArchFamily ()) + " " +
256261 "--base=0x" + Long .toHexString (getBase ()) + " " +
257262 "--compiler-backend=" + validateBackend (getCompilerBackend ()) + " " +
You can’t perform that action at this time.
0 commit comments