aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-07-15 22:01:18 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-07-16 08:15:20 +0000
commitb8d1e700841d8aa7186ccbdfb0eba53e12a672d0 (patch)
tree75df4237ea8401e76e88c1d0d7522cee327815ae /src/main/java/com/google
parentb9d84134dc95795fea6ce8477d5030bd8adf726e (diff)
Description redacted.
-- MOS_MIGRATED_REVID=98347349
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java35
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/IosSdkCommands.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java13
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java29
4 files changed, 42 insertions, 37 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
index 9ace1d304e..8382ac8007 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
@@ -200,7 +200,7 @@ final class BundleSupport {
ruleContext.registerAction(
ObjcRuleClasses.spawnOnDarwinActionBuilder()
.setMnemonic("StoryboardCompile")
- .setExecutable(attributes.ibtoolwrapper())
+ .setExecutable(attributes.ibtoolWrapper())
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, storyboardInput))
.addOutput(zipOutput)
.addInput(storyboardInput)
@@ -238,15 +238,17 @@ final class BundleSupport {
for (Xcdatamodel datamodel : xcdatamodels) {
Artifact outputZip = datamodel.getOutputZip();
ruleContext.registerAction(
- ObjcRuleClasses.spawnJavaOnDarwinActionBuilder(attributes.momczipDeployJar())
+ ObjcRuleClasses.spawnOnDarwinActionBuilder()
.setMnemonic("MomCompile")
+ .setExecutable(attributes.momcWrapper())
.addOutput(outputZip)
.addInputs(datamodel.getInputs())
+ // TODO(dmaclach): Adding realpath here should not be required once
+ // https://github.com/google/bazel/issues/285 is fixed.
+ .addInput(attributes.realpath())
.setCommandLine(CustomCommandLine.builder()
.addPath(outputZip.getExecPath())
.add(datamodel.archiveRootForMomczip())
- .add(IosSdkCommands.MOMC_PATH)
-
.add("-XD_MOMC_SDKROOT=" + IosSdkCommands.sdkDir(objcConfiguration))
.add("-XD_MOMC_IOS_TARGET_VERSION=" + bundling.getMinimumOsVersion())
.add("-MOMC_PLATFORMS")
@@ -269,7 +271,7 @@ final class BundleSupport {
ruleContext.registerAction(
ObjcRuleClasses.spawnOnDarwinActionBuilder()
.setMnemonic("XibCompile")
- .setExecutable(attributes.ibtoolwrapper())
+ .setExecutable(attributes.ibtoolWrapper())
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, original))
.addOutput(zipOutput)
.addInput(original)
@@ -348,11 +350,15 @@ final class BundleSupport {
// zip file will be rooted at the bundle root, and we have to prepend the bundle root to each
// entry when merging it with the final .ipa file.
ruleContext.registerAction(
- ObjcRuleClasses.spawnJavaOnDarwinActionBuilder(attributes.actoolzipDeployJar())
+ ObjcRuleClasses.spawnOnDarwinActionBuilder()
.setMnemonic("AssetCatalogCompile")
+ .setExecutable(attributes.actoolWrapper())
.addTransitiveInputs(objcProvider.get(ASSET_CATALOG))
.addOutput(zipOutput)
.addOutput(actoolPartialInfoplist)
+ // TODO(dmaclach): Adding realpath here should not be required once
+ // https://github.com/google/bazel/issues/285 is fixed.
+ .addInput(attributes.realpath())
.setCommandLine(actoolzipCommandLine(
objcProvider,
zipOutput,
@@ -366,9 +372,6 @@ final class BundleSupport {
CustomCommandLine.Builder commandLine = CustomCommandLine.builder()
// The next three arguments are positional, i.e. they don't have flags before them.
.addPath(zipOutput.getExecPath())
- .add("") // archive root
- .add(IosSdkCommands.ACTOOL_PATH)
-
.add("--platform").add(objcConfiguration.getBundlingPlatform().getLowerCaseNameInPlist())
.addExecPath("--output-partial-info-plist", partialInfoPlist)
.add("--minimum-deployment-target").add(bundling.getMinimumOsVersion());
@@ -439,7 +442,7 @@ final class BundleSupport {
/**
* Returns the location of the ibtoolwrapper tool.
*/
- FilesToRunProvider ibtoolwrapper() {
+ FilesToRunProvider ibtoolWrapper() {
return ruleContext.getExecutablePrerequisite("$ibtoolwrapper", Mode.HOST);
}
@@ -453,17 +456,17 @@ final class BundleSupport {
}
/**
- * Returns the location of the momczip deploy jar.
+ * Returns the location of the momcwrapper.
*/
- Artifact momczipDeployJar() {
- return ruleContext.getPrerequisiteArtifact("$momczip_deploy", Mode.HOST);
+ FilesToRunProvider momcWrapper() {
+ return ruleContext.getExecutablePrerequisite("$momcwrapper", Mode.HOST);
}
/**
- * Returns the location of the actoolzip deploy jar.
+ * Returns the location of the actoolwrapper.
*/
- Artifact actoolzipDeployJar() {
- return ruleContext.getPrerequisiteArtifact("$actoolzip_deploy", Mode.HOST);
+ FilesToRunProvider actoolWrapper() {
+ return ruleContext.getExecutablePrerequisite("$actoolwrapper", Mode.HOST);
}
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosSdkCommands.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosSdkCommands.java
index 7d0c2337a3..799597bee0 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosSdkCommands.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosSdkCommands.java
@@ -32,8 +32,6 @@ import java.util.List;
*/
public class IosSdkCommands {
public static final String DEVELOPER_DIR = "/Applications/Xcode.app/Contents/Developer";
- public static final String ACTOOL_PATH = DEVELOPER_DIR + "/usr/bin/actool";
- public static final String MOMC_PATH = DEVELOPER_DIR + "/usr/bin/momc";
// There is a handy reference to many clang warning flags at
// http://nshipster.com/clang-diagnostics/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
index 02d3566135..a879f9d786 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
@@ -66,7 +66,6 @@ public class ObjcRuleClasses {
static final PathFragment LIBTOOL = new PathFragment(BIN_DIR + "/libtool");
static final PathFragment DSYMUTIL = new PathFragment(BIN_DIR + "/dsymutil");
static final PathFragment LIPO = new PathFragment(BIN_DIR + "/lipo");
- static final PathFragment SWIFT_STDLIB_TOOL = new PathFragment(BIN_DIR + "/swift-stdlib-tool");
static final PathFragment STRIP = new PathFragment(BIN_DIR + "/strip");
private static final PathFragment JAVA = new PathFragment("/usr/bin/java");
@@ -469,16 +468,14 @@ public class ObjcRuleClasses {
return builder
.add(attr("$plmerge", LABEL).cfg(HOST).exec()
.value(env.getLabel("//tools/objc:plmerge")))
- .add(attr("$actoolzip_deploy", LABEL).cfg(HOST)
- .value(env.getLabel("//tools/objc:actoolzip_deploy.jar")))
+ .add(attr("$actoolwrapper", LABEL).cfg(HOST).exec()
+ .value(env.getLabel("//tools/objc:actoolwrapper")))
.add(attr("$ibtoolwrapper", LABEL).cfg(HOST).exec()
.value(env.getLabel("//tools/objc:ibtoolwrapper")))
// TODO(dmaclach): Adding realpath here should not be required once
// https://github.com/google/bazel/issues/285 is fixed.
.add(attr("$realpath", LABEL).cfg(HOST).exec()
.value(env.getLabel("//tools/objc:realpath")))
- .add(attr("$swiftstdlibtoolzip_deploy", LABEL).cfg(HOST)
- .value(env.getLabel("//tools/objc:swiftstdlibtoolzip_deploy.jar")))
.build();
}
@Override
@@ -871,8 +868,10 @@ public class ObjcRuleClasses {
<!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
.add(attr("families", STRING_LIST)
.value(ImmutableList.of(TargetDeviceFamily.IPHONE.getNameInRule())))
- .add(attr("$momczip_deploy", LABEL).cfg(HOST)
- .value(env.getLabel("//tools/objc:momczip_deploy.jar")))
+ .add(attr("$momcwrapper", LABEL).cfg(HOST).exec()
+ .value(env.getLabel("//tools/objc:momcwrapper")))
+ .add(attr("$swiftstdlibtoolwrapper", LABEL).cfg(HOST).exec()
+ .value(env.getLabel("//tools/objc:swiftstdlibtoolwrapper")))
.build();
}
@Override
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;
}