diff options
author | 2016-05-09 15:52:27 +0000 | |
---|---|---|
committer | 2016-05-10 07:55:57 +0000 | |
commit | 925fd546efd612bdaab7187404f15a2771fff46d (patch) | |
tree | a58f3ba20c39b4268a027ace6f8d0b1598c29035 /src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java | |
parent | ec2657fbbc0a360ef52cef2496e25cdf967aaf92 (diff) |
4.99 of 5: Fix styleable combining.
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
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java b/src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java index f4e4f814fc..86223b2519 100644 --- a/src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java +++ b/src/tools/android/java/com/google/devtools/build/android/DataResourceXml.java @@ -244,4 +244,16 @@ public class DataResourceXml implements DataResource { public int serializeTo(DataKey key, OutputStream outStream) throws IOException { return xml.serializeTo(source, outStream); } + + // TODO(corysmith): Clean up all the casting. The type structure is unclean. + @Override + public DataResource combineWith(DataResource resource) { + if (!(resource instanceof DataResourceXml)) { + throw new IllegalArgumentException(resource + " is not a combinable with " + this); + } + DataResourceXml xmlResource = (DataResourceXml) resource; + // TODO(corysmith): Combine the sources so that we know both of the originating files. + // For right now, use the current source. + return of(source, xml.combineWith(xmlResource.xml)); + } } |