aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AndroidDataWritingVisitor.java
Commit message (Collapse)AuthorAge
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-02
| | | | PiperOrigin-RevId: 195100125
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* 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
* 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
* 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
* 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
* 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