aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction.java
Commit message (Collapse)AuthorAge
* Normalize parameter name commentsGravatar cushon2018-04-27
| | | | PiperOrigin-RevId: 194512971
* Ability to pass decoupled assets into monolithic resource processing actionGravatar asteinb2018-04-17
| | | | | | | | | - New flags to pass in asset deps - Pass assets into merging in the monolithic action - Field for asset deps in asset builder action RELNOTES: none PiperOrigin-RevId: 193211038
* 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
* Ensure the public.xml is included with the databound resources.Gravatar corysmith2018-02-27
| | | | | RELNOTES: None PiperOrigin-RevId: 187185374
* Expand databinding expressions in resource_files.zip.Gravatar ajmichael2018-02-26
| | | | | | | This zip is the input to the resource shrinker, which currently sometimes chokes on databinding expressions. This should fix that. RELNOTES: None PiperOrigin-RevId: 187049578
* Remove unused density filtering flagGravatar asteinb2018-02-22
| | | | | | | | | Because of limitations in Bazel (primarily, Filesets), we always need to filter on density in execution. As such, remove the deprecated flag that was used to specify densities that were stamped but not filtered. RELNOTES: none PiperOrigin-RevId: 186634496
* Always do filtering in execution (even after doing it in analysis)Gravatar Googler2018-02-06
| | | | | | | | | | | | Filtering only in analysis was neglecting the possibility of resources being in filesets, the contents of which are not available in analysis. As such, we must *always* filter in execution, even though it's usually just going to be a no-op. Also, add some documentation of same. RELNOTES: none PiperOrigin-RevId: 184722564
* Always filter resources by density in executionGravatar Googler2018-01-04
| | | | | | | | | | | | | | | Newly discovered bugs indicate that density filtering in analysis does not cover all cases. Filter in execution as a workaround for these cases. This will let us turn resource filtering in analysis on and avoid these bugs. (I will work on actually fixing these bugs in parallel.) Non-density filtering already runs in execution, even when already filtering in analysis, due to known limitations of filtering in analysis. (Specifically, aapt filters more strictly than android_ide_common, and also needs the resource filters passed anyway to generate pseudolocalized resources.) RELNOTES: none PiperOrigin-RevId: 180806206
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Infrastructure for fixed checking if android_test can inherit resourcesGravatar Googler2017-12-08
| | | | | RELNOTES: none PiperOrigin-RevId: 178369060
* Never allow local_resource_files in single-process testsGravatar Googler2017-11-27
| | | | | RELNOTES: None PiperOrigin-RevId: 177048616
* 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
* Support for local_resource_files in android_testGravatar Googler2017-09-13
| | | | | RELNOTES: none PiperOrigin-RevId: 168444499
* Save density information to manifests when filtering resources in analysisGravatar Googler2017-08-30
| | | | | | | | | | | Previously, when filtering in analysis, density information was not passed to execution to avoid wasting time on re-filtering. However, that density information was also used to add information to the manifest. Add an additional flag to save density information to the manifest without triggering resource filtering in execution, and use it when filtering in analysis. RELNOTES: None PiperOrigin-RevId: 166891827
* Adds compile action for aapt2: Aapt2ResourcePackagingActionGravatar corysmith2017-08-23
| | | | | | | | Adds a ManifestContainer interface to centralize the types that provide manifests. Adds PackagedResources to represent a linked dexless resource apk RELNOTES: None PiperOrigin-RevId: 166193049
* Stop reporting manifest merge errors as exceptions with stack traces as well ↵Gravatar apell2017-07-24
| | | | | | | as printing the merge error report. The stack traces duplicated the error report and gave the impression that the error may be an internal error instead of a build error. RELNOTES: None. PiperOrigin-RevId: 162755827
* 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
* 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
* Remove some more usages of res2.MergingException and open source some tests.Gravatar ajmichael2017-05-05
| | | | | | | Since https://github.com/bazelbuild/bazel/issues/2709 was fixed, this CL also enables ParsedAndroidDataTest. RELNOTES: None PiperOrigin-RevId: 155155095
* 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
* 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
* Add parameter files to the android resource processing.Gravatar Googler2017-01-26
| | | | | | -- PiperOrigin-RevId: 145686107 MOS_MIGRATED_REVID=145686107
* Rename symbolsTxt to symbols reflecting it's actual usage.Gravatar Googler2017-01-18
| | | | | | -- PiperOrigin-RevId: 144741831 MOS_MIGRATED_REVID=144741831
* 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 a resource validator action for android_libraryGravatar Googler2016-08-30
| | | | | | | | | | | | | | | | | | Part 3 of the 3 new proposed android_library res processing actions. Pulls a zip file from the merging action, unpacks it, and then validates the results with aapt. Get an R.txt and srcjar w/ javadocs from aapt. In order to the get the R.txt, I think you need to ask for the R.java sources anyway. Split the processResources() into a runAapt() function that can be reused. Hookup in bazel coming separately. -- MOS_MIGRATED_REVID=131618410
* 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
* 5 of 5: Integrate with the AndroidResourceProcessorGravatar Googler2016-07-21
| | | | | -- MOS_MIGRATED_REVID=128074515
* Enhance AndroidResourceProcessingAction's split detection.Gravatar Michael Staib2016-07-08
| | | | | | | | | | | | | | The --splits flag is now --split, since I remembered about how allowMultiple exists. More importantly, split APKs are now correctly moved to filenames which are fairly trivially constructed from the input split flags, allowing Bazel to just do a simple one-character replace on the split flags and know what files the resource processing action is going to output. One more step in the quest for world domination, or rather, split APKs for resources. Next: Actually supporting this in android_binary. -- MOS_MIGRATED_REVID=126838431
* Adds the Android manifest merger as an option for android_binary rules. The ↵Gravatar Andrew Pellegrini2016-06-23
| | | | | | | | | merger that is used (legacy or android) is controlled by the manifest_merger attribute on android_binary and the default is controlled by the --android_manifest_merger flag. RELNOTES: The Android manifest merger is now available as an option for android_binary rules. The merger will honor tools annotations in AndroidManifest.xml and will perform placeholder substitutions using the values specified in android_binary.manifest_values. The merger may be selected by setting the manifest_merger attribute on android_binary. -- MOS_MIGRATED_REVID=125603954
* 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
* Add a crunch_png attribute to android_binaryGravatar Googler2016-04-18
| | | | | | | | | | | This allows a user to turn off png crunching during the final merge (with crunch_png = 0), but it does not skip nine-patch processing. RELNOTES: adds crunch_png attribute to android_binary -- MOS_MIGRATED_REVID=119986498
* Adds ResourceShrinkerAction to android_binary targets if they use Proguard ↵Gravatar Andrew Pellegrini2016-03-08
| | | | | | | | | and specify --experimental_android_resource_shrinking on the command line. RELNOTES: Specifying --experimental_android_resource_shrinking on the command line will enable a resource shrinking pass on android_binary targets that already use Proguard. -- MOS_MIGRATED_REVID=116572863
* 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
* Add merged resources output generation to AndroidResourceProcessingAction in ↵Gravatar Andrew Pellegrini2016-02-17
| | | | | | | preparation for the ResourceShrinkerAction and move common option flags to AndroidResourceProcessor to prevent duplication in ResourceShrinkerAction. -- MOS_MIGRATED_REVID=114883341
* 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
* Add integration test for AndroidResourceProcessingAction.Gravatar Andrew Pellegrini2016-02-11
| | | | | | | - Changed AndroidResourceProcessingAction to call shutdown() on the thread pool used by AOSP code instead of System.exit() to allow calling the action's main() from inside a test, while maintaining the dangling thread cleanup. -- MOS_MIGRATED_REVID=114459473
* Adds an AaptCommandLineBuilder to simplify the aapt line building process.Gravatar Googler2016-02-11
| | | | | | | Part of this change makes the --no-version-vectors only be propagated if the sdk tools are >= 23. -- MOS_MIGRATED_REVID=114351246
* Adds a build_tools_version attribute to the android_sdk rule so that the androidGravatar Alex Humesky2016-02-10
| | | | | | | build tools version can be used to determine which features to use. -- MOS_MIGRATED_REVID=114225514
* Rollback of commit 40561f0bc889be8c0d90445befe75878ddee717b.Gravatar Googler2016-02-09
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Collect all the temporary directories into one tree that will delete on exit. *** Original change description *** Automated [] rollback of commit 30469a9939c14f8d0d2708bd0a91525a2e161cc4. *** Reason for rollback *** Breaks density filtering. *** Original change description *** Collect all the temporary directories into one tree that will delete on exit. -- MOS_MIGRATED_REVID=114132492
* Rollback of commit 30469a9939c14f8d0d2708bd0a91525a2e161cc4.Gravatar Googler2016-02-09
| | | | | | | | | | | | | *** Reason for rollback *** Breaks density filtering. *** Original change description *** Collect all the temporary directories into one tree that will delete on exit. -- MOS_MIGRATED_REVID=114122848
* Collect all the temporary directories into one tree that will delete on exit.Gravatar Googler2016-02-09
| | | | | -- MOS_MIGRATED_REVID=114115143
* Remove the AndroidBuilder from the processResources call. This allows use moreGravatar Googler2016-02-02
| | | | | | | freedom in generating the command line for aapt. -- MOS_MIGRATED_REVID=113614675