Last active
October 23, 2021 07:53
-
-
Save dlevi309/2cdc3a957a7af4306c7286f217647f89 to your computer and use it in GitHub Desktop.
Drop this script into the head directory of swift package with a CLI tool to build as an iOS target. Set NAME=ProductName
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| NAME=sURL | |
| function build() { | |
| START=$(date +%s) | |
| swift build --product $NAME \ | |
| -c release \ | |
| -Xswiftc "-sdk" \ | |
| -Xswiftc "$(xcrun --sdk iphoneos --show-sdk-path)" \ | |
| -Xswiftc "-target" \ | |
| -Xswiftc "arm64-apple-ios11.0" \ | |
| -Xcc "-arch" \ | |
| -Xcc "arm64" \ | |
| -Xcc "--target=arm64-apple-ios11.0" \ | |
| -Xcc "-isysroot" \ | |
| -Xcc "$(xcrun --sdk iphoneos --show-sdk-path)" \ | |
| -Xcc "-mios-version-min=10.0" \ | |
| -Xcc "-miphoneos-version-min=11.0" | |
| mkdir built | |
| cp .build/release/$NAME built/$NAME | |
| END=$(date +%s) | |
| TIME=$(($END - $START)) | |
| echo "build in $TIME seconds" | |
| } | |
| function main() { | |
| build | |
| } | |
| main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment