aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AndroidDataMerger.java
Commit message (Collapse)AuthorAge
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195100125
* Create asset merging actionGravatar asteinb2018-04-16
| | | | | | | | | | | | This action is a trimmed-down version of the resource merging action (no resources or manifests). Also, create a base class to collect boilerplate action code, and a new Exception to indicate that we should exit an action immediately (rather than throw and print the stack trace). RELNOTES: none PiperOrigin-RevId: 193054422
* Don't check contents of conflicting compiled resourcesGravatar asteinb2018-03-07
| | | | | | | | Until we properly support checking the contents of these files, don't try to do so. RELNOTES: none PiperOrigin-RevId: 188192286
* Split the conflict message reporting from the merging.Gravatar corysmith2018-02-13
| | | | | RELNOTES:None PiperOrigin-RevId: 185553306
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Create merge action and data deserializer for aapt2 compiled resources.Gravatar Googler2017-11-15
| | | | | RELNOTES: None PiperOrigin-RevId: 175858467
* Automated rollback of commit 3181c2f1362622985aca24747ed9512573d25dc0.Gravatar corysmith2017-11-06
| | | | | RELNOTES: None PiperOrigin-RevId: 174502289
* Simplify the merge code, and fix a few incorrectly declared tests.Gravatar corysmith2017-11-06
| | | | | RELNOTES: None PiperOrigin-RevId: 174485947
* Change the KeyValueConsumer to extend BiConsumer for improved consumer usage.Gravatar corysmith2017-10-20
| | | | | RELNOTES: None PiperOrigin-RevId: 172754760
* Add flag to turn Android resource merge conflicts from warnings into errorsGravatar Googler2017-07-14
| | | | | RELNOTES: none PiperOrigin-RevId: 161831232
* Add a new action for generating reconciled R classes for Robolectric.Gravatar corysmith2017-05-23
| | | | | | | | | This includes some refactoring: * Move the symbol deserialization our of the merger and into the ParsedAndroidData (probably move again.) * Change the FailedFutureAggregator generics to work more callables RELNOTES: None PiperOrigin-RevId: 156863698
* 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
* Split AndroidDataDeserializer out of AndroidDataSerializer, as the two classesGravatar Googler2017-03-14
| | | | | | | | do different (if similar) things and had no common code whatsoever. -- PiperOrigin-RevId: 149942714 MOS_MIGRATED_REVID=149942714
* unknown commit of 5: Fixing the merge warning messages in transitive library ↵Gravatar Googler2016-12-01
| | | | | | | | | overwrites. Record the sources are overwritten during merging. -- MOS_MIGRATED_REVID=140654137
* Wrap the source Path in a DataSource object.Gravatar Googler2016-10-25
| | | | | | | | The DataSource object will then be used to track which values have been overwritten and avoid incorrect merge warnings. -- MOS_MIGRATED_REVID=137159260
* 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 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
* Flip on @+id parsing by defaultGravatar Googler2016-08-22
| | | | | | | | | | | | | | | | | Avoid writing the non-values IdXmlResourceValues to the merged values.xml file. It's redundant since the merged resources will include the src layout / menu, etc. file. E.g., adds 25KB out of 250KB to some merged values.xml. It can also change the way R.fields are initialized (ids from values.xml are numbered before other sources), that would have changed the numbering in AndroidIntegratinoTest#testAndroidBinaryResourceShrinking and in AndroidResourceClassWriterAaptTest. -- MOS_MIGRATED_REVID=130789333
* Turn down deprecation warning.Gravatar Googler2016-07-22
| | | | | -- MOS_MIGRATED_REVID=128202272
* Parse layout/menu/drawable, etc XML files for R.idGravatar Googler2016-07-04
| | | | | | | | | | | | | | | | | To be used by a later CL where we use this more complete picture of all the resource items to generate our own R.java/class without invoking AAPT (and split out AAPT to a separate action that is off the java builder critical path). Technically aapt creates R.id.foo for attr <enum name="foo" ... /> and flag as well, but I haven't seen code that actually relies on that. Currently off-by-default (only exercised by tests). -- MOS_MIGRATED_REVID=126407838
* Fix for combining resources so that the transitive, direct, and primary ↵Gravatar Googler2016-05-17
| | | | | | | | | | | | | | | | resources are combined for the primary writing. Example: transitive resource: styleable/RubADubDub has an attr of butcher direct resource: styleable/RubADubDub has an attr of baker primary resource: styleable/RubADubDub has an attr of candlestickmaker The merged resources should have: transitive resource: <no matching key> primary resource: styleable/RubADubDub has attrs of butcher, baker, candlestickmaker -- MOS_MIGRATED_REVID=122453026
* Speed Optimizations:Gravatar Googler2016-05-16
| | | | | | | | | * Adds threading to the AndroidDataWriter and AndroidDataSerializer. * Changes to a BufferedWriter for the Writer (turns out it's faster for string writing.) * Added buffers to the serializer reading. -- MOS_MIGRATED_REVID=122280993
* Renaming nonOverwriting to combining resources.Gravatar Googler2016-05-10
| | | | | -- MOS_MIGRATED_REVID=121863653
* 4.95 of 5: Merger changesGravatar Googler2016-05-05
| | | | | | | | | * Merge conflicts are now bright red warnings, as the previous merger was simultaneously stricter and looser than expected. * Legacy resource rules are now detected and cause bright red warnings. * Merge conflicts will test for equality either of file contents or parsed xml -- MOS_MIGRATED_REVID=121510152
* 3.75 of 5: Renaming classes and interfacesGravatar Googler2016-03-31
| | | | | | | | | | | | AndroidDataSet becomes ParsedAndroidData, reflecting the placement in the current AndroidData lifecycle: UnvalidatedAndroidData -> ParsedAndroidData -> UnwrittenMergedAndroidData -> MergeAndroidData -> DensityFilteredAndroidData -> DependencyAndroidData DataResourceFile becomes DataValueFile reflecting it's dual roles of DataAsset and DataResource. XmlDataResource becomes DataResourceXml for consistancy. -- MOS_MIGRATED_REVID=118689441
* 3.73 of 5: Convert xml parsing to use the map based storageGravatar Googler2016-03-30
| | | | | | | | | Introduces two new interfaces: DataValue, which compliments DataKey and allows a cleaner interface MergeConflict AndroidDataSet.KeyValueConsumer, abstraction that allows a common interface for consuming parsed resources, which is a lot cleanr for DataValue as well. -- MOS_MIGRATED_REVID=118466739
* 3.71: Remove ResourceMap, Fix testsGravatar Googler2016-03-25
| | | | | | | | | | Removes ResourceMap from AndroidDataSet, now the merge operates directly on the AndroidDataSet instances. Change tests to use Map<DataKey, Data?> instead of List<Data?>. Add tests for finding conflicts during AndroidDataSet creation. Make MergeConflict more test friendly by sorting Paths on creation. -- MOS_MIGRATED_REVID=118240635
* 3.7 of 5: Refactoring ResourceMap generation.Gravatar Googler2016-03-25
| | | | | | | | | The end goal is to remove ResourceMap and separate the DataKey from the DataResource and DataAsset. This moves the resource map to AndroidDataSet and switches the generation to the Resource and Asset visitors. Which is nice, because it removes a traversal of the overwritable resources and assets. -- MOS_MIGRATED_REVID=118071238
* Part 3.5 of 5: AssetsGravatar Googler2016-03-25
| | | | | | | Adds support for parsing and merging assets. This introduces the DataKey and DataAsset interfaces which allow reuse of the FileDataResource for assets, the RelativeAssetPath which acts as a DataKey for assets (the relative asset path is the path that the asset will reside inside the final apk.) It also extends the AndroidDataSetBuilder to handle the creation of assets, and cleans up the interface a little. -- MOS_MIGRATED_REVID=118060379
* Part 3 of 5: Merging semantics.Gravatar Googler2016-03-18
Introduces the AndroidDataMerger, MergeConflict, and UnwrittenMergedAndroidData which is the entry point in the AndroidResourceProcessing *AndroidData lifecycle. Also, refactors the AndroidDataSet parsing of resources, making it functionally immutable. -- MOS_MIGRATED_REVID=117492690