aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Dave MacLachlan <dmaclach@google.com>2016-02-04 01:03:38 +0000
committerGravatar David Chen <dzc@google.com>2016-02-04 18:10:53 +0000
commit9f7a9095bc0909a5fd335c43dae31ab8ac5af2a7 (patch)
tree3cc60ba475e8b90e2b504f9a712a46ba69de4470 /src/main/java/com/google/devtools
parent4800626eee5245a062e910b648adb2f291e212c5 (diff)
Now that rules find their tools via runfiles, remove unneeded dependencies in rules/tests and move them into the build files.
Fix up environment_plist so it works like the other scripts. -- MOS_MIGRATED_REVID=113799298
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java27
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java12
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java23
3 files changed, 9 insertions, 53 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 d2c72394d9..05ab0a528c 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
@@ -238,10 +238,6 @@ final class BundleSupport {
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, storyboardInput))
.addOutput(zipOutput)
.addInput(storyboardInput)
- // TODO(dmaclach): Adding realpath and xcrunwrapper should not be required once
- // https://github.com/bazelbuild/bazel/issues/285 is fixed.
- .addInput(attributes.realpath())
- .addInput(CompilationSupport.xcrunwrapper(ruleContext).getExecutable())
.setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}
@@ -282,12 +278,8 @@ final class BundleSupport {
.setExecutable(attributes.momcWrapper())
.addOutput(outputZip)
.addInputs(datamodel.getInputs())
- // TODO(dmaclach): Adding realpath and xcrunwrapper should not be required once
- // https://github.com/google/bazel/issues/285 is fixed.
- .addInput(attributes.realpath())
- .addInput(CompilationSupport.xcrunwrapper(ruleContext).getExecutable())
.setVerboseFailuresAndSubcommandsInEnv()
- .setCommandLine(CustomCommandLine.builder()
+ .setCommandLine(CustomCommandLine.builder()
.addPath(outputZip.getExecPath())
.add(datamodel.archiveRootForMomczip())
.add("-XD_MOMC_SDKROOT=" + AppleToolchain.sdkDir())
@@ -316,10 +308,6 @@ final class BundleSupport {
.setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, original))
.addOutput(zipOutput)
.addInput(original)
- // TODO(dmaclach): Adding realpath and xcrunwrapper should not be required once
- // https://github.com/bazelbuild/bazel/issues/285 is fixed.
- .addInput(attributes.realpath())
- .addInput(CompilationSupport.xcrunwrapper(ruleContext).getExecutable())
.setVerboseFailuresAndSubcommandsInEnv()
.build(ruleContext));
}
@@ -400,10 +388,6 @@ final class BundleSupport {
.addTransitiveInputs(objcProvider.get(ASSET_CATALOG))
.addOutput(zipOutput)
.addOutput(actoolPartialInfoplist)
- // TODO(dmaclach): Adding realpath and xcrunwrapper should not be required once
- // https://github.com/google/bazel/issues/285 is fixed.
- .addInput(attributes.realpath())
- .addInput(CompilationSupport.xcrunwrapper(ruleContext).getExecutable())
.setVerboseFailuresAndSubcommandsInEnv()
.setCommandLine(actoolzipCommandLine(
objcProvider,
@@ -496,15 +480,6 @@ final class BundleSupport {
}
/**
- * Returns the location of the realpath tool.
- * TODO(dmaclach): Should not be required once https://github.com/bazelbuild/bazel/issues/285
- * is fixed.
- */
- Artifact realpath() {
- return ruleContext.getPrerequisiteArtifact("$realpath", Mode.HOST);
- }
-
- /**
* Returns the location of the momcwrapper.
*/
FilesToRunProvider momcWrapper() {
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 4f1cd369b9..9849565699 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
@@ -517,10 +517,6 @@ public class ObjcRuleClasses {
.value(env.getLabel(env.getToolsRepository() + "//tools/objc:actoolwrapper")))
.add(attr("$ibtoolwrapper", LABEL).cfg(HOST).exec()
.value(env.getLabel(env.getToolsRepository() + "//tools/objc:ibtoolwrapper")))
- // TODO(dmaclach): Adding realpath here should not be required once
- // https://github.com/bazelbuild/bazel/issues/285 is fixed.
- .add(attr("$realpath", LABEL).cfg(HOST).exec()
- .value(env.getLabel(env.getToolsRepository() + "//tools/objc:realpath")))
.build();
}
@Override
@@ -979,11 +975,11 @@ public class ObjcRuleClasses {
.exec()
.value(env.getLabel(env.getToolsRepository() + "//tools/objc:bundlemerge")))
.add(
- attr("$environment_plist_sh", LABEL)
+ attr("$environment_plist", LABEL)
.cfg(HOST)
- .value(
- env.getLabel(
- env.getToolsRepository() + "//tools/objc:environment_plist.sh")))
+ .exec()
+ .value(env.getLabel(
+ env.getToolsRepository() + "//tools/objc:environment_plist")))
.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 6741b927d1..2434d88690 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
@@ -388,8 +388,7 @@ public final class ReleaseBundlingSupport {
ruleContext.registerAction(
ObjcRuleClasses.spawnOnDarwinActionBuilder()
.setMnemonic("EnvironmentPlist")
- .addInput(attributes.environmentPlistScript())
- .setExecutable(attributes.environmentPlistScript())
+ .setExecutable(attributes.environmentPlist())
.addArguments("--platform", platformWithVersion)
.addArguments("--output", getGeneratedEnvironmentPlist().getExecPathString())
.addOutput(getGeneratedEnvironmentPlist())
@@ -887,10 +886,6 @@ public final class ReleaseBundlingSupport {
.setCommandLine(commandLine.build())
.addOutput(intermediateArtifacts.swiftFrameworksFileZip())
.addInput(intermediateArtifacts.combinedArchitectureBinary())
- // TODO(dmaclach): Adding realpath and xcrunwrapper should not be required once
- // https://github.com/google/bazel/issues/285 is fixed.
- .addInput(attributes.realpath())
- .addInput(CompilationSupport.xcrunwrapper(ruleContext).getExecutable())
.build(ruleContext));
}
@@ -1023,20 +1018,10 @@ public final class ReleaseBundlingSupport {
}
/**
- * Returns the location of the realpath tool.
- * TODO(dmaclach): Should not be required once https://github.com/google/bazel/issues/285
- * is fixed.
+ * Returns the location of the environment_plist.
*/
- Artifact realpath() {
- return ruleContext.getPrerequisiteArtifact("$realpath", Mode.HOST);
- }
-
- /**
- * Returns the location of the environment_plist.sh.
- */
- public Artifact environmentPlistScript() {
- return checkNotNull(
- ruleContext.getPrerequisiteArtifact("$environment_plist_sh", Mode.HOST));
+ public FilesToRunProvider environmentPlist() {
+ return ruleContext.getExecutablePrerequisite("$environment_plist", Mode.HOST);
}
String bundleId() {