diff options
author | 2015-09-29 19:21:29 +0000 | |
---|---|---|
committer | 2015-09-30 09:35:49 +0000 | |
commit | 0bb2f0201bda365348f9543d83e53fa90b9134d0 (patch) | |
tree | e5d0df1136aa1312296b3abc7946d07f0cfcafe7 /src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java | |
parent | 1726affaca7be2707f1e462c8e1ba783f4e1770f (diff) |
Move actoolzip, momczip and swiftstdlibtoolzip to tools/xcode and convert them to scripts instead of java apps.
RELNOTES: actoolzip, momczip and swiftstdlibtoolzip have all been made into bash scripts and have been renamed to actoolwrapper, momcwrapper and swiftstdlibtoolwrapper respectively. The old versions will be deleted in a later change.
--
MOS_MIGRATED_REVID=104225062
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java | 35 |
1 files changed, 19 insertions, 16 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 df0346feb8..cad27e149f 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 @@ -225,7 +225,7 @@ final class BundleSupport { ruleContext.registerAction( ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .setMnemonic("StoryboardCompile") - .setExecutable(attributes.ibtoolwrapper()) + .setExecutable(attributes.ibtoolWrapper()) .setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, storyboardInput)) .addOutput(zipOutput) .addInput(storyboardInput) @@ -263,15 +263,17 @@ final class BundleSupport { for (Xcdatamodel datamodel : xcdatamodels) { Artifact outputZip = datamodel.getOutputZip(); ruleContext.registerAction( - ObjcRuleClasses.spawnJavaOnDarwinActionBuilder(ruleContext, attributes.momczipDeployJar()) + ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .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") @@ -294,7 +296,7 @@ final class BundleSupport { ruleContext.registerAction( ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .setMnemonic("XibCompile") - .setExecutable(attributes.ibtoolwrapper()) + .setExecutable(attributes.ibtoolWrapper()) .setCommandLine(ibActionsCommandLine(archiveRoot, zipOutput, original)) .addOutput(zipOutput) .addInput(original) @@ -373,11 +375,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(ruleContext, attributes.actoolzipDeployJar()) + ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .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, @@ -391,9 +397,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()); @@ -464,7 +467,7 @@ final class BundleSupport { /** * Returns the location of the ibtoolwrapper tool. */ - FilesToRunProvider ibtoolwrapper() { + FilesToRunProvider ibtoolWrapper() { return ruleContext.getExecutablePrerequisite("$ibtoolwrapper", Mode.HOST); } @@ -478,17 +481,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); } } } |