@@ -960,6 +960,10 @@ class Wasm32WasiDebugBuild(_Wasm32WasiBuild):
960960 testFlags = ["-u-cpu" ]
961961
962962
963+ ##############################################################################
964+ ################################ IOS BUILDS ################################
965+ ##############################################################################
966+
963967class _IOSSimulatorBuild (UnixBuild ):
964968 """iOS Simulator build.
965969
@@ -1138,3 +1142,71 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
11381142class IOSARM64SimulatorBuild (_IOSSimulatorBuild ):
11391143 """An ARM64 iOS simulator build."""
11401144 arch = "arm64"
1145+
1146+
1147+ ##############################################################################
1148+ ############################## ANDROID BUILDS ##############################
1149+ ##############################################################################
1150+
1151+ class AndroidBuild (BaseBuild ):
1152+ """Build Python for Android on a Linux or Mac machine, and test it using a
1153+ Gradle-managed emulator. Worker setup instructions:
1154+
1155+ * Install all the usual tools and libraries needed to build Python for the
1156+ worker's own operating system.
1157+
1158+ * Follow the instructions in the Prerequisites section of
1159+ cpython/Android/README.md.
1160+
1161+ * On Linux:
1162+ * Make sure the worker has access to the KVM virtualization interface.
1163+ * Start an X server such as Xvfb, and set the DISPLAY environment variable
1164+ to point at it.
1165+ """
1166+
1167+ def setup (self , ** kwargs ):
1168+ android_py = "Android/android.py"
1169+ self .addSteps ([
1170+ SetPropertyFromCommand (
1171+ name = "Get build triple" ,
1172+ command = ["./config.guess" ],
1173+ property = "build_triple" ,
1174+ haltOnFailure = True ,
1175+ ),
1176+ Configure (
1177+ name = "Configure build Python" ,
1178+ command = [android_py , "configure-build" ],
1179+ ),
1180+ Compile (
1181+ name = "Compile build Python" ,
1182+ command = [android_py , "make-build" ],
1183+ ),
1184+ Configure (
1185+ name = "Configure host Python" ,
1186+ command = [android_py , "configure-host" , self .host_triple ],
1187+ ),
1188+ Compile (
1189+ name = "Compile host Python" ,
1190+ command = [android_py , "make-host" , self .host_triple ],
1191+ ),
1192+ Compile (
1193+ name = "Build testbed" ,
1194+ command = [android_py , "build-testbed" ],
1195+ ),
1196+ Test (
1197+ command = [
1198+ android_py , "test" , "--managed" , "maxVersion" , "--" ,
1199+ "-W" , "-uall" ,
1200+ ],
1201+ timeout = step_timeout (self .test_timeout ),
1202+ ),
1203+ ShellCommand (
1204+ name = "Clean" ,
1205+ command = [android_py , "clean" ],
1206+ ),
1207+ ])
1208+
1209+ @util .renderer
1210+ def host_triple (props ):
1211+ build_triple = props .getProperty ("build_triple" )
1212+ return build_triple .split ("-" )[0 ] + "-linux-android"
0 commit comments