diff options
author | Adam Michael <ajmichael@google.com> | 2016-09-30 21:31:29 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-10-04 08:53:17 +0000 |
commit | 1b4b207170a87fc8f1ac94413ed9af424b674025 (patch) | |
tree | 03651e309143c4c8cf64b2605988f4869cc5439f | |
parent | 5bb9cc96e3b20197a1a10d965ac64d07b1a25e5a (diff) |
Remove dependency on $unzip for aar_import. Replaces the functionality with //third_party/ijar/zipper.
--
MOS_MIGRATED_REVID=134827924
4 files changed, 3 insertions, 35 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImport.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImport.java index 02781401fb..8803d86b8d 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImport.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImport.java @@ -117,15 +117,15 @@ public class AarImport implements RuleConfiguredTargetFactory { private static Action[] createSingleFileExtractor(RuleContext ruleContext, Artifact aar, String filename, Artifact outputArtifact) { return new SpawnAction.Builder() - .setExecutable(ruleContext.getExecutablePrerequisite("$unzip", Mode.HOST)) + .setExecutable(ruleContext.getExecutablePrerequisite("$zipper", Mode.HOST)) .setMnemonic("AarFileExtractor") .setProgressMessage("Extracting " + filename + " from " + aar.getFilename()) - .addArgument("-j") + .addArgument("x") .addInputArgument(aar) - .addArgument(filename) .addArgument("-d") .addOutput(outputArtifact) .addArgument(outputArtifact.getExecPath().getParentDirectory().getPathString()) + .addArgument(filename) .build(ruleContext); } diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImportRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImportRule.java index dfc4483f1b..61618bdb6a 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImportRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/AarImportRule.java @@ -28,7 +28,6 @@ import com.google.devtools.build.lib.packages.RuleClass.Builder; import com.google.devtools.build.lib.rules.android.AndroidRuleClasses.AndroidAaptBaseRule; import com.google.devtools.build.lib.rules.java.JavaCompilationArgsProvider; import com.google.devtools.build.lib.util.FileType; -import com.google.devtools.build.lib.util.FileTypeSet; /** Rule definition for the aar_import rule. */ public class AarImportRule implements RuleDefinition { @@ -49,12 +48,6 @@ public class AarImportRule implements RuleDefinition { .exec() .value(Label.parseAbsoluteUnchecked( environment.getToolsRepository() + "//tools/zip:zip_manifest_creator"))) - .add(attr("$unzip", LABEL) - .cfg(HOST) - .exec() - .value(Label.parseAbsoluteUnchecked( - environment.getToolsRepository() + "//tools/zip:unzip")) - .allowedFileTypes(FileTypeSet.ANY_FILE)) .add(attr("$zipper", LABEL) .cfg(HOST) .exec() diff --git a/tools/zip/BUILD.tools b/tools/zip/BUILD.tools index c7b69d5b4e..58f9267f2f 100644 --- a/tools/zip/BUILD.tools +++ b/tools/zip/BUILD.tools @@ -6,11 +6,6 @@ filegroup( ) sh_binary( - name = "unzip", - srcs = ["unzip.sh"], -) - -sh_binary( name = "zip_manifest_creator", srcs = ["zip_manifest_creator.sh"], data = [":zipper"], diff --git a/tools/zip/unzip.sh b/tools/zip/unzip.sh deleted file mode 100755 index 12efdbd9aa..0000000000 --- a/tools/zip/unzip.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright 2016 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This exists so that unzip can be invoked by a SpawnAction. It relies on unzip -# existing in the user's path. - -unzip "$@" |