Skip to content

Commit c9655b1

Browse files
committed
1 parent 7fee5ff commit c9655b1

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

swift-ci/sdks/android/build-local

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ fi
5252
mkdir -p ${SDKROOT}/products
5353

5454
./scripts/fetch-source.sh --source-dir ${SDKROOT}/src --swift-tag ${SWIFT_TAG}
55-
5655
./scripts/patch-sources.sh ${SDKROOT}/src
5756

5857
./scripts/build.sh --products-dir ${SDKROOT}/products --source-dir ${SDKROOT}/src --build-dir ${SDKROOT}/build --ndk-home ${ANDROID_NDK_HOME} --android-api ${ANDROID_API} --host-toolchain ${HOST_TOOLCHAIN} --archs ${TARGET_ARCHS} ${@}
59-

swift-ci/sdks/android/scripts/patch-sources.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ if [[ ! -d "${patches_dir}" ]]; then
1818
exit 1
1919
fi
2020

21-
if [[ "${BUILD_VERSION}" == "" ]]; then
22-
echo "$0: BUILD_VERSION environment is not set"
23-
exit 1
24-
fi
25-
2621
cd ${source_dir}/swift-project
2722
swift_android_patch="${patches_dir}/swift-android.patch"
2823

@@ -33,13 +28,28 @@ perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' $swift_android_patch
3328
# remove the need to link in android-execinfo
3429
perl -pi -e 's/dispatch android-execinfo/dispatch/g' $swift_android_patch
3530

36-
if [ "${BUILD_VERSION}" = 'release' ]; then
37-
testing_patch="${patches_dir}/swift-android-testing-release.patch"
38-
else
39-
testing_patch="${patches_dir}/swift-android-testing-except-release.patch"
40-
fi
31+
case "${BUILD_VERSION}" in
32+
release)
33+
testing_patch="${patches_dir}/swift-android-testing-release.patch"
34+
;;
35+
devel)
36+
testing_patch="${patches_dir}/swift-android-testing-except-release.patch"
37+
;;
38+
trunk)
39+
testing_patch="${patches_dir}/swift-android-testing-except-release.patch"
40+
dispatch_patch="${patches_dir}/swift-android-trunk-libdispatch.patch"
41+
;;
42+
*)
43+
echo "$0: invalid BUILD_VERSION=${BUILD_VERSION}"
44+
exit 1
45+
;;
46+
esac
47+
48+
for patch in "$swift_android_patch" "$testing_patch" "$dispatch_patch"; do
49+
if [[ "${patch}" == "" ]]; then
50+
continue
51+
fi
4152

42-
for patch in "$swift_android_patch" "$testing_patch"; do
4353
echo "applying patch $patch in $PWD"
4454

4555
if git apply -C1 --reverse --check "$patch" >/dev/null 2>&1 ; then
@@ -59,4 +69,3 @@ perl -pi -e 's/os\(Android\)/os\(AndroidDISABLED\)/g' swift-testing/Sources/Test
5969
# need to un-apply libandroid-spawn since we don't need it for API28+
6070
perl -pi -e 's/MATCHES "Android"/MATCHES "AndroidDISABLED"/g' llbuild/lib/llvm/Support/CMakeLists.txt
6171
perl -pi -e 's/ STREQUAL Android\)/ STREQUAL AndroidDISABLED\)/g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
62-

swift-ci/sdks/android/scripts/toolchain-vars.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
11
#!/bin/bash -e
2+
#
3+
# ===----------------------------------------------------------------------===
4+
#
5+
# Swift Android SDK: Toolchain source variables
6+
#
7+
# ===----------------------------------------------------------------------===
8+
9+
# This script is meant to be sourced from another script that sets the
10+
# BUILD_VERSION environment variable to one of "release", "devel", or "trunk"
11+
# and will set check the latest builds for each build type in order
12+
# to provide information about the Swift tag name in use and where to
13+
# obtain the latest toolchain for building.
14+
15+
# TODO: we could instead use the latest-build.yml files for this, like:
16+
# https://download.swift.org/swift-6.2-branch/ubuntu2404/latest-build.yml
17+
# https://download.swift.org/development/ubuntu2404/latest-build.yml
18+
# but there doesn't seem to be one for the current release build.
219

320
case "${BUILD_VERSION}" in
421
release)
5-
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/releases | grep -m1 swift-6.1 | cut -d- -f2)
22+
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/swiftlang/swift/releases | grep -m1 swift-6.1 | cut -d- -f2)
623
SWIFT_TAG="swift-${LATEST_TOOLCHAIN_VERSION}-RELEASE"
724
SWIFT_BRANCH="swift-$(echo $SWIFT_TAG | cut -d- -f2)-release"
825
;;
926
devel)
10-
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/tags | grep -m1 swift-6.2-DEV | cut -d- -f8-10)
27+
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/swiftlang/swift/tags | grep -m1 swift-6.2-DEV | cut -d- -f8-10)
1128
SWIFT_TAG="swift-6.2-DEVELOPMENT-SNAPSHOT-${LATEST_TOOLCHAIN_VERSION}-a"
1229
SWIFT_BRANCH="swift-$(echo $SWIFT_TAG | cut -d- -f2)-branch"
1330
;;
1431
trunk)
15-
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/tags | grep -m1 swift-DEV | cut -d- -f7-9)
32+
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/swiftlang/swift/tags | grep -m1 swift-DEV | cut -d- -f7-9)
1633
SWIFT_TAG="swift-DEVELOPMENT-SNAPSHOT-${LATEST_TOOLCHAIN_VERSION}-a"
1734
SWIFT_BRANCH="development"
1835
;;

0 commit comments

Comments
 (0)