diff options
author | 2016-05-05 16:56:44 +0000 | |
---|---|---|
committer | 2016-05-05 19:10:31 +0000 | |
commit | 2c3119a393b5d32d6de7b5449c54ad57d162aa66 (patch) | |
tree | 91298621004f841d0ed9e66fc67dc45666b380e6 /src/tools | |
parent | 4420971b6c2a1c26966e8b18c7e6f3603cd05b58 (diff) |
4.99 of 5: Cleanup.
Cleans up a few warts from the last few changes.
--
MOS_MIGRATED_REVID=121588557
Diffstat (limited to 'src/tools')
4 files changed, 8 insertions, 30 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidDataSerializer.java b/src/tools/android/java/com/google/devtools/build/android/AndroidDataSerializer.java index 70fbed45db..056909e295 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidDataSerializer.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidDataSerializer.java @@ -178,31 +178,6 @@ public class AndroidDataSerializer { } } - /** Queues the manifest for serialization. */ - @Deprecated - public void serializeManifest(@SuppressWarnings("unused") Path manifest) { - } - - /** Queues the key and value for serialization as a primary entry. */ - @Deprecated - public void serializeToPrimary(DataKey key, DataValue value) { - queueForSerialization(key, value); - } - - /** Queues the key and value for serialization as a transitive entry. */ - @Deprecated - public void serializeToTransitive(DataKey key, DataValue value) { - queueForSerialization(key, value); - } - - @Deprecated - public void read( - Path inPath, - KeyValueConsumers consumers, - @SuppressWarnings("unused") KeyValueConsumers transitiveConsumers) { - read(inPath, consumers); - } - /** Queues the key and value for serialization as a entries entry. */ public void queueForSerialization(DataKey key, DataValue value) { entries.put(key, value); 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 3eeaf818d0..90eb64a293 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 @@ -24,6 +24,7 @@ import com.android.annotations.NonNull; import com.android.annotations.Nullable; import com.android.ide.common.internal.LoggedErrorException; import com.android.ide.common.internal.PngCruncher; +import com.android.ide.common.res2.MergingException; import java.io.File; import java.io.Flushable; @@ -136,7 +137,7 @@ public class AndroidDataWriter implements Flushable, AndroidDataWritingVisitor { @Override public void copyResource(Path source, String relativeDestinationPath) - throws IOException { + throws IOException, MergingException { Path destinationPath = resourceDirectory.resolve(relativeDestinationPath); if (source.getParent().getFileName().toString().startsWith(SdkConstants.DRAWABLE_FOLDER) && source.getFileName().toString().endsWith(SdkConstants.DOT_PNG)) { @@ -144,8 +145,7 @@ public class AndroidDataWriter implements Flushable, AndroidDataWritingVisitor { Files.createDirectories(destinationPath.getParent()); cruncher.crunchPng(source.toFile(), destinationPath.toFile()); } catch (InterruptedException | LoggedErrorException e) { - // TODO(corysmith): Change to a MergingException - throw new RuntimeException(e); + throw new MergingException(e); } } else { copy(source, destinationPath); diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidDataWritingVisitor.java b/src/tools/android/java/com/google/devtools/build/android/AndroidDataWritingVisitor.java index 01c8106afb..ce9b85394d 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidDataWritingVisitor.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidDataWritingVisitor.java @@ -13,6 +13,8 @@ // limitations under the License. package com.google.devtools.build.android; +import com.android.ide.common.res2.MergingException; + import java.io.IOException; import java.nio.file.Path; @@ -40,9 +42,10 @@ public interface AndroidDataWritingVisitor { * @param source The source file to copy. * @param relativeDestinationPath The relative destination path to write the resource to. * @throws IOException if there are errors during copying. + * @throws MergingException for errors during png crunching. */ void copyResource(Path source, String relativeDestinationPath) - throws IOException; + throws IOException, MergingException; /** * Adds a xml string fragment to the values file. diff --git a/src/tools/android/java/com/google/devtools/build/android/FullyQualifiedName.java b/src/tools/android/java/com/google/devtools/build/android/FullyQualifiedName.java index 917a2bb664..1e6deaa4b0 100644 --- a/src/tools/android/java/com/google/devtools/build/android/FullyQualifiedName.java +++ b/src/tools/android/java/com/google/devtools/build/android/FullyQualifiedName.java @@ -279,7 +279,7 @@ public class FullyQualifiedName implements DataKey, Comparable<FullyQualifiedNam * Parses a FullyQualifiedName from a string. * * @param raw A string in the expected format from - * [<package>:]<ResourceType.name>/<resource name>. + * [<package>:]<ResourceType.name>/<resource name>. * @throws IllegalArgumentException when the raw string is not valid qualified name. */ public FullyQualifiedName parse(String raw) { |