87
87
uses : actions/cache@v2
88
88
with :
89
89
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
91
91
- name : Clone
92
92
uses : actions/checkout@v2
93
93
with :
@@ -112,6 +112,15 @@ jobs:
112
112
113
113
if [ ${{ matrix.version }} = 'trunk' ]; then
114
114
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 ..
115
124
fi
116
125
117
126
./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:
121
130
122
131
tar cJf ~/$SDK_NAME.tar.xz $SDK_NAME
123
132
rm -rf $SDK_NAME
124
- - name : Patch SPM ${{ matrix.version }} config
133
+ - name : Unpack ${{ matrix.version }} toolchain and SDK
134
+ id : sdk-unpack
125
135
run : |
126
136
cd sdk-config
127
137
128
138
if [ ! -d ${{ steps.version.outputs.tag }}-ubuntu20.04 ]; then
129
139
tar xf ~/${{ steps.version.outputs.tag }}-ubuntu20.04.tar.gz
130
140
fi
131
- sed -i "s%/home/butta/swift-5.5.1-RELEASE%`pwd`/${{ steps.version.outputs.tag }}%" android-${{ matrix.arch }}.json
132
141
133
142
tar xf ~/swift-${{ matrix.version }}-android-${{ matrix.arch }}*-${ANDROID_API_LEVEL}-sdk.tar.xz
134
143
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
138
152
- name : Get Swift Argument Parser package
139
153
uses : actions/checkout@v2
140
154
with :
@@ -143,7 +157,7 @@ jobs:
143
157
- name : Build Swift Argument Parser package
144
158
run : |
145
159
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
147
161
- name : Get Swift crypto package
148
162
uses : actions/checkout@v2
149
163
with :
@@ -153,7 +167,7 @@ jobs:
153
167
run : |
154
168
cd swift-crypto
155
169
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
157
171
- name : Get Swift NIO package
158
172
uses : actions/checkout@v2
159
173
with :
@@ -163,7 +177,10 @@ jobs:
163
177
run : |
164
178
cd swift-nio
165
179
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
167
184
- name : Get Swift Numerics package
168
185
uses : actions/checkout@v2
169
186
with :
@@ -172,7 +189,7 @@ jobs:
172
189
- name : Build Swift Numerics package
173
190
run : |
174
191
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
176
193
- name : Get Swift System package
177
194
uses : actions/checkout@v2
178
195
with :
@@ -182,7 +199,7 @@ jobs:
182
199
run : |
183
200
cd ss
184
201
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
186
203
- name : Get Swift Collections package
187
204
uses : actions/checkout@v2
188
205
with :
@@ -191,7 +208,7 @@ jobs:
191
208
- name : Build Swift Collections package
192
209
run : |
193
210
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
195
212
- name : Get Swift NIO SSH package
196
213
uses : actions/checkout@v2
197
214
with :
@@ -202,7 +219,7 @@ jobs:
202
219
cd sns
203
220
sed -i "s%url: .*swift-\(\w\+\)\.git.*$%path: \"../swift-\1\"),%g" Package.swift
204
221
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
206
223
- name : Get Swift NIO SSL package
207
224
uses : actions/checkout@v2
208
225
with :
@@ -212,7 +229,7 @@ jobs:
212
229
run : |
213
230
cd snl
214
231
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
216
233
- name : Get Yams package
217
234
uses : actions/checkout@v2
218
235
with :
@@ -222,7 +239,7 @@ jobs:
222
239
run : |
223
240
cd yams
224
241
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
226
243
- name : Get Swift NIO HTTP/2 package
227
244
uses : actions/checkout@v2
228
245
with :
@@ -233,7 +250,7 @@ jobs:
233
250
run : |
234
251
cd snh
235
252
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
237
254
- name : Get Swift Algorithms package
238
255
uses : actions/checkout@v2
239
256
with :
@@ -243,7 +260,7 @@ jobs:
243
260
run : |
244
261
cd sa
245
262
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
247
264
- name : Get cached Termux debug app for NIO tests
248
265
if : ${{ matrix.arch == 'x86_64' }}
249
266
id : cache-termux
@@ -255,24 +272,28 @@ jobs:
255
272
if : ${{ matrix.arch == 'x86_64' }}
256
273
run : |
257
274
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
259
280
260
281
wget -q https://raw.githubusercontent.com/termux/termux-elf-cleaner/master/termux-elf-cleaner.cpp
261
282
wget -q https://raw.githubusercontent.com/termux/termux-elf-cleaner/master/elf.h
262
283
clang -D__ANDROID_API__=$ANDROID_API_LEVEL -o termux-elf-cleaner termux-elf-cleaner.cpp
263
284
264
285
./termux-elf-cleaner pack/{math,repeat,roll} || true
265
286
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
276
297
277
298
mkdir pack/crypto-vectors
278
299
cp swift-crypto/Tests/Test\ Vectors/* swift-crypto/Tests/_CryptoExtrasVectors/* pack/crypto-vectors
0 commit comments