diff options
author | 2016-10-05 16:07:22 +0000 | |
---|---|---|
committer | 2016-10-05 19:41:34 +0000 | |
commit | 39bb51a47e97f8d3771a282d5a9384fe041a506b (patch) | |
tree | 371e62d85737f2e58ddf45fa8c7326aef65b87e6 /src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java | |
parent | 83e7c710153036c4cbf1c6201947aa7911f93cf4 (diff) |
Roll forward of commit deeeb31f8ba0f196fbc9ca2a177d59d57ea50b32.
* Fixed breakage in shell tools with an old bazel binary.
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=135238820
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java index 009b3fddfe..4cf8e6264f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java @@ -1058,13 +1058,21 @@ public final class ReleaseBundlingSupport { return; } - CustomCommandLine.Builder commandLine = - CustomCommandLine.builder() - .addPath(intermediateArtifacts.swiftFrameworksFileZip().getExecPath()) - .add("Frameworks") - .add("--platform") - .add(platform.getLowerCaseNameInPlist()) - .addExecPath("--scan-executable", combinedArchBinary); + AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class); + + CustomCommandLine.Builder commandLine = CustomCommandLine.builder(); + if (appleConfiguration.getXcodeToolchain() != null) { + commandLine.add("--toolchain").add(appleConfiguration.getXcodeToolchain()); + } + + commandLine + .add("--output_zip_path") + .addPath(intermediateArtifacts.swiftFrameworksFileZip().getExecPath()) + .add("--bundle_path") + .add("Frameworks") + .add("--platform") + .add(platform.getLowerCaseNameInPlist()) + .addExecPath("--scan-executable", combinedArchBinary); ruleContext.registerAction( ObjcRuleClasses.spawnAppleEnvActionBuilder(ruleContext, platform) @@ -1082,13 +1090,21 @@ public final class ReleaseBundlingSupport { return; } - CustomCommandLine.Builder commandLine = - CustomCommandLine.builder() - .addPath(intermediateArtifacts.swiftSupportZip().getExecPath()) - .add("SwiftSupport/" + platform.getLowerCaseNameInPlist()) - .add("--platform") - .add(platform.getLowerCaseNameInPlist()) - .addExecPath("--scan-executable", combinedArchBinary); + AppleConfiguration configuration = ruleContext.getFragment(AppleConfiguration.class); + + CustomCommandLine.Builder commandLine = CustomCommandLine.builder(); + if (configuration.getXcodeToolchain() != null) { + commandLine.add("--toolchain").add(configuration.getXcodeToolchain()); + } + + commandLine + .add("--output_zip_path") + .addPath(intermediateArtifacts.swiftSupportZip().getExecPath()) + .add("--bundle_path") + .add("SwiftSupport/" + platform.getLowerCaseNameInPlist()) + .add("--platform") + .add(platform.getLowerCaseNameInPlist()) + .addExecPath("--scan-executable", combinedArchBinary); ruleContext.registerAction( ObjcRuleClasses.spawnAppleEnvActionBuilder(ruleContext, platform) |