aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/XmlResourceValues.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
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Change the KeyValueConsumer to extend BiConsumer for improved consumer usage.Gravatar corysmith2017-10-20
| | | | | RELNOTES: None PiperOrigin-RevId: 172754760
* Add support for the <type>/<package>:<name> method of declaring resources.Gravatar corysmith2017-08-30
| | | | | RELNOTES: None PiperOrigin-RevId: 166899690
* Add <resources> attribute processing to the Android resource processing ↵Gravatar Andrew Pellegrini2017-03-14
| | | | | | | | toolchain. -- PiperOrigin-RevId: 149963021 MOS_MIGRATED_REVID=149963021
* 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
* Handle public tags in merger -> R.class writerGravatar Googler2016-08-17
| | | | | | | | | | | | | | | Developers do use public tags, and before this change it would assert in the AndroidResourceClassWriter as an unhandled ResourceType. We probably didn't want to write out a R.public.field anyway. Also, handle public tags with the same name, but different type. They get mapped to the same FQN, so use the combining mechanism to keep track of the different types and ids. -- MOS_MIGRATED_REVID=130395089
* Record and propagate namespaces from the <resources> element correctly.Gravatar Googler2016-07-15
| | | | | | | | | | | * Reduces the size of merged values.xml * Improves correctness of merged xml Sadly, this is also backwards compatible by allowing multiple definitions of a prefix with different namespaces. Will be cleaned up after transition. -- MOS_MIGRATED_REVID=127481147
* * Standardize attribute storage in the protoGravatar Googler2016-07-12
| | | | | | | * Add attributes to PluralXmlResourceValue -- MOS_MIGRATED_REVID=127147486
* Centralize the creation of the XmlInputFactoryGravatar Googler2016-07-12
| | | | | | | | Properly handle unary tags in AttrXmlResourceValue Handle CData for string content. -- MOS_MIGRATED_REVID=127118005
* 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
* Switches XmlResourceValue writing to the "define" api.Gravatar Googler2016-06-30
| | | | | -- MOS_MIGRATED_REVID=126200568
* Record whether the attr is defined or referenced in the styleable. Despite ↵Gravatar Googler2016-06-29
| | | | | | | the functional equality, the definition type of the attribute has direct impact on the order in which the attribute appears in the styleable array. -- MOS_MIGRATED_REVID=126126122
* Stop sanitizing the style parent attribute.Gravatar Googler2016-06-28
| | | | | | | RELNOTES:None -- MOS_MIGRATED_REVID=125989427
* Rollback of commit 5160d196e62bf6f8fa56b32746a01b182729c5c8.Gravatar Googler2016-06-14
| | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with fixed proto call to getMappedStringValue. *** Original change description *** Automated [] rollback of commit 4f854d47888d011354357e965fd3c7bf1d74b95f. *** Reason for rollback *** Breakage: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/601/ *** Original change description *** Xml processing fixes: * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124748547
* Rollback of commit 4f854d47888d011354357e965fd3c7bf1d74b95f.Gravatar Yue Gan2016-06-13
| | | | | | | | | | | | | | | | *** Reason for rollback *** Breakage: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/601/ *** Original change description *** Xml processing fixes: * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124708349
* Xml processing fixes:Gravatar Googler2016-06-13
| | | | | | | | | * Support for <item name="foo" type="id">7x0000</item> * Adds <eat-comment/> after source attributions to ensure they are not sent to the final binary * Store attributes for arrays to the string translatable=false case -- MOS_MIGRATED_REVID=124684322
* Change the readContentsAsString to use the XMLOutputFactory instead of the ↵Gravatar Googler2016-06-07
| | | | | | | manual writing. -- MOS_MIGRATED_REVID=124243184
* Memory Optimizations:Gravatar Googler2016-05-16
| | | | | | | | * Cache the FullyQualifiedName instances. Due to a very high number of duplicated resource keys, all FullyQualifiedNames should be effectively interned. * Presume xliff in all resources. Inlining the xmlns is a bit costly. -- MOS_MIGRATED_REVID=122375955
* Renaming nonOverwriting to combining resources.Gravatar Googler2016-05-10
| | | | | -- MOS_MIGRATED_REVID=121863653
* 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
* 3.74 of 5: Remove DataKey from DataValue, FileDataResource and XmlDataResource.Gravatar Googler2016-03-30
| | | | | | | This is mostly mechanical, cleaning up the vestigal marks of combining the value and key. The only mildly odd change is making the OverwritableConsumer and NonOverwritableConsumer package visible, for testing purposes. -- MOS_MIGRATED_REVID=118474980
* 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
* Part 2 of 5: Optimize the resource merge process, XmlProcessing.Gravatar Googler2016-03-08
Introduces the XmlDataResource and all the associated cruft that comes with parsing Android Resource value xmls: XmlValues, XmlValue. -- MOS_MIGRATED_REVID=116540181