From e1d3b87302cb11a4a1bad72b22cbe4b998296314 Mon Sep 17 00:00:00 2001 From: laszlocsomor Date: Thu, 20 Jul 2017 10:10:45 +0200 Subject: Automated rollback of commit 01ddfb7bf418b371859de62f4eab2f41ea9a4a4a. This is a partial rollback. I restored the old flags (with PathListConverter), added the new ones, added deprecation warnings and annotations, and added code to concat the values of new and old. Existing released versions of Bazel should keep working with the new code until 2018-01-31, i.e. for the next ~6 months. After that I'll remove the old flags and the PathListConverter. *** Reason for rollback *** Fixed broken integration with release Blaze. *** Original change description *** Automated rollback of commit 5752463ece84ebb4fb074888cba57412ab8d86b3. *** Reason for rollback *** Broke too many targets. *** RELNOTES: none PiperOrigin-RevId: 162587548 --- .../build/android/ResourceShrinkerAction.java | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java') diff --git a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java index b6ae74ede9..dbf10163ac 100644 --- a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java @@ -32,6 +32,7 @@ import com.google.devtools.common.options.Converters.CommaSeparatedOptionListCon import com.google.devtools.common.options.Option; import com.google.devtools.common.options.OptionDocumentationCategory; import com.google.devtools.common.options.OptionEffectTag; +import com.google.devtools.common.options.OptionMetadataTag; import com.google.devtools.common.options.OptionsBase; import com.google.devtools.common.options.OptionsParser; import java.io.FileInputStream; @@ -63,7 +64,7 @@ import org.xml.sax.SAXException; * --resources path to processed resources zip * --rTxt path to processed resources R.txt * --primaryManifest path to processed resources AndroidManifest.xml - * --dependencyManifests paths to dependency library manifests + * --dependencyManifest path to dependency library manifest (repeated flag) * --shrunkResourceApk path to write shrunk ap_ * --shrunkResources path to write shrunk resources zip * @@ -129,16 +130,33 @@ public class ResourceShrinkerAction { ) public Path primaryManifest; + @Option( + name = "dependencyManifest", + allowMultiple = true, + defaultValue = "", + category = "input", + converter = PathConverter.class, + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "Paths to the manifests of the dependencies. Specify one path per flag." + ) + public List dependencyManifests; + + // TODO(laszlocsomor): remove this flag after 2018-01-31 (about 6 months from now). Everyone + // should have updated to newer Bazel versions by then. + @Deprecated @Option( name = "dependencyManifests", defaultValue = "", category = "input", converter = PathListConverter.class, + deprecationWarning = "Deprecated in favour of \"--dependencyManifest\"", documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.UNKNOWN}, - help = "A list of paths to the manifests of the dependencies." + help = "A list of paths to the manifests of the dependencies.", + metadataTags = {OptionMetadataTag.DEPRECATED} ) - public List dependencyManifests; + public List deprecatedDependencyManifests; @Option( name = "resourcePackages", @@ -236,6 +254,8 @@ public class ResourceShrinkerAction { optionsParser.parseAndExitUponError(args); aaptConfigOptions = optionsParser.getOptions(AaptConfigOptions.class); options = optionsParser.getOptions(Options.class); + options.dependencyManifests = PathListConverter.concatLists( + options.dependencyManifests, options.deprecatedDependencyManifests); AndroidResourceProcessor resourceProcessor = new AndroidResourceProcessor(stdLogger); // Setup temporary working directories. -- cgit v1.2.3