diff options
author | Googler <noreply@google.com> | 2016-02-24 16:39:07 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-02-24 18:06:23 +0000 |
commit | 6beaebdfa7ea3d0bcfd58511dbf6f588b206914d (patch) | |
tree | 51f42156185cb44654756e6c9854813a46c11956 /src/tools/android/java/com/google/devtools/build/android/DataResource.java | |
parent | a4a07407c1fdd1108e2747d3120a736d635af902 (diff) |
Part 1 of 5: Optimize the resource merge process, Introductions.
Introduces the AndroidDataSet, a holder for DataResources, that will be the building blocks of the revised merging system.
Also introduces a DataResource implementations:
* FileDataResource, which represent non-value resources. These do not need to derive the resource symbols they provide.
This will replace the current ResourceSet, ResourceMerger, and ResourceMergerWriter with more efficient (e.g. fewer copied files) operations.
--
MOS_MIGRATED_REVID=115455426
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataResource.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/DataResource.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataResource.java b/src/tools/android/java/com/google/devtools/build/android/DataResource.java new file mode 100644 index 0000000000..96d765e110 --- /dev/null +++ b/src/tools/android/java/com/google/devtools/build/android/DataResource.java @@ -0,0 +1,30 @@ +// Copyright 2015 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.android; + +import java.io.IOException; +import java.nio.file.Path; + +/** + * Represents an Android Resource parsed from an xml or binary file. + */ +public interface DataResource { + + /** + * Writes the resource to the given resource directory. + * @param newResourceDirectory The new directory for this resource. + * @throws IOException if there are issues with writing the resource. + */ + void write(Path newResourceDirectory) throws IOException; +} |