aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java
Commit message (Collapse)AuthorAge
* Normalize parameter name commentsGravatar cushon2018-04-27
| | | | PiperOrigin-RevId: 194512971
* Remove some deprecated resources flags.Gravatar ajmichael2018-04-04
| | | | | RELNOTES: None PiperOrigin-RevId: 191624839
* Make android tools stop accepting --annotationJar.Gravatar ajmichael2018-03-22
| | | | | | | Bazel stopped passing it in https://github.com/bazelbuild/bazel/commit/1a6ca6f47aef36d56b5cb2f9da114af75dde583d. RELNOTES: None PiperOrigin-RevId: 190064697
* Automated rollback of commit f672a31b8b19baab95373e4f2f6d110aa8b8f0fb.Gravatar corysmith2018-02-16
| | | | | | | | | | | | | *** Reason for rollback *** Unclassified general breakages in tests. Rolling back for further investigation. *** Original change description *** Normalized the serialization proto to save space and allow greater versatility in storage. RELNOTES: None PiperOrigin-RevId: 186057879
* Normalized the serialization proto to save space and allow greater ↵Gravatar corysmith2018-02-16
| | | | | | | versatility in storage. RELNOTES: None PiperOrigin-RevId: 186036607
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Migrate all users of OptionsParser.enableParamsFileSupport to use the ↵Gravatar apell2017-10-18
| | | | | | | ShellQuotedParamsFilePreProcessor. This covers all of the tools packaged in the ResourceProcessorBusyBox. RELNOTES: None. PiperOrigin-RevId: 172485486
* Action for resource shrinking with aapt2Gravatar corysmith2017-09-22
| | | | | | | Introduces the ResourcesZip class to more easily handle processing merged resources. RELNOTES: None PiperOrigin-RevId: 169622715
* Android BusyBox: deprecate --libraries flagGravatar laszlocsomor2017-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate the --libraries flag of the GENERATE_BINARY_R tool in favour of --library. The new flag is multi-value and uses "," as the pair-separator instead of ":". The value converter still supports ":"-separated pairs as well, but looks for "," first. Old format: --libraries=key1:value1,key2:value2,... New format: --library=key1,value1 --library=key2,value2 Motivation: - the ":"-separator prevents using absolute paths on Windows The old flag is still supported, but will be removed after 2018-02-28 (about 6 months from now). Also in this commit: - add a new method to CustomCommandLine.Builder to lazily construct the command line for the --library flag See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164246506
* Automated rollback of commit 01ddfb7bf418b371859de62f4eab2f41ea9a4a4a.Gravatar laszlocsomor2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make the @Option annotation depend on the java version of the tagging enums.Gravatar ccalvarin2017-07-18
| | | | | | | The option filters proto dependency can be removed from the OptionsParser. This is in response to option parser users that want to avoid the bazel-internal proto file in their dependencies. RELNOTES: None. PiperOrigin-RevId: 162249778
* Internal changeGravatar Googler2017-07-17
| | | | PiperOrigin-RevId: 162194755
* AndroidBusyBox: deprecate path-list-type flagsGravatar laszlocsomor2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: - deprecates PathListConverter - removes ExistingPathListConverter because it was not used in production, only tests - deprecated List<Path> type flags that use PathListConverter - introduces new List<Path> type flags next to the deprecated ones that use @Options.allowMultiple and convert with PathConverter; the new and old lists are concatenated, yielding the flag value PathListConverter and all of its occurrences should be removed after 2018-01-31 (about 6 months from now, which is a safe enough timeframe for everyone to upgrade Bazel so it uses the new-style flags). Reason for deprecation is that colon-separated path lists don't work on Windows because paths have colons in them. Since the Android BusyBox is not intended to be executed by users but by Bazel only, there's no release notes necessary. See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 162193998
* Android BusyBox: use the JunctionCreatorGravatar Laszlo Csomor2017-07-11
| | | | | | | | | | | | | | | | | | | Use the recently added JunctionCreator class in the Android BusyBox. Query the current OS's name, where the BusyBox process runs (using System.getProperty("os.name")) and instantiate the corresponding JunctionCreator implementation. This allows the BusyBox to work around path length limitations on Windows; see WindowsJunctionCreator. See https://github.com/bazelbuild/bazel/issues/3264 Change-Id: Ifc1a3c86971e64c2f42bcec2988b7e9239a1d29a PiperOrigin-RevId: 161494557
* Add categories transition values to android options.Gravatar ccalvarin2017-06-30
| | | | | | Automated formatting fixes standardize the @Option annotation. PiperOrigin-RevId: 160567787
* Breaking up is hard to do: AndroidResourceProcessorGravatar Googler2017-03-16
| | | | | | | | | | | * Extract merging methods to a static class * Extract output methods to a static class * Extract manifest processing methods to a class * Move ExecutorCloserService to the top level -- PiperOrigin-RevId: 150219121 MOS_MIGRATED_REVID=150219121
* Allow ResourceShrinkerAction to support splits.Gravatar Michael Staib2016-12-20
| | | | | | | | | | This is needed to support both shrinking and splitting at the same time, which will become the default for any android_binary which has splits defined on it once shrinking becomes default (if it hasn't already). -- PiperOrigin-RevId: 142497302 MOS_MIGRATED_REVID=142497302
* Switch Bazel to use ResourceUsageAnalyzer.java instead of ResourceShrinker.java.Gravatar Andrew Pellegrini2016-12-19
| | | | | | -- PiperOrigin-RevId: 142484589 MOS_MIGRATED_REVID=142484589
* Update android_ide_common to 25.0.0 and clean up FolderConfigsGravatar Googler2016-10-07
| | | | | | | | | | | Older android_ide_common does not handle BCP 47, so we update the code to handle that and remove most of the workarounds. This also pulls in a fix for 3-letter locales, unblocks resource shrinking whitelisting, etc. -- MOS_MIGRATED_REVID=135396457
* Add options to ResourceShrinkerAction to generate an updated R.txt.Gravatar Andrew Pellegrini2016-09-27
| | | | | -- MOS_MIGRATED_REVID=134312343
* Add a lightweight resource merge action.Gravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | Part 2 of the 3 new proposed android_library res processing actions. The primary and deps are all assumed to be parsed+summarized in a protobuf. Represent that with a new class (similar to DependencyAndroidData but w/out R.txt). Avoid having "manifest" artifacts as deps input, and instead use "label", since that is only used in a warning. DepAD still uses the manifest for #asSymbolFileProvider, so we keep it there. Move loading the primary out of the merge function so that we can share the merge function with this style of primary data, and the existing style of of primary data (UnvalidatedAndroidData). This produces an R class.jar and a zip file to pass along to a future validation action. Images are stubbed out since they are irrelevant to the validation action. -- MOS_MIGRATED_REVID=131604421
* Adds data binding support to the Android resource processor.Gravatar Greg Estren2016-08-23
| | | | | | | | | | | | | | | | This is invoked via the new --dataBindingInfoOut flag. If specified and the rule has resources, data binding declarations in layout .xmls are stripped and fed into an aggregated .zip file under that name. The original (stripped) .xml is then fed into aapt for normal processing. If specified and the rule has no resources, an empty file is created. If not specified, everything works as before. -- MOS_MIGRATED_REVID=130973265
* Change android resource shrinking to use the standard Proguard jar artifact.Gravatar Andrew Pellegrini2016-07-27
| | | | | | | | * Re-add proguard mapping file handling to ResourceShrinker to handle the fully Proguarded code, potentially including an obfuscation step. * Update android_binary to provide the resource shrinker with the standard Proguard jar and obfuscation mapping instead of a custom built shrunk jar. -- MOS_MIGRATED_REVID=128476602
* Add output log for android resource shrinking, following the format produced ↵Gravatar Andrew Pellegrini2016-07-04
| | | | | | | by the Gradle resource shrinker in resources.txt. -- MOS_MIGRATED_REVID=126420534
* Roll forward of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214: action to ↵Gravatar Googler2016-06-23
| | | | | | | | | | | | | | | | | | | | | | | | write R classes directly NEW: add check that primary R.txt exists before trying to load its symbols. Rollback of commit 32c6c15c8b9bc4e203529f60bedbc5cd8a496a36. *** Reason for rollback *** Rollforward with check that primary R.txt exists *** Original change description *** Automated [] rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214. *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125559472
* Rollback of commit 1f1f207573c7b9c3e2d3ca1ffb0780a8fd592214.Gravatar Googler2016-06-21
| | | | | | | | | *** Reason for rollback *** Doesn't handle aapt that doesn't generate R.txt properly. -- MOS_MIGRATED_REVID=125405481
* Add action to write android_binary and lib R.classes directlyGravatar Googler2016-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For android_binary rules, we regenerate all of the R.java of the libraries to get the final resource IDs. Compiling all of them together can be slow with the normal JavaBuilder, so add a specialized class writer. Example build with many R.java classes: - R.java -> R.class via JavaBuilder: over 80s - ErrorProne takes about 40% of that. So turning off ErrorProne would be projected to be 48s. Some of ErrorProne slowness is from static field checks (e.g., on Flag classes), which may look up the same Type over and over. In comparison, if we write our own bytecode with ASM: - ~16s total - 4.7s to parse R.txt - 4.8s to write class files - 5.8s to copy and compress .jar TODO: clean up SymbolLoader patching (upstream) This only creates the action. We will need to separately wire this up in blaze. NOTE: This also makes the exising R.txt loading used by live code multi-threaded, since that is partly I/O-bound. Something to watch out for (for flakiness, etc.) once this is submitted. -- MOS_MIGRATED_REVID=125384467
* Enable the AndroidResourceProcessingAction to accept splits.Gravatar Michael Staib2016-06-06
| | | | | | | | | These splits will be passed through to aapt, which will create additional resource packages (and reduce the set found in the base ap_) as a result. -- MOS_MIGRATED_REVID=123995947
* [Android] Support aapt-generated main dex specs.Gravatar Googler2016-05-05
| | | | | | | | Add bazel support for using the "aapt -D" command to generate a proguard specification for components which need to be in the main dex. -- MOS_MIGRATED_REVID=121531584
* Provide ResourceShrinker with the generated R.java packages in addition to ↵Gravatar Andrew Pellegrini2016-04-08
| | | | | | | packages from manifests. This prevents resources from being removed when they have been generated into a package other than the one specified in their target's manifest. -- MOS_MIGRATED_REVID=119294591
* Adds the ResourceShrinkerAction. Uses the results of resource processing and ↵Gravatar Andrew Pellegrini2016-02-23
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