Skip to content

Commit 308c6ed

Browse files
committed
Dev: add copying of binary artifacts
1 parent abae417 commit 308c6ed

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/bash/swift-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ ! -d "$XCODE_TOOLCHAIN" ]; then
1818
fi
1919

2020
export BUILD_ANDROID=1
21-
ANDROID_API_LEVEL="${SWIFT_ANDROID_API_LEVEL:=28}"
21+
ANDROID_API_LEVEL="${SWIFT_ANDROID_API_LEVEL:=29}"
2222

2323
export CC="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang"
2424
export CXX="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++"

src/python/utils.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ def setup(cls, configuration):
121121

122122
@classmethod
123123
@memoized
124-
def triple(cls):
124+
def target(cls):
125125
arch = os.environ.get("SWIFT_ANDROID_ARCH")
126-
level = os.environ.get("SWIFT_ANDROID_API_LEVEL", "24")
126+
level = os.environ.get("SWIFT_ANDROID_API_LEVEL", "29")
127127

128128
if arch == "aarch64" or arch is None:
129129
return "aarch64-unknown-linux-android{}".format(level)
@@ -136,6 +136,22 @@ def triple(cls):
136136
else:
137137
raise Exception("Unknown arch '{}'".format(arch))
138138

139+
@classmethod
140+
@memoized
141+
def tripple(cls):
142+
arch = os.environ.get("SWIFT_ANDROID_ARCH")
143+
144+
if arch == "aarch64" or arch is None:
145+
return "aarch64-linux-android"
146+
if arch == "x86_64":
147+
return "x86_64-linux-android"
148+
elif arch == "armv7":
149+
return "armv7-linux-androideabi"
150+
elif arch == "i686":
151+
return "i686-linux-android"
152+
else:
153+
raise Exception("Unknown arch '{}'".format(arch))
154+
139155
@classmethod
140156
@memoized
141157
def abi(cls):
@@ -193,26 +209,17 @@ def build_root(cls):
193209
@classmethod
194210
@memoized
195211
def build_dir(cls):
196-
return os.path.join(cls.build_root(), BuildConfig.triple(), BuildConfig.configuration())
197-
198-
@classmethod
199-
def external_build_root(cls, name):
200-
return os.path.join(cls.build_root(), "external-build", name)
212+
return os.path.join(cls.build_root(), BuildConfig.target(), BuildConfig.configuration())
201213

202214
@classmethod
203215
@memoized
204216
def external_out_dir(cls):
205-
return os.path.join(cls.build_root(), "jniLibs")
206-
207-
@classmethod
208-
@memoized
209-
def external_include_dir(cls):
210-
return os.path.join(cls.external_out_dir(), "include")
217+
return os.path.join(cls.build_root(), "artifacts/*/*/*")
211218

212219
@classmethod
213220
@memoized
214221
def external_libs_dir(cls):
215-
return os.path.join(cls.external_out_dir(), BuildConfig.abi())
222+
return os.path.join(cls.external_out_dir(), BuildConfig.tripple())
216223

217224
class TestingApp(object):
218225
@classmethod

0 commit comments

Comments
 (0)