aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/android
diff options
context:
space:
mode:
authorGravatar Andrew Pellegrini <apell@google.com>2016-02-22 16:13:06 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-23 13:08:22 +0000
commitcc30db9014996170357f4c1cba1aef308ee142c9 (patch)
treefc390e6be9c58fb2c5c789a6f67a1b23c2d6930b /tools/android
parentf98290d238f602b9875ce760f2b5b36e894ecaaf (diff)
Adds the ResourceShrinkerAction. Uses the results of resource processing and a dead code removal Proguard pass to create an ap_ without unused resources to be used when building android_binary targets.
-- MOS_MIGRATED_REVID=115227385
Diffstat (limited to 'tools/android')
-rw-r--r--tools/android/BUILD6
-rwxr-xr-xtools/android/resource_shrinker.sh21
2 files changed, 27 insertions, 0 deletions
diff --git a/tools/android/BUILD b/tools/android/BUILD
index 14531467d0..d7f05fa94f 100644
--- a/tools/android/BUILD
+++ b/tools/android/BUILD
@@ -25,6 +25,12 @@ sh_binary(
)
sh_binary(
+ name = "resource_shrinker",
+ srcs = ["resource_shrinker.sh"],
+ data = ["//src/tools/android/java/com/google/devtools/build/android:ResourceShrinkerAction"],
+)
+
+sh_binary(
name = "merge_dexzips",
srcs = ["merge_dexzips.sh"],
data = ["//src/tools/android/java/com/google/devtools/build/android/ziputils:reducer"],
diff --git a/tools/android/resource_shrinker.sh b/tools/android/resource_shrinker.sh
new file mode 100755
index 0000000000..bcfa97e16b
--- /dev/null
+++ b/tools/android/resource_shrinker.sh
@@ -0,0 +1,21 @@
+#!/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.
+if echo $0 | grep -sq /external/; then
+ PREFIX="external/$(echo $0 | sed 's_^.*external/\([^/]*\)/.*$_\1_')"
+else
+ PREFIX=""
+fi
+
+exec "${TEST_SRCDIR-$0.runfiles}/$PREFIX/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction" "$@"