diff options
author | 2016-04-19 22:07:47 +0000 | |
---|---|---|
committer | 2016-04-20 11:17:11 +0000 | |
commit | 66cf13874a3c8f866aeace2d59231e30ca4a5032 (patch) | |
tree | e926e87be0c3f8ff8322cd2be20e5a534085010f /src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java | |
parent | 9b35d8a81b0d5cb92a22e7d9c7bf30a834711d7f (diff) |
4 of 5: Serialization of UnwrittenMergedAndroidData.
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
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java b/src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java index b954aff3bc..c025871aad 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidDataWriter.java @@ -88,10 +88,10 @@ public class AndroidDataWriter implements Flushable, AndroidDataWritingVisitor { public void flush() throws IOException { Path values = Files.createDirectories(resourceDirectory().resolve("values")); try (FileChannel channel = - FileChannel.open( - values.resolve("values.xml"), - StandardOpenOption.CREATE_NEW, - StandardOpenOption.WRITE)) { + FileChannel.open( + values.resolve("values.xml"), + StandardOpenOption.CREATE_NEW, + StandardOpenOption.WRITE)) { channel.write(ByteBuffer.wrap("<resources>".getBytes(UTF_8))); for (FullyQualifiedName key : Ordering.natural().sortedCopy(valueFragments.keySet())) { for (String line : valueFragments.get(key)) { |