-
-
Save Jxrgxn/4e15a800f16bf0298201 to your computer and use it in GitHub Desktop.
This file contains 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 | |
trap "exit;" SIGINT SIGTERM | |
ALIAS=mxcl | |
VERSION="3.0.0-${ALIAS}+$(date +%Y%m%d)" | |
SRCROOT="$HOME/src" | |
TOOLCHAIN_NAME="swift-${VERSION}.xctoolchain" | |
TOOLCHAIN_PREFIX="${SRCROOT}/build/${TOOLCHAIN_NAME}" | |
export TOOLCHAINS=default | |
# so if anything is put in the wrong place we will *see* it | |
cd "$HOME/Desktop" | |
"$SRCROOT/swift/utils/build-script" \ | |
--release \ | |
--llvm \ | |
--llbuild \ | |
--swiftpm \ | |
--build-subdir="${ALIAS}" \ | |
--assertions \ | |
--no-swift-stdlib-assertions \ | |
--install-prefix="${TOOLCHAIN_PREFIX}/usr" \ | |
-- \ | |
--reconfigure \ | |
--skip-ios \ | |
--skip-tvos \ | |
--skip-watchos \ | |
--skip-build-benchmarks \ | |
--skip-build-linux \ | |
--skip-build-freebsd \ | |
--skip-build-cygwin \ | |
--skip-build-ios \ | |
--skip-build-ios-device \ | |
--skip-build-ios-simulator \ | |
--skip-build-tvos \ | |
--skip-build-tvos-device \ | |
--skip-build-tvos-simulator \ | |
--skip-build-watchos \ | |
--skip-build-watchos-device \ | |
--skip-build-watchos-simulator \ | |
--skip-build-lldb \ | |
--skip-build-xctest \ | |
--skip-build-foundation \ | |
--skip-build-libdispatch \ | |
--skip-build-benchmarks \ | |
--skip-test-cmark \ | |
--skip-test-lldb \ | |
--skip-test-swift \ | |
--skip-test-llbuild \ | |
--skip-test-swiftpm \ | |
--skip-test-xctest \ | |
--skip-test-foundation \ | |
--skip-test-libdispatch \ | |
--skip-test-linux \ | |
--skip-test-freebsd \ | |
--skip-test-cygwin \ | |
--skip-test-osx \ | |
--skip-test-ios-simulator \ | |
--skip-test-ios-host \ | |
--skip-test-tvos-simulator \ | |
--skip-test-tvos-host \ | |
--skip-test-watchos-simulator \ | |
--skip-test-watchos-host \ | |
--skip-test-validation \ | |
--skip-test-benchmarks \ | |
--skip-test-optimized \ | |
--swift-sdks=OSX \ | |
--swift-enable-ast-verifier=0 \ | |
--build-swift-examples=0 \ | |
--build-swift-stdlib-unittest-extra=0 \ | |
--build-swift-static-stdlib=1 \ | |
--compiler-vendor=apple \ | |
--darwin-toolchain-bundle_identifier="org.swift.${VERSION}" \ | |
--darwin-toolchain-display_name="Xcode Swift (${VERSION})" \ | |
--darwin-toolchain-name="swift-${VERSION}" \ | |
--darwin-toolchain-version="${VERSION}" \ | |
--darwin-toolchain-alias="${ALIAS}" \ | |
--swift-install-components="compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service" \ | |
--llvm-install-components="libclang;libclang-headers" \ | |
--install-swift=1 \ | |
--install-llbuild=1 \ | |
--install-swiftpm=1 \ | |
--install-destdir="/" \ | |
--toolchain-prefix="${TOOLCHAIN_PREFIX}" \ | |
--installable-package="${TOOLCHAIN_PREFIX}.tar.gz" | |
DSTDIR="$HOME/Library/Developer/Toolchains" | |
rm -rf "${DSTDIR}/${TOOLCHAIN_NAME}" # only one build per day thanks | |
mv "${TOOLCHAIN_PREFIX}" "${DSTDIR}" | |
rm -f "${DSTDIR}/swift-latest.xctoolchain" | |
ln -s "${DSTDIR}/${TOOLCHAIN_NAME}" "${DSTDIR}/swift-latest.xctoolchain" | |
echo "+++ To use this toolchain from the command line:" | |
echo " export TOOLCHAINS='${ALIAS}'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment