diff options
author | Googler <noreply@google.com> | 2016-10-06 20:21:56 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-10-07 08:08:04 +0000 |
commit | 4f005551b52083f1e8995f799d4dc8a690604d95 (patch) | |
tree | dd015311f1d71cefa7b7dbd2fe52fbfd2927fb2b /src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java | |
parent | 69d9b417534aae71728c5f6bcc67fe44bb4e4241 (diff) |
Update android_ide_common to 25.0.0 and clean up FolderConfigs
Older android_ide_common does not handle BCP 47,
so we update the code to handle that and remove
most of the workarounds. This also pulls in a
fix for 3-letter locales, unblocks resource
shrinking whitelisting, etc.
--
MOS_MIGRATED_REVID=135396457
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java b/src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java index b3c6747640..df4f899d34 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java +++ b/src/tools/android/java/com/google/devtools/build/android/AaptCommandBuilder.java @@ -13,17 +13,14 @@ // limitations under the License. package com.google.devtools.build.android; +import com.android.builder.core.VariantType; +import com.android.repository.Revision; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; - -import com.android.builder.core.VariantConfiguration.Type; -import com.android.sdklib.repository.FullRevision; - import java.nio.file.Path; import java.util.Collection; import java.util.List; - import javax.annotation.Nullable; /** @@ -32,15 +29,15 @@ import javax.annotation.Nullable; */ class AaptCommandBuilder { private final ImmutableList.Builder<String> flags = new ImmutableList.Builder<>(); - private FullRevision buildToolsVersion; - private Type variantType; + private Revision buildToolsVersion; + private VariantType variantType; public AaptCommandBuilder(Path aapt) { flags.add(aapt.toString()); } /** Sets the build tools version to be used for {@link #whenVersionIsAtLeast}. */ - AaptCommandBuilder forBuildToolsVersion(@Nullable FullRevision buildToolsVersion) { + AaptCommandBuilder forBuildToolsVersion(@Nullable Revision buildToolsVersion) { Preconditions.checkState( this.buildToolsVersion == null, "A build tools version was already specified."); this.buildToolsVersion = buildToolsVersion; @@ -48,7 +45,7 @@ class AaptCommandBuilder { } /** Sets the variant type to be used for {@link #whenVariantIs}. */ - AaptCommandBuilder forVariantType(Type variantType) { + AaptCommandBuilder forVariantType(VariantType variantType) { Preconditions.checkNotNull(variantType); Preconditions.checkState(this.variantType == null, "A variant type was already specified."); this.variantType = variantType; @@ -117,16 +114,16 @@ class AaptCommandBuilder { } /** Adds the next flag to the builder only if the variant type is the passed-in type. */ - public ConditionalAaptCommandBuilder whenVariantIs(Type type) { - Preconditions.checkNotNull(type); - return when(variantType == type); + public ConditionalAaptCommandBuilder whenVariantIs(VariantType variantType) { + Preconditions.checkNotNull(variantType); + return when(this.variantType == variantType); } /** * Adds the next flag to the builder only if the build tools version is unspecified or is * greater than or equal to the given version. */ - public ConditionalAaptCommandBuilder whenVersionIsAtLeast(FullRevision requiredVersion) { + public ConditionalAaptCommandBuilder whenVersionIsAtLeast(Revision requiredVersion) { Preconditions.checkNotNull(requiredVersion); return when(buildToolsVersion == null || buildToolsVersion.compareTo(requiredVersion) >= 0); } |