diff options
author | Googler <noreply@google.com> | 2016-10-25 15:25:09 +0000 |
---|---|---|
committer | John Cater <jcater@google.com> | 2016-10-25 20:19:14 +0000 |
commit | 7260f0a2c69bfe0fec187099fcea2dd16c331729 (patch) | |
tree | bab73491fda9476815de0aa1ff80a591041306b9 /src/tools/android/java/com/google/devtools/build/android/DataValueFile.java | |
parent | d1f4a167f8080d460dd532eb83b87ab0d0eb4f86 (diff) |
Wrap the source Path in a DataSource object.
The DataSource object will then be used to track which values have been
overwritten and avoid incorrect merge warnings.
--
MOS_MIGRATED_REVID=137159260
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataValueFile.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/DataValueFile.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataValueFile.java b/src/tools/android/java/com/google/devtools/build/android/DataValueFile.java index b2166f3c16..a54c8ef6da 100644 --- a/src/tools/android/java/com/google/devtools/build/android/DataValueFile.java +++ b/src/tools/android/java/com/google/devtools/build/android/DataValueFile.java @@ -29,16 +29,19 @@ import java.util.Objects; */ public class DataValueFile implements DataResource, DataAsset { - private final Path source; + private final DataSource source; - private DataValueFile(Path source) { + private DataValueFile(DataSource source) { this.source = source; } public static DataValueFile of(Path source) { - return new DataValueFile(source); + return of(DataSource.of(source)); } + public static DataValueFile of(DataSource source) { + return new DataValueFile(source); + } /** * Creates a {@link DataValueFile} from a {@link SerializeFormat.DataValue}. */ @@ -66,20 +69,20 @@ public class DataValueFile implements DataResource, DataAsset { } @Override - public Path source() { + public DataSource source() { return source; } @Override public void writeAsset(RelativeAssetPath key, AndroidDataWritingVisitor mergedDataWriter) throws IOException { - mergedDataWriter.copyAsset(source, key.toPathString()); + mergedDataWriter.copyAsset(source.getPath(), key.toPathString()); } @Override public void writeResource(FullyQualifiedName key, AndroidDataWritingVisitor mergedDataWriter) throws IOException, MergingException { - mergedDataWriter.copyResource(source, key.toPathString(source)); + mergedDataWriter.copyResource(source.getPath(), key.toPathString(source.getPath())); } @Override |