Skip to content

Commit acc13e4

Browse files
authored
Integration Test CI enables windows OS building Android Testapps (#134)
1 parent 63efe75 commit acc13e4

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

scripts/gha/build_testapps.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
from integration_testing import unity_finder
113113
from integration_testing import unity_version
114114
from integration_testing import xcodebuild
115+
from print_matrix_configuration import UNITY_SETTINGS
115116

116117
# Used in specifying whether xcodebuild should build for device or simulator
117118
_DEVICE_REAL = "real"
@@ -469,8 +470,9 @@ def build_testapp(dir_helper, api_config, ios_config, target):
469470

470471
def patch_android_env(unity_version):
471472
major_version = int(unity_version.split(".")[0])
472-
if major_version >= 2019:
473-
url = "https://dl.google.com/android/repository/android-ndk-r19-darwin-x86_64.zip"
473+
# Set ndk env
474+
if UNITY_SETTINGS[str(major_version)][get_desktop_platform()]["ndk"]:
475+
url = UNITY_SETTINGS[str(major_version)][get_desktop_platform()]["ndk"]
474476
logging.info("install ndk: %s", url)
475477
ndk_zip_path = "ndk_zip"
476478
ndk_path = "ndk"
@@ -486,9 +488,9 @@ def patch_android_env(unity_version):
486488
try:
487489
# This is a bug from Unity:
488490
# https://issuetracker.unity3d.com/issues/android-android-build-fails-when-targeting-sdk-31-and-using-build-tools-31-dot-0-0
489-
_run([os.environ["ANDROID_HOME"]+"/tools/bin/sdkmanager", "--uninstall", "build-tools;31.0.0"])
491+
_run([os.environ["ANDROID_HOME"]+"/tools/bin/sdkmanager", "--uninstall", "build-tools;31.0.0"], check=False)
490492
logging.info("Uninstall Android build tool 31.0.0")
491-
except(subprocess.SubprocessError, RuntimeError) as e:
493+
except Exception as e:
492494
logging.info(str(e))
493495

494496
os.environ["UNITY_ANDROID_SDK"]=os.environ["ANDROID_HOME"]

scripts/gha/print_matrix_configuration.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,13 @@
8585
"2020": {
8686
_WINDOWS: {
8787
"version": "2020.3.22f1",
88-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac-mono"], "Linux": ["Linux-mono"]}
88+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac-mono"], "Linux": ["Linux-mono"]},
89+
"ndk": "https://dl.google.com/android/repository/android-ndk-r19-windows-x86_64.zip"
8990
},
9091
_MACOS: {
9192
"version": "2020.3.22f1",
92-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]}
93+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]},
94+
"ndk": "https://dl.google.com/android/repository/android-ndk-r19-darwin-x86_64.zip"
9395
},
9496
_LINUX: {
9597
"version": "2020.3.22f1",
@@ -99,11 +101,13 @@
99101
"2019": {
100102
_WINDOWS: {
101103
"version": "2019.4.32f1",
102-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac-mono"], "Linux": ["Linux-mono"]}
104+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac-mono"], "Linux": ["Linux-mono"]},
105+
"ndk": "https://dl.google.com/android/repository/android-ndk-r19-windows-x86_64.zip"
103106
},
104107
_MACOS: {
105108
"version": "2019.4.32f1",
106-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]}
109+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": None, "Linux": ["Linux-mono"]},
110+
"ndk": "https://dl.google.com/android/repository/android-ndk-r19-darwin-x86_64.zip"
107111
},
108112
_LINUX: {
109113
"version": "2019.4.33f1",
@@ -113,11 +117,13 @@
113117
"2018": {
114118
_WINDOWS: {
115119
"version": "2018.4.36f1",
116-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-il2cpp"], "macOS": ["Mac-mono"], "Linux": ["Linux"]}
120+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-il2cpp"], "macOS": ["Mac-mono"], "Linux": ["Linux"]},
121+
"ndk": "https://dl.google.com/android/repository/android-ndk-r16b-windows-x86_64.zip"
117122
},
118123
_MACOS: {
119124
"version": "2018.4.36f1",
120-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": ["Mac-il2cpp"], "Linux": ["Linux"]}
125+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows-mono"], "macOS": ["Mac-il2cpp"], "Linux": ["Linux"]},
126+
"ndk": "https://dl.google.com/android/repository/android-ndk-r16b-darwin-x86_64.zip"
121127
},
122128
_LINUX: {
123129
"version": "2018.4.36f1",
@@ -127,11 +133,13 @@
127133
"2017": {
128134
_WINDOWS: {
129135
"version": "2017.4.40f1",
130-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac"], "Linux": ["Linux"]}
136+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": None, "macOS": ["Mac"], "Linux": ["Linux"]},
137+
"ndk": ""
131138
},
132139
_MACOS: {
133140
"version": "2017.4.40f1",
134-
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows"], "macOS": None, "Linux": ["Linux"]}
141+
"packages": {"Default": ["Unity"], "Android": ["Android"], "iOS": ["Ios"], "Windows": ["Windows"], "macOS": None, "Linux": ["Linux"]},
142+
"ndk": ""
135143
},
136144
_LINUX: {
137145
"version": "2017.4.10f1",

0 commit comments

Comments
 (0)