@@ -295,7 +295,7 @@ runs:
295
295
SWIFT_SDK_TARGET="${{ inputs.installed-sdk }}"
296
296
echo "SWIFT_SDK_TARGET=${SWIFT_SDK_TARGET}" >> $GITHUB_ENV
297
297
# for the bundle, we just grab the most recently installed one
298
- SWIFT_SDK_BUNDLE =$(ls -1drt ${SWIFT_SDK_ROOT}/*.artifactbundle | tail -n 1)
298
+ SWIFT_SDK_ARTIFACTBUNDLE =$(ls -1drt ${SWIFT_SDK_ROOT}/*.artifactbundle | tail -n 1)
299
299
else
300
300
SWIFT_SDK_ANROID_API="24"
301
301
echo "SWIFT_SDK_ANROID_API=${SWIFT_SDK_ANROID_API}" >> $GITHUB_ENV
@@ -317,18 +317,24 @@ runs:
317
317
318
318
${SWIFT_INSTALLATION}/bin/swift sdk configure --show-configuration ${SWIFT_SDK_ID} ${SWIFT_SDK_TARGET}
319
319
320
- SWIFT_SDK_BUNDLE ="${SWIFT_SDK_ROOT}/${SWIFT_SDK_ID}.artifactbundle"
320
+ SWIFT_SDK_ARTIFACTBUNDLE ="${SWIFT_SDK_ROOT}/${SWIFT_SDK_ID}.artifactbundle"
321
321
fi
322
322
323
323
# extract the artifact ID from the info.plist in the SDK root
324
- SWIFT_SDK_ARTIFACT_ID=$(cat ${SWIFT_SDK_BUNDLE }/info.json | jq -r '.artifacts[] | .variants[0].path')
325
- SWIFT_SDK_BUNDLE ="${SWIFT_SDK_BUNDLE }/${SWIFT_SDK_ARTIFACT_ID}"
324
+ SWIFT_SDK_ARTIFACT_ID=$(cat ${SWIFT_SDK_ARTIFACTBUNDLE }/info.json | jq -r '.artifacts[] | .variants[0].path')
325
+ SWIFT_ARTIFACTBUNDLE_ROOT ="${SWIFT_SDK_ARTIFACTBUNDLE }/${SWIFT_SDK_ARTIFACT_ID}"
326
326
327
327
# extract the sdkRootPath from the swift-sdk.json
328
- SWIFT_SDK_ROOT_PATH=$(cat ${SWIFT_SDK_BUNDLE }/swift-sdk.json | jq -r '.targetTriples[] | .sdkRootPath' | head -n 1)
329
- SWIFT_SDK_BUNDLE ="${SWIFT_SDK_BUNDLE }/${SWIFT_SDK_ROOT_PATH}"
328
+ SWIFT_SDK_ROOT_PATH=$(cat ${SWIFT_ARTIFACTBUNDLE_ROOT }/swift-sdk.json | jq -r '.targetTriples[] | .sdkRootPath' | head -n 1)
329
+ SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH ="${SWIFT_ARTIFACTBUNDLE_ROOT }/${SWIFT_SDK_ROOT_PATH}"
330
330
331
- echo "SWIFT_SDK_BUNDLE=${SWIFT_SDK_BUNDLE}" >> $GITHUB_ENV
331
+ echo "SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH}" >> $GITHUB_ENV
332
+
333
+ # extract the swiftResourcesPath from the swift-sdk.json
334
+ SWIFT_RESOURCES_ROOT_PATH=$(cat ${SWIFT_ARTIFACTBUNDLE_ROOT}/swift-sdk.json | jq -r '.targetTriples[] | .swiftResourcesPath' | head -n 1)
335
+ SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH="${SWIFT_SDK_ROOT_PATH}/${SWIFT_RESOURCES_ROOT_PATH}"
336
+
337
+ echo "SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH=${SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH}" >> $GITHUB_ENV
332
338
333
339
# plugin-path is a workaround for https://github.com/swiftlang/swift-package-manager/issues/8362
334
340
echo "swiftcmd=TARGET_OS_ANDROID=1 SKIP_BRIDGE=1 ${SWIFT_INSTALLATION}/bin/swift build --swift-sdk ${SWIFT_SDK_TARGET} -Xswiftc -plugin-path -Xswiftc ${SWIFT_INSTALLATION}/lib/swift/host/plugins/testing -Xswiftc -DTARGET_OS_ANDROID -Xswiftc -DSKIP_BRIDGE ${{ inputs.swift-build-flags }}" >> $GITHUB_OUTPUT
@@ -378,10 +384,13 @@ runs:
378
384
# copy any optional resource bundles
379
385
cp -vaf ${BUILD_DIR}/${SWIFT_SDK_TARGET}/${{ inputs.swift-configuration }}/*.resources ${PACK_DIR} || true
380
386
# 6.0.2 keeps libraries in per-API folders
381
- cp -vaf ${SWIFT_SDK_BUNDLE }/usr/lib/${{ steps.setup.outputs.android-sdk-arch }}-linux-android/${SWIFT_SDK_ANROID_API}/lib*.so ${PACK_DIR} || true
387
+ cp -vaf ${SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH }/usr/lib/${{ steps.setup.outputs.android-sdk-arch }}-linux-android/${SWIFT_SDK_ANROID_API}/lib*.so ${PACK_DIR} || true
382
388
383
389
# 6.0.3 keeps libraries in the parent folder
384
- cp -vaf ${SWIFT_SDK_BUNDLE}/usr/lib/${{ steps.setup.outputs.android-sdk-arch }}-linux-android/lib*.so ${PACK_DIR} || true
390
+ cp -vaf ${SWIFT_ARTIFACTBUNDLE_SDK_ROOT_PATH}/usr/lib/${{ steps.setup.outputs.android-sdk-arch }}-linux-android/lib*.so ${PACK_DIR} || true
391
+
392
+ # 6.2 keeps libraries in the resources root folder
393
+ cp -vaf ${SWIFT_ARTIFACTBUNDLE_RESOURCES_ROOT_PATH}/usr/lib/swift-${{ steps.setup.outputs.android-sdk-arch }}/android/lib*.so ${PACK_DIR} || true
385
394
386
395
# clear out libraries that are already provided by Android
387
396
rm -v ${PACK_DIR}/lib{c,dl,log,m,z}.so || true
0 commit comments