aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/DataValueFile.java
Commit message (Collapse)AuthorAge
* 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
* Remove unused DataKey attribute.Gravatar corysmith2018-02-15
| | | | | RELNOTES: None PiperOrigin-RevId: 185847904
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Fix bug where merge conflicts for resources defined in XML with equal values ↵Gravatar Googler2017-07-13
| | | | | | | were being falsely logged during build as warnings RELNOTES: none PiperOrigin-RevId: 161723206
* Further Refactoring/Yak ShavingGravatar corysmith2017-05-15
| | | | | | | | | * Extract the FieldInitializer with placeholder ids from the AndroidResourceClassWriter * Extract a resource sink interface from the AndroidResourceClassWriter (a little renaming, the change isn't actually that big.) RELNOTES: None PiperOrigin-RevId: 156053478
* Remove MergingExceptionGravatar corysmith2017-05-04
| | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/2709 RELNOTES: None. PiperOrigin-RevId: 155097576
* Improve the error message for simple values by including the value.Gravatar Googler2017-03-31
| | | | | | RELNOTES: None PiperOrigin-RevId: 151630049
* DataSource FixesGravatar Googler2017-03-28
| | | | | | | | | | * Fix the overwrite algorithm to be handled entirely in the accumulators. * Improve the conflict error messages for attributes and simple values. * Refactor the UnwrittenDataSubject to top level for reuse. -- PiperOrigin-RevId: 151439084 MOS_MIGRATED_REVID=151439084
* Cleanup unthrown exceptions.Gravatar Googler2017-01-13
| | | | | | -- PiperOrigin-RevId: 144360540 MOS_MIGRATED_REVID=144360540
* 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
* Share source paths for more compact res proto serializationGravatar Googler2016-08-17
| | | | | | | | | | | | | | | | | | | | | | | Source abs paths can be pretty long. If a value file like colors.xml has N resources then we serialize the path N times. Instead, make a table and just serialize the index. Can reduce resource proto sizes from X to 0.65*X. in some experiments. CPU instructions executed is slightly lower, but critical path impact is pretty minimal since parsing happens in parallel anyway. This doesn't help with drawables (path only shows up once) but doesn't really hurt (an extra index number). I tried sharing the root (a table of the res dirs). That can be another 10%, and helps with the drawable case. However, a naive enumeration of roots (src.getParent().getParent()) added *much* more overhead to the writing stage, so I didn't go on with that. -- MOS_MIGRATED_REVID=130440810
* Add a resource merger state -> R class writer.Gravatar Googler2016-07-22
| | | | | | | | | | | | | | | | Collects the R class fields from the new merger's internal state, and then writes out either an R.java or R.class. TBD which to use. One concern is that users may want the javadoc. If so, perhaps this could generate the R.class, and then aapt could generate the srcjar off of the build critical path. Refactor the RClassGenerator to make it easier to use from merger state (vs from R.txt). -- MOS_MIGRATED_REVID=128181306
* Remove .9 from nine-patch FullyQualifiedNamesGravatar Googler2016-07-07
| | | | | | | | | | | | | | | | In the end, foo.9.png should result in an R.java field R.drawable.foo (not R.drawable.foo_9). Also, given foo.9.png and foo.png, aapt will give an error: res/drawable/foo.png:0: error: Resource entry foo is already defined. res/drawable/foo.9.png:0: Originally defined here. So it seems like we should generate a merge conflict warning as well. Adjust FQN accordingly. -- MOS_MIGRATED_REVID=126693820
* 4.99 of 5: Fix styleable combining.Gravatar Googler2016-05-10
| | | | | | | Changes non-overwriting resources (id and styleable) to combine on duplication. This change ignores the issue of multiple sources, which will be addressed in a later cl. -- MOS_MIGRATED_REVID=121840285
* 4.8 of 5: Xml Fixes for Merger IntegrationGravatar Googler2016-05-04
| | | | | | | | | | | | | | * SimpleXmlResourceValue records all attributes except name. (I'd like to toss description, just as soon as I know I can -- bloats the serialized form.) * Added handling for <item> to SimpleXmlResourceValue: this can be used as placeholders, or (apparently) mostly unvalidated value definitions. * drawable can be used to put in colored backgrounds in a values.xml * Strings, Plurals, need to read sub tags such as xliff as string * <eat-comment/> and <skip/> need to be handled: we ignore them as all comments are eaten right now; and skip appears to be for localization diffs * xml parser must be resilient to random characters in resources defined in values. * Handles the <resource> not <resources> coding mistake gracefully. * Supports a <public> declaration. This feature is more wildly used than the nonexistant documentation suggests. -- MOS_MIGRATED_REVID=121490019
* 4 of 5: Serialization of UnwrittenMergedAndroidData.Gravatar Googler2016-04-20
| | | | | | | | | | | Adding AndroidDataSerializer, the serialize_format proto, and KeyValueConsumers (utility class for keeping consumers straight). The serializtion is a bit more manual as previous experience has proven to me that simply writing all the resources into a proto map and pulling them out is not performant in the least. So, the serializer stores each message independent, the keys and then the values allowing for potential lazy loading and other optimizations in the future. Also adds tests for parsing and writing style resources. -- MOS_MIGRATED_REVID=120274904
* 4.25 of 5: Writing of UnwrittenMergedAndroidDataGravatar Googler2016-04-07
| | | | | | | | | | | Introduces the AndroidDataWriter and AndroidDataWritingVisitor to abstract the io operations from the data classes. Necessary refactoring to the stubbed write method on DataValue in DataAsset.writeAsset and DataResource.writeResource. New interface for the AttributeValues to reflect the simplifications of writing Resource Attributes. Of special note is the fact all xml is written into a single file, values.xml. This is following the Gradle convention and aapt has demonstrated a preference of only reading a values.xml and ignoring all other xml files in the values directory. Unless profiling demonstrates an advantage to writing multiple files (which I doubt), this merger carries on this convention. -- MOS_MIGRATED_REVID=119066611
* 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