aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AarGeneratorAction.java
Commit message (Collapse)AuthorAge
* Create proguard.txt in android_library AAR output.Gravatar ajmichael2018-04-02
| | | | | | | | | The proguard.txt is the concatenation of the proguard_specs on the android_library rule itself. Note that it does not include transitively defined proguard_specs. Fixes https://github.com/bazelbuild/bazel/issues/4467 RELNOTES: android_library AAR output now contains proguard.txt PiperOrigin-RevId: 191302610
* Change android_library .aar timestamp and open-source AarGeneratorActionTest.Gravatar ajmichael2018-02-26
| | | | | | | See https://github.com/bazelbuild/bazel/issues/4614 and https://github.com/bazelbuild/bazel/commit/bcefd9833cb5620fef8a27c37c2808a66b57c7e6. RELNOTES: None PiperOrigin-RevId: 187029042
* 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
* Switch android tools' use of options parser to a more concise form for the ↵Gravatar ccalvarin2017-08-21
| | | | | | | | | | | single options-base case. This is to prepare the options parser from making options parser creation exceptions a caught exception. Since all of these classes already have a single options class and used parseAndExitUponError, this allows us to keep behavior consistent between the malformed options-base errors and the incorrect user-input errors. All the other uses of the options parser in //src/tools already throw sufficiently broad exceptions to not need this. RELNOTES: None PiperOrigin-RevId: 165702786
* 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
* Add flag to turn Android resource merge conflicts from warnings into errorsGravatar Googler2017-07-14
| | | | | RELNOTES: none PiperOrigin-RevId: 161831232
* Add categories transition values to android options.Gravatar ccalvarin2017-06-30
| | | | | | Automated formatting fixes standardize the @Option annotation. PiperOrigin-RevId: 160567787
* Remove MergingExceptionGravatar corysmith2017-05-04
| | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/2709 RELNOTES: None. PiperOrigin-RevId: 155097576
* If resources were prefiltered, ignore unavailable resources from dependenciesGravatar Googler2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filtering resources in analysis allows Bazel to save time by not copying unwanted resources to the execution phase and by having less resource for execution to process. However, analysis-phase resource filtering currently happens only for android_binary targets. android_library dependencies will contain references to all of their resources in their R and symbol files, even if those resources are filtered out and not made available to execution. Eventually, we want to use dynamic configuration to propogate the filters being used on android_binary targets to android_library dependencies as well, and filter those in analysis also. Until then, however, we need a way of ignoring unwanted resources if they don't exist. This change adds a flag to the AndroidResourceProcessingAction to indicate that resources were filtered in analysis. If the flag is passed, if a resource referred to in a parsed symbols file is not actually visible, it will be ignored (otherwise, the action would go on to merging and eventually crash when it tried to use the missing resource). If the flag is passed, execution-time resource filtering by density will also be skipped (execution-time filtering by other resource qualifiers happens in aapt, but is a much simpler process). -- PiperOrigin-RevId: 150752270 MOS_MIGRATED_REVID=150752270
* Remove unused, unpassed AarGeneratorAction flag.Gravatar Adam Michael2017-03-22
| | | | | | -- PiperOrigin-RevId: 150748157 MOS_MIGRATED_REVID=150748157
* 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
* AndroidResourceProcessor: sort files before writing zipsGravatar Googler2017-03-07
| | | | | | | | | | | | walkFileTree can be non-determinisitic, so the zip entries can be listed in a different order: "A file tree is walked depth first, but you cannot make any assumptions about the iteration order that subdirectories are visited." -- PiperOrigin-RevId: 149345145 MOS_MIGRATED_REVID=149345145
* 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
* Remove dependency data from AarGeneratorActionGravatar Googler2016-09-08
| | | | | | | | | | | It's not supposed to cover direct deps and trans deps according to the documentation anyway. Also prepare to move the --strictMerge flag. The option isn't checked anymore. There's only one type of merging. -- MOS_MIGRATED_REVID=132444314
* 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
* 5 of 5: Integrate with the AndroidResourceProcessorGravatar Googler2016-07-21
| | | | | -- MOS_MIGRATED_REVID=128074515
* 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
* Use BufferedOutputStream for zipping / jar.Gravatar Googler2016-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | This is for the resources.zip and the srcjar and aar. For the srcjar this is only slightly faster (100ms), but we might as well? Perhaps this is because the files are quite large anyway. Not sure if there would be smaller writes with compression. For the resources.zip it seems to make a bigger difference: > 1s when run locally. Perhaps this is because there are more small files. Didn't benchmark aar at all, just noticed it. Kevin mentioned the Buffering on one of the issues, so I happened to notice this when using similar code for prototype of R.class jar creation (seemed to be > 1s faster in that case, but that was also compressing). -- MOS_MIGRATED_REVID=122663374
* Make AarGeneratorAction deterministic by zeroing zip entry timestamps.Gravatar Nicholas Lativy2016-05-17
| | | | | | | | ZipOutputStream#putNextEntry(ZipEntry) sets the modification time to the current time if no time is set on the ZipEntry passed to it. -- MOS_MIGRATED_REVID=122436300
* Split manifest processing out of AndroidResourceProcessor#processResources() ↵Gravatar Andrew Pellegrini2016-02-17
| | | | | | | as preparation for the ResourceShrinkerAction which does not require it as part of its aapt invocation. -- MOS_MIGRATED_REVID=114755551
* Turn down the log level for AarGeneratorAction's timing information. It's ↵Gravatar Googler2016-02-01
| | | | | | | | | | not useful in the general case and just contributes to Android build logspam. R_FUTURE=apell CC=blaze-devel+cl -- MOS_MIGRATED_REVID=113379242
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Updates AndroidResourceProcessingAction and AarGeneratorAction to use temp ↵Gravatar Alex Humesky2015-07-23
| | | | | | | directories so that their files don't conflict with subsequent or concurrent invocations of those actions. -- MOS_MIGRATED_REVID=98848810
* Fix of intermittent hang when building Aar files. This is an untested fix ↵Gravatar Andrew Pellegrini2015-06-26
| | | | | | | because the hang cannot be reproduced on demand, but not calling System.exit() has caused the same problem previously in both AndroidResourceProcessingAction and AarGeneratorAction. Mimics the exception handling behavior in AndroidResourceProcessingAction, which is not known to cause any hangs. -- MOS_MIGRATED_REVID=96911485
* Open source AarGeneratorAction and AndroidResourceProcessingAction.Gravatar Andrew Pellegrini2015-06-26
-- MOS_MIGRATED_REVID=96883818