aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java
Commit message (Collapse)AuthorAge
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195100125
* 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
* 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
* Remove MergingExceptionGravatar corysmith2017-05-04
| | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/2709 RELNOTES: None. PiperOrigin-RevId: 155097576
* 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
* Rollback of commit bd40871283a54268945dcb0c47c0326645ffda18.Gravatar Googler2017-03-24
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with the correct changes to the AndroidResourceMergingAction. Tested manually. *** Original change description *** Automated [] rollback of commit a58f245a4b40c0ef961b1f30d96b16a9349711c3. *** Reason for rollback *** broke over 100k targets, in the depot, see [] *** Original change description *** Move library R generation to a separate action, ensuring the merging happens off the java critical path. -- PiperOrigin-RevId: 151087737 MOS_MIGRATED_REVID=151087737
* Add <resources> attribute processing to the Android resource processing ↵Gravatar Andrew Pellegrini2017-03-14
| | | | | | | | toolchain. -- PiperOrigin-RevId: 149963021 MOS_MIGRATED_REVID=149963021
* Cleanup unthrown exceptions.Gravatar Googler2017-01-13
| | | | | | -- PiperOrigin-RevId: 144360540 MOS_MIGRATED_REVID=144360540
* Delete some dead android rules and tools code.Gravatar Adam Michael2017-01-09
| | | | | | -- PiperOrigin-RevId: 143823562 MOS_MIGRATED_REVID=143823562
* 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
* 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
* * 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
* Creates a fluent api that moves the xml generation into the data writer.Gravatar Googler2016-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new "define" method replaces the now deprecated writeToValuesXml method. This provides three benefits: * An agnostic writing interface to the XmlResourceValue classes, easing the replacement of them with a proper xml writer. * A delayed write which allows the StyleableXmlResourceValue to claim AttrXmlResourceValue definitions before writing. * Centralized method of source attribution, enabling a less verbose way to indicate multiple values came from a single xml source file. An example of the new interface writing the StyleXmlResourceValue: ValuesResourceDefinition definition = mergedDataWriter .define(key) .derivedFrom(source) .startTag("style") .named(key) .optional() .attribute("parent") .setTo(parent) .closeTag(); for (Entry<String, String> entry : values.entrySet()) { definition = definition .startItemTag() .named(entry.getKey()) .close() .addCharactersOf(entry.getValue()) .endTag(); } definition.endTag().save(); -- MOS_MIGRATED_REVID=126196028
* Small fixes:Gravatar Googler2016-06-07
| | | | | | | | * Sort the FullyQualifiedNames during writing for determinism. * Crunch all pngs not in raw -- MOS_MIGRATED_REVID=124245017
* 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
* 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
* 4.99 of 5: Cleanup.Gravatar Googler2016-05-05
| | | | | | | Cleans up a few warts from the last few changes. -- MOS_MIGRATED_REVID=121588557
* 4.9 of 5: Writer fixes for integration.Gravatar Googler2016-05-04
| | | | | | | | | | * Uses the png cruncher for crunching pngs. * Respects qualifiers when generating the values/values.xml. * Improvements to testability. * Standardizes on throwing merging exceptions instead of random IOExceptions. -- MOS_MIGRATED_REVID=121483439
* 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