diff options
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 | 29 |
1 files changed, 17 insertions, 12 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 2d3bda4b2a..dc0fa8eca7 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 @@ -676,9 +676,7 @@ public final class ReleaseBundlingSupport { .build(ruleContext)); } - /** - * Registers an action to copy Swift standard library dylibs into app bundle. - */ + /** Registers an action to copy Swift standard library dylibs into app bundle. */ private void registerSwiftStdlibActionsIfNecessary() { if (!objcProvider.is(USES_SWIFT)) { return; @@ -688,17 +686,19 @@ public final class ReleaseBundlingSupport { CustomCommandLine.Builder commandLine = CustomCommandLine.builder() .addPath(intermediateArtifacts.swiftFrameworksFileZip().getExecPath()) - .add("Frameworks") - .addPath(ObjcRuleClasses.SWIFT_STDLIB_TOOL) .add("--platform").add(IosSdkCommands.swiftPlatform(objcConfiguration)) .addExecPath("--scan-executable", intermediateArtifacts.strippedSingleArchitectureBinary()); ruleContext.registerAction( - ObjcRuleClasses.spawnJavaOnDarwinActionBuilder(attributes.swiftStdlibToolDeployJar()) + ObjcRuleClasses.spawnOnDarwinActionBuilder() .setMnemonic("SwiftStdlibCopy") + .setExecutable(attributes.swiftStdlibToolWrapper()) .setCommandLine(commandLine.build()) .addOutput(intermediateArtifacts.swiftFrameworksFileZip()) .addInput(intermediateArtifacts.strippedSingleArchitectureBinary()) + // TODO(dmaclach): Adding realpath here should not be required once + // https://github.com/google/bazel/issues/285 is fixed. + .addInput(attributes.realpath()) .build(ruleContext)); } @@ -790,11 +790,18 @@ public final class ReleaseBundlingSupport { ruleContext.getPrerequisiteArtifact("$runner_script_template", Mode.HOST)); } + /** Returns the location of the swiftstdlibtoolwrapper. */ + FilesToRunProvider swiftStdlibToolWrapper() { + return ruleContext.getExecutablePrerequisite("$swiftstdlibtoolwrapper", Mode.HOST); + } + /** - * Returns the location of the swiftstdlibtoolzip deploy jar. + * Returns the location of the realpath tool. + * TODO(dmaclach): Should not be required once https://github.com/google/bazel/issues/285 + * is fixed. */ - Artifact swiftStdlibToolDeployJar() { - return ruleContext.getPrerequisiteArtifact("$swiftstdlibtoolzip_deploy", Mode.HOST); + Artifact realpath() { + return ruleContext.getPrerequisiteArtifact("$realpath", Mode.HOST); } String bundleId() { @@ -889,9 +896,7 @@ public final class ReleaseBundlingSupport { return true; } - /** - * Returns the configuration distinguisher for this transition instance. - */ + /** Returns the configuration distinguisher for this transition instance. */ protected ConfigurationDistinguisher getConfigurationDistinguisher() { return ConfigurationDistinguisher.APPLICATION; } |