aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/xml
Commit message (Collapse)AuthorAge
* Set Locale to English when uppercasing strings to match EnumsGravatar Jingwen Chen2018-05-11
| | | | | | | | | | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/5157 If a user's default system locale is not `en`, `en_US` or `en_UK`, there may be a chance that `String#toUpperCase` will result in a string that does not exist in the Enum declaration. This is the case in #5157. To fix this, it's either 1) setting the Locale in the individual `toUpperCase` calls or 2) set Locale to English by default from `Bazel.java`. I chose the first because it seemed less intrusive, but I'm open to suggestions. Closes #5184. PiperOrigin-RevId: 196261078
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195094385
* Remove use of bare Immutable{List,Map,Set} Builder classes.Gravatar jcater2018-04-20
| | | | | | Always use the more-qualified class name for clarity at the site of use. There are too many classes named Builder. PiperOrigin-RevId: 193649193
* Update ApkSubject to use the AndroidCompiledDataDeserializer for proto apks.Gravatar corysmith2018-04-19
| | | | | | | Minor fixes to the AndroidCompiledDataDeserializer RELNOTES: None PiperOrigin-RevId: 193535766
* Automated rollback of commit e8bed799d59526541afa2a0e9ef5d4c49e3ba390.Gravatar corysmith2018-04-03
| | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with improved handling and testing for Styleables, and correct package management. *** Original change description *** Automated rollback of commit a76f7db51a90cc2e35c1d66782056c310729eef0. *** Reason for rollback *** Breaks Kix. *** Original change description *** Modify the .flat decompilation to account for multiple configurations by converting the aapt2 proto ConfigValue to a FolderConfiguration. Adds new aapt2 compiled deserialization test. RELNOTES: None PiperOrigin-RevId: 191444658
* 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
* Fix parsing for public.xml file when using aapt2.Gravatar Googler2018-01-16
| | | | | RELNOTES: none PiperOrigin-RevId: 182110722
* Fix parsing for some aapt2-generated resources.Gravatar Googler2018-01-10
| | | | | RELNOTES: none PiperOrigin-RevId: 181506851
* Use assets from the resource APK for resource shrinking rather than from the ↵Gravatar Googler2017-12-20
| | | | | | | merge actions. RELNOTES: none PiperOrigin-RevId: 179695515
* Automated rollback of commit 70c2be189c9c0021f7c424c7399f8bdecc579b4e.Gravatar Googler2017-12-15
| | | | | | | | | | | | | *** Reason for rollback *** Broke some cakemix tap projects *** Original change description *** Use assets from the APK for resource shrinking rather than from the merge actions. RELNOTES: none PiperOrigin-RevId: 179252805
* Use assets from the APK for resource shrinking rather than from the merge ↵Gravatar Googler2017-12-15
| | | | | | | actions. RELNOTES: none PiperOrigin-RevId: 179227857
* Create merge action and data deserializer for aapt2 compiled resources.Gravatar Googler2017-11-15
| | | | | RELNOTES: None PiperOrigin-RevId: 175858467
* Validate and Link libraries action for aapt2Gravatar corysmith2017-08-14
| | | | | RELNOTES: None PiperOrigin-RevId: 165012084
* Fix bug with combining resource attributes. Attributes were reporting that ↵Gravatar apell2017-05-26
| | | | | | | they were over-writable in all cases instead of differentiating by attribute type. RELNOTES: None. PiperOrigin-RevId: 156999284
* 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
* Allow combining of resources attributes that can be comma-separated lists. ↵Gravatar apell2017-04-11
| | | | | | | This is not exhaustive of all combinable attributes, but of those that have common uses. More combinable attributes can be added by adding to ResourcesAttribute.AttributeType. RELNOTES: None. PiperOrigin-RevId: 152694650
* Improve the error message for simple values by including the value.Gravatar Googler2017-03-31
| | | | | | RELNOTES: None PiperOrigin-RevId: 151630049
* Global cleanup change.Gravatar Liam Miller-Cushon2017-03-14
| | | | | | -- PiperOrigin-RevId: 150020373 MOS_MIGRATED_REVID=150020373
* Add <resources> attribute processing to the Android resource processing ↵Gravatar Andrew Pellegrini2017-03-14
| | | | | | | | toolchain. -- PiperOrigin-RevId: 149963021 MOS_MIGRATED_REVID=149963021
* 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
* Global cleanup change.Gravatar Googler2016-10-05
| | | | | -- MOS_MIGRATED_REVID=135162284
* 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
* 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
* 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
* 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
* * Clean up of the old Iterable<String> method of writing xmlGravatar Googler2016-07-01
| | | | | | | * Add in some line breaks for easier to read output. -- MOS_MIGRATED_REVID=126315204
* Fixes the case where an optional attribute needs to be an empty string. This ↵Gravatar Googler2016-07-01
| | | | | | | | | is necessary for <style parent="">. The previous code omitted empty strings to avoid the <attr format=""> case which is an error for aapt. -- MOS_MIGRATED_REVID=126305040
* 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 0de6a93fcc4fd6304936165b07963c4d722c44be.Gravatar Philipp Wollermann2016-06-23
| | | | | | | | | | | *** Reason for rollback *** This breaks the Bazel build because "putMappedXmlValue" does not exist. See: http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=linux-x86_64/616/console -- MOS_MIGRATED_REVID=125671091
* Global cleanup change.Gravatar Googler2016-06-23
| | | | | -- MOS_MIGRATED_REVID=125574484
* 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
* Renaming nonOverwriting to combining resources.Gravatar Googler2016-05-10
| | | | | -- MOS_MIGRATED_REVID=121863653
* 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
* Fix the java compile for non-compatible type inference between java 7 and 8.Gravatar Googler2016-04-07
| | | | | -- MOS_MIGRATED_REVID=119116506
* 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
* Fix the comment formatting.Gravatar Googler2016-03-08
| | | | | -- MOS_MIGRATED_REVID=116560331
* 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