Skip to content

Commit 836d862

Browse files
committed
Android SDK build
1 parent 2a9eaf7 commit 836d862

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,20 @@ jobs:
8787
echo 'import Concurrency' >> Sources/DemoProject/DemoProject.swift
8888
echo 'import Dispatch' >> Sources/DemoProject/DemoProject.swift
8989
echo 'import Android' >> Sources/DemoProject/DemoProject.swift
90-
#${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android
91-
${{ steps.paths.outputs.swift-path }} build --swift-sdk x86_64-unknown-linux-android
90+
#${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-linux-android28
91+
${{ steps.paths.outputs.swift-path }} build --swift-sdk x86_64-linux-android28
9292
- name: Build swift-algorithms
9393
run: |
9494
cd ${{ runner.temp }}
9595
git clone https://github.com/apple/swift-algorithms.git
9696
cd swift-algorithms
97-
${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android
97+
${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-linux-android28
9898
- name: Test Swift Package on Android
9999
# TODO: need to implement installed-sdk option in swift-android-action
100100
if: false
101101
uses: skiptools/swift-android-action@main
102102
with:
103103
package-path: ${{ runner.temp }}/DemoProject
104-
installed-sdk: x86_64-unknown-linux-android
104+
installed-sdk: x86_64-linux-android28
105105
installed-swift: ${{ steps.paths.outputs.swift-path }}
106106

swift-ci/sdks/android/scripts/build.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ groupstart "Bundling SDK"
402402
sdk_name=swift-${swift_version}-android-${android_api}-${android_sdk_version}
403403
#sdk_base=android-27c-sysroot
404404
#sdk_base=swift-unknown-android
405-
sdk_base=unknown-linux-android
405+
sdk_base=linux-android
406406
#sdk_root="${sdk_base}-${android_sdk_version}.sdk"
407407
sdk_root="${sdk_base}.sdk"
408408

@@ -434,7 +434,7 @@ EOF
434434

435435
cd "$sdk_name/$sdk_base"
436436

437-
cp -a ${ndk_toolchain}/sysroot sysroot
437+
cp -a ${ndk_toolchain}/sysroot ndk-sysroot
438438

439439
cat > swift-sdk.json <<EOF
440440
{
@@ -443,22 +443,23 @@ cat > swift-sdk.json <<EOF
443443
EOF
444444

445445
first=true
446-
for arch in $archs; do
447-
if [[ "$first" == "true" ]]; then
448-
first=false
449-
else
450-
cat >> swift-sdk.json <<EOF
446+
for api in $(eval echo "{$android_api..35}"); do
447+
for arch in $archs; do
448+
if [[ "$first" == "true" ]]; then
449+
first=false
450+
else
451+
cat >> swift-sdk.json <<EOF
451452
},
452453
EOF
453-
fi
454-
cat >> swift-sdk.json <<EOF
455-
"${arch}-${sdk_base}": {
456-
"sdkRootPath": "sysroot",
457-
"sdkRootPathXXX": "${sdk_root}/${arch}",
454+
fi
455+
cat >> swift-sdk.json <<EOF
456+
"${arch}-${sdk_base}${api}": {
457+
"sdkRootPath": "ndk-sysroot",
458458
"swiftResourcesPath": "${sdk_root}/${arch}/usr/lib/swift",
459459
"swiftStaticResourcesPath": "${sdk_root}/${arch}/usr/lib/swift_static",
460460
"toolsetPaths": [ "swift-toolset.json" ]
461461
EOF
462+
done
462463
done
463464

464465
cat >> swift-sdk.json <<EOF

0 commit comments

Comments
 (0)