Skip to content

Commit 8f25ca3

Browse files
committed
Android SDK build
1 parent 7c66259 commit 8f25ca3

File tree

4 files changed

+633
-6
lines changed

4 files changed

+633
-6
lines changed

.github/workflows/pull_request.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,21 @@ jobs:
2525
static-linux-build:
2626
name: Build Static Linux image
2727
runs-on: ubuntu-latest
28+
if: false
2829
steps:
2930
- name: Checkout repository
3031
uses: actions/checkout@v4
3132
- name: Build Docker images
3233
working-directory: swift-ci/sdks/static-linux
33-
# need 2 since the initial checkout sometimes fails
34-
run: ./build || ./build
34+
run: ./build
3535

3636
android-build:
37-
name: Build Android image
38-
runs-on: ubuntu-latest
39-
if: false
37+
name: Build Android SDK
38+
runs-on: ubuntu-24.04
4039
steps:
4140
- name: Checkout repository
4241
uses: actions/checkout@v4
43-
- name: Build Docker images
42+
- name: Build Android SDK
4443
working-directory: swift-ci/sdks/android
4544
run: ./build
4645

swift-ci/sdks/android/build

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash -ex
2+
# Swift Android SDK: Top-level Build Script
3+
4+
SDKROOT=${TMPDIR:-/tmp}/swift-android-sdk
5+
6+
mkdir -p ${SDKROOT}/products
7+
8+
# Check-out the sources
9+
if [[ ! -d ${SDKROOT}/src ]]; then
10+
scripts/fetch-source.sh --source-dir ${SDKROOT}/src
11+
fi
12+
13+
mkdir -p ${SDKROOT}
14+
15+
export ANDROID_NDK_HOME=${SDKROOT}/ndk/android-ndk-r27c
16+
export ANDROID_NDK=${ANDROID_NDK_HOME}
17+
18+
if [[ ! -d ${ANDROID_NDK_HOME} ]]; then
19+
mkdir -p $(dirname ${ANDROID_NDK_HOME})
20+
pushd $(dirname ${ANDROID_NDK_HOME})
21+
wget https://dl.google.com/android/repository/$(basename $ANDROID_NDK_HOME).zip
22+
unzip $(basename $ANDROID_NDK_HOME).zip
23+
popd
24+
fi
25+
26+
if [[ ! -d ${SDKROOT}/src ]]; then
27+
./scripts/fetch-source.sh --source-dir ${SDKROOT}/src
28+
fi
29+
30+
HOST_TOOLCHAIN=${HOST_TOOLCHAIN:-$(dirname $(dirname $(which swiftc)))}
31+
#HOST_TOOLCHAIN=${HOST_TOOLCHAIN:-${HOME}/.local/share/swiftly/toolchains/6.1.0/usr}
32+
33+
ARCH=aarch64
34+
#ARCH=x86_64
35+
./scripts/build.sh --products-dir ${SDKROOT}/prod --source-dir ${SDKROOT}/src --build-dir ${SDKROOT}/build --ndk-home ${ANDROID_NDK_HOME} --host-toolchain ${HOST_TOOLCHAIN} --archs $ARCH
36+
37+

0 commit comments

Comments
 (0)