Skip to content

Instantly share code, notes, and snippets.

@JaviSoto
Forked from mxcl/swift-self-build
Created March 22, 2016 21:26
Show Gist options
  • Save JaviSoto/e9e9eecc236a84787def to your computer and use it in GitHub Desktop.
Save JaviSoto/e9e9eecc236a84787def to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
trap "exit;" SIGINT SIGTERM
unset TOOLCHAINS
ALIAS=mxcl
VERSION="3.0.0-${ALIAS}+$(date +%Y%m%d)"
PREFIX="$HOME/Library/Developer/Toolchains"
# so if anything is put in the wrong place we will *see* it
cd "$HOME/Desktop"
# only one build per day thanks
rm -fr "${PREFIX}/swift-${VERSION}.xctoolchain"
rm -f "${PREFIX}/swift-latest.xctoolchain"
~/src/swift/utils/build-script \
--release \
--llvm \
--lldb \
--llbuild \
--swiftpm \
--build-subdir="${ALIAS}" \
--assertions \
--no-swift-stdlib-assertions \
-- \
--skip-ios=1 \
--skip-tvos=1 \
--skip-watchos=1 \
--skip-build-benchmarks=1 \
--swift-sdks=OSX \
--swift-enable-ast-verifier=0 \
--build-swift-examples=0 \
--build-swift-stdlib-unittest-extra=0 \
--lldb-no-debugserver=1 \
--lldb-build-type=Release \
--skip-test-swift=1 \
--skip-test-swiftpm=1 \
--skip-test-llbuild=1 \
--skip-test-lldb=1 \
--skip-build-lldb=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" \
--installable-package="${HOME}/Desktop/swift-${VERSION}.tar.gz" \
--install-swift=1 \
--install-lldb=1 \
--install-llbuild=1 \
--install-swiftpm=1 \
--install-destdir="/" \
--install-prefix="${PREFIX}/swift-${VERSION}.xctoolchain/usr" \
--reconfigure
ln -s "${PREFIX}/swift-${VERSION}.xctoolchain" "${PREFIX}/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