aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java
diff options
context:
space:
mode:
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.java44
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)