8787 uses : actions/cache@v2
8888 with :
8989 path : ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}-*-sdk.tar.xz
90- key : ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-latest- sdk
90+ key : ${{ matrix.version }}-${{ steps.version.outputs.latest }}-${{ matrix.arch }}-sdk
9191 - name : Clone
9292 uses : actions/checkout@v2
9393 with :
@@ -112,6 +112,15 @@ jobs:
112112
113113 if [ ${{ matrix.version }} = 'trunk' ]; then
114114 EXTRA_FLAGS="-b -p --install-llbuild --skip-early-swift-driver"
115+ if [ ${{ matrix.arch }} != 'armv7' ]; then
116+ EXTRA_FLAGS+=" --sourcekit-lsp"
117+ fi
118+ wget -q https://patch-diff.githubusercontent.com/raw/apple/swift/pull/35707.diff
119+ wget -q https://patch-diff.githubusercontent.com/raw/apple/swift/pull/36917.diff
120+ cd swift
121+ patch -p1 < ../35707.diff
122+ patch -p1 < ../36917.diff
123+ cd ..
115124 fi
116125
117126 ./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK_LATEST_HOME --android-arch ${{ matrix.arch }} --android-api-level $ANDROID_API_LEVEL --android-icu-uc $SDK/usr/lib/libicuuc.so --android-icu-uc-include $SDK/usr/include --android-icu-i18n $SDK/usr/lib/libicui18n.so --android-icu-i18n-include $SDK/usr/include --android-icu-data $SDK/usr/lib/libicudata.so --build-swift-tools=0 --native-swift-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --native-clang-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --cross-compile-hosts=android-${{ matrix.arch }} --cross-compile-deps-path=$SDK --skip-local-build --xctest --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='clang-resource-dir-symlink;license;stdlib;sdk-overlay' $EXTRA_FLAGS
@@ -121,20 +130,25 @@ jobs:
121130
122131 tar cJf ~/$SDK_NAME.tar.xz $SDK_NAME
123132 rm -rf $SDK_NAME
124- - name : Patch SPM ${{ matrix.version }} config
133+ - name : Unpack ${{ matrix.version }} toolchain and SDK
134+ id : sdk-unpack
125135 run : |
126136 cd sdk-config
127137
128138 if [ ! -d ${{ steps.version.outputs.tag }}-ubuntu20.04 ]; then
129139 tar xf ~/${{ steps.version.outputs.tag }}-ubuntu20.04.tar.gz
130140 fi
131- sed -i "s%/home/butta/swift-5.5.1-RELEASE%`pwd`/${{ steps.version.outputs.tag }}%" android-${{ matrix.arch }}.json
132141
133142 tar xf ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}*-${ANDROID_API_LEVEL}-sdk.tar.xz
134143 SDK_NAME=$(ls | grep swift-${{ matrix.version }}.*-sdk)
135- sed -i "s%/home/butta/swift-5.5-android-${{ matrix.arch }}-${ANDROID_API_LEVEL}-sdk%`pwd`/${SDK_NAME}%" android-${{ matrix.arch }}.json
136-
137- sed -i "s%/home/butta/android-ndk-r23b%${ANDROID_NDK_LATEST_HOME}%" android-${{ matrix.arch }}.json
144+ if [ ${{ matrix.version }} = 'trunk' ]; then
145+ echo "::set-output name=sdk-name::$SDK_NAME/usr/swiftpm-android"
146+ else
147+ sed -i "s%/home/butta/swift-5.5.1-RELEASE%`pwd`/${{ steps.version.outputs.tag }}%" android-${{ matrix.arch }}.json
148+ sed -i "s%/home/butta/swift-5.5-android-${{ matrix.arch }}-${ANDROID_API_LEVEL}-sdk%`pwd`/${SDK_NAME}%" android-${{ matrix.arch }}.json
149+ sed -i "s%/home/butta/android-ndk-r23b%${ANDROID_NDK_LATEST_HOME}%" android-${{ matrix.arch }}.json
150+ echo "::set-output name=sdk-name::android"
151+ fi
138152 - name : Get Swift Argument Parser package
139153 uses : actions/checkout@v2
140154 with :
@@ -143,7 +157,7 @@ jobs:
143157 - name : Build Swift Argument Parser package
144158 run : |
145159 cd swift-argument-parser
146- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
160+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
147161 - name : Get Swift crypto package
148162 uses : actions/checkout@v2
149163 with :
@@ -153,7 +167,7 @@ jobs:
153167 run : |
154168 cd swift-crypto
155169 sed -i "s%\\\\(testsDirectory)/.*Vectors%/data/local/tmp/pack/crypto-vectors%" Tests/CryptoTests/Utils/RFCVector.swift Tests/CryptoTests/Utils/Wycheproof.swift Tests/_CryptoExtrasTests/Utils/Wycheproof.swift
156- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
170+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
157171 - name : Get Swift NIO package
158172 uses : actions/checkout@v2
159173 with :
@@ -163,7 +177,10 @@ jobs:
163177 run : |
164178 cd swift-nio
165179 git apply ../sdk-config/package-patches/swift-nio-change-tmp-and-disable-tests.patch
166- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/android-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
180+ if [ ${{ matrix.version }} = 'trunk' ]; then
181+ git apply ../sdk-config/package-patches/swift-nio-trunk.patch
182+ fi
183+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }}-${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
167184 - name : Get Swift Numerics package
168185 uses : actions/checkout@v2
169186 with :
@@ -172,7 +189,7 @@ jobs:
172189 - name : Build Swift Numerics package
173190 run : |
174191 cd sn
175- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/android- ${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android -Xlinker -lm
192+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }}- ${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
176193 - name : Get Swift System package
177194 uses : actions/checkout@v2
178195 with :
@@ -182,7 +199,7 @@ jobs:
182199 run : |
183200 cd ss
184201 sed -i "s%/tmp%/data/local/tmp%" Tests/SystemTests/FileOperationsTest.swift
185- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
202+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
186203 - name : Get Swift Collections package
187204 uses : actions/checkout@v2
188205 with :
@@ -191,7 +208,7 @@ jobs:
191208 - name : Build Swift Collections package
192209 run : |
193210 cd sco
194- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build -j 1 --build-tests --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
211+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build -j 1 --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
195212 - name : Get Swift NIO SSH package
196213 uses : actions/checkout@v2
197214 with :
@@ -202,7 +219,7 @@ jobs:
202219 cd sns
203220 sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
204221 git apply ../sdk-config/package-patches/swift-nio-ssh-package-deps.patch
205- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
222+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
206223 - name : Get Swift NIO SSL package
207224 uses : actions/checkout@v2
208225 with :
@@ -212,7 +229,7 @@ jobs:
212229 run : |
213230 cd snl
214231 sed -i "s%url: .*$%path: \"../swift-nio\"),%" Package.swift
215- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
232+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
216233 - name : Get Yams package
217234 uses : actions/checkout@v2
218235 with :
@@ -222,7 +239,7 @@ jobs:
222239 run : |
223240 cd yams
224241 sed -i "s% fixturesDirectory + \"/SourceKitten#289% \"/data/local/tmp/pack%" Tests/YamsTests/PerformanceTests.swift
225- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
242+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
226243 - name : Get Swift NIO HTTP/2 package
227244 uses : actions/checkout@v2
228245 with :
@@ -233,7 +250,7 @@ jobs:
233250 run : |
234251 cd snh
235252 sed -i "s%url: .*$%path: \"../swift-nio\")%" Package.swift
236- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
253+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
237254 - name : Get Swift Algorithms package
238255 uses : actions/checkout@v2
239256 with :
@@ -243,7 +260,7 @@ jobs:
243260 run : |
244261 cd sa
245262 sed -i "s%url: .*$%path: \"../sn\"),%" Package.swift
246- ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/android -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
263+ ../sdk-config/${{ steps.version.outputs.tag }}-ubuntu20.04/usr/bin/swift build --build-tests --enable-test-discovery --destination ../sdk-config/${{ steps.sdk-unpack.outputs.sdk-name }} -${{ matrix.arch }}.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android
247264 - name : Get cached Termux debug app for NIO tests
248265 if : ${{ matrix.arch == 'x86_64' }}
249266 id : cache-termux
@@ -255,24 +272,28 @@ jobs:
255272 if : ${{ matrix.arch == 'x86_64' }}
256273 run : |
257274 mkdir -p pack/lib/swift/android
258- cp swift-argument-parser/.build/x86_64-unknown-linux-android/debug/{math,repeat,roll,swift-argument-parserPackageTests.xctest} pack
275+ TARGET="x86_64-unknown-linux-android"
276+ if [ ${{ matrix.version }} = 'trunk' ]; then
277+ TARGET+="$ANDROID_API_LEVEL"
278+ fi
279+ cp swift-argument-parser/.build/$TARGET/debug/{math,repeat,roll,swift-argument-parserPackageTests.xctest} pack
259280
260281 wget -q https://raw.githubusercontent.com/termux/termux-elf-cleaner/master/termux-elf-cleaner.cpp
261282 wget -q https://raw.githubusercontent.com/termux/termux-elf-cleaner/master/elf.h
262283 clang -D__ANDROID_API__=$ANDROID_API_LEVEL -o termux-elf-cleaner termux-elf-cleaner.cpp
263284
264285 ./termux-elf-cleaner pack/{math,repeat,roll} || true
265286
266- cp swift-crypto/.build/x86_64-unknown-linux-android /debug/swift-cryptoPackageTests.xctest pack
267- cp swift-nio/.build/x86_64-unknown-linux-android /debug/swift-nioPackageTests.xctest pack
268- cp sn/.build/x86_64-unknown-linux-android /debug/swift-numericsPackageTests.xctest pack
269- cp ss/.build/x86_64-unknown-linux-android /debug/swift-systemPackageTests.xctest pack
270- cp sco/.build/x86_64-unknown-linux-android /debug/swift-collectionsPackageTests.xctest pack
271- cp sns/.build/x86_64-unknown-linux-android /debug/swift-nio-sshPackageTests.xctest pack
272- cp snl/.build/x86_64-unknown-linux-android /debug/swift-nio-sslPackageTests.xctest pack
273- cp yams/.build/x86_64-unknown-linux-android /debug/YamsPackageTests.xctest pack
274- cp snh/.build/x86_64-unknown-linux-android /debug/swift-nio-http2PackageTests.xctest pack
275- cp sa/.build/x86_64-unknown-linux-android /debug/swift-algorithmsPackageTests.xctest pack
287+ cp swift-crypto/.build/$TARGET /debug/swift-cryptoPackageTests.xctest pack
288+ cp swift-nio/.build/$TARGET /debug/swift-nioPackageTests.xctest pack
289+ cp sn/.build/$TARGET /debug/swift-numericsPackageTests.xctest pack
290+ cp ss/.build/$TARGET /debug/swift-systemPackageTests.xctest pack
291+ cp sco/.build/$TARGET /debug/swift-collectionsPackageTests.xctest pack
292+ cp sns/.build/$TARGET /debug/swift-nio-sshPackageTests.xctest pack
293+ cp snl/.build/$TARGET /debug/swift-nio-sslPackageTests.xctest pack
294+ cp yams/.build/$TARGET /debug/YamsPackageTests.xctest pack
295+ cp snh/.build/$TARGET /debug/swift-nio-http2PackageTests.xctest pack
296+ cp sa/.build/$TARGET /debug/swift-algorithmsPackageTests.xctest pack
276297
277298 mkdir pack/crypto-vectors
278299 cp swift-crypto/Tests/Test\ Vectors/* swift-crypto/Tests/_CryptoExtrasVectors/* pack/crypto-vectors
0 commit comments