diff options
author | Dmitry Shevchenko <dmishe@google.com> | 2016-10-04 01:16:16 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-10-04 08:56:38 +0000 |
commit | 25b952b8fec4a3e514b4f91fbbd5e5133fcab4b7 (patch) | |
tree | a77991ffd27f0283edecc9307ff8e51536a1fd6a /src/tools/xcode | |
parent | deeeb31f8ba0f196fbc9ca2a177d59d57ea50b32 (diff) |
Rollback of commit deeeb31f8ba0f196fbc9ca2a177d59d57ea50b32.
*** Reason for rollback ***
Breaks builds with current blaze
*** Original change description ***
Add a way to select non-default Xcode toolchain
* Adds a flag --xcode_toolchain which sets TOOLCHAINS env variable for xcrun.
* Updates swift_library to work with this flag when selecting Swift runtime location.
* By default the flag has a null value and is not set in env.
--
MOS_MIGRATED_REVID=135053864
Diffstat (limited to 'src/tools/xcode')
-rwxr-xr-x | src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh | 47 |
1 files changed, 5 insertions, 42 deletions
diff --git a/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh b/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh index d4f2f4fc60..7197cdc32e 100755 --- a/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh +++ b/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh @@ -17,9 +17,7 @@ # swiftstdlibtoolwrapper runs swift-stdlib-tool and zips up the output. # This script only runs on darwin and you must have Xcode installed. # -# --output_zip_path - the path to place the output zip file. -# --bundle_path - the path inside of the archive to where libs will be copied. -# --toolchain - toolchain identifier to use with xcrun. +# $1 OUTZIP - the path to place the output zip file. set -eu @@ -27,50 +25,15 @@ MY_LOCATION=${MY_LOCATION:-"$0.runfiles/bazel_tools/tools/objc"} REALPATH="${MY_LOCATION}/realpath" WRAPPER="${MY_LOCATION}/xcrunwrapper.sh" -TOOL_ARGS=() -while [[ $# -gt 0 ]]; do - ARG="$1" - shift - case "${ARG}" in - --output_zip_path) - ARG="$1" - shift - OUTZIP=$("${REALPATH}" "${ARG}") - ;; - --bundle_path) - ARG="$1" - shift - PATH_INSIDE_ZIP="$ARG" - ;; - --toolchain) - ARG="$1" - shift - TOOLCHAIN=${ARG} - ;; - # Remaining args are swift-stdlib-tool args - *) - TOOL_ARGS+=("$ARG") - ;; - esac -done - - +OUTZIP=$("${REALPATH}" "$1") +PATH_INSIDE_ZIP="$2" +shift 2 TEMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/swiftstdlibtoolZippingOutput.XXXXXX") trap "rm -rf \"$TEMPDIR\"" EXIT FULLPATH="$TEMPDIR/$PATH_INSIDE_ZIP" -XCRUN_ARGS=() - -if [ -n "${TOOLCHAIN:-}" ]; then - XCRUN_ARGS+=(--toolchain "$TOOLCHAIN") -fi - -XCRUN_ARGS+=(swift-stdlib-tool --copy --verbose ) -XCRUN_ARGS+=(--destination "$FULLPATH") -XCRUN_ARGS+=( "${TOOL_ARGS[@]}" ) - -$WRAPPER "${XCRUN_ARGS[@]}" +$WRAPPER swift-stdlib-tool --copy --verbose --destination "$FULLPATH" "$@" # Need to push/pop tempdir so it isn't the current working directory # when we remove it via the EXIT trap. |