diff options
author | asteinb <asteinb@google.com> | 2018-08-08 10:27:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-08 10:29:05 -0700 |
commit | 85a96b38b6d6674bd9e797955201f33408b501f3 (patch) | |
tree | 075ba4291d09c1dad0811bc80a4d87557a976882 /src/main/java/com/google/devtools/build/lib/rules | |
parent | 0f232691719ef89a0a1c7be631a84f435894a6ce (diff) |
Remove CompiledMergeableAndroidData
This was also just shared between ParsedAndroidResources and the now defunct
ResourceContainer
RELNOTES: none
PiperOrigin-RevId: 207907140
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
4 files changed, 12 insertions, 50 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java index 055990bebd..650d39cada 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceMergingActionBuilder.java @@ -34,17 +34,16 @@ public class AndroidResourceMergingActionBuilder { AndroidDataConverter.MERGABLE_DATA_CONVERTER; @AutoCodec @AutoCodec.VisibleForSerialization - static final AndroidDataConverter<CompiledMergableAndroidData> - RESOURCE_CONTAINER_TO_ARG_FOR_COMPILED = - AndroidDataConverter.<CompiledMergableAndroidData>builder(JoinerType.SEMICOLON_AMPERSAND) - .withRoots(CompiledMergableAndroidData::getResourceRoots) - .withRoots(CompiledMergableAndroidData::getAssetRoots) - .withLabel(CompiledMergableAndroidData::getLabel) - .withArtifact(CompiledMergableAndroidData::getCompiledSymbols) - .build(); + static final AndroidDataConverter<ParsedAndroidResources> RESOURCE_CONTAINER_TO_ARG_FOR_COMPILED = + AndroidDataConverter.<ParsedAndroidResources>builder(JoinerType.SEMICOLON_AMPERSAND) + .withRoots(ParsedAndroidResources::getResourceRoots) + .withRoots(ParsedAndroidResources::getAssetRoots) + .withLabel(ParsedAndroidResources::getLabel) + .withArtifact(ParsedAndroidResources::getCompiledSymbols) + .build(); // Inputs - private CompiledMergableAndroidData primary; + private ParsedAndroidResources primary; private ResourceDependencies dependencies; // Outputs @@ -62,7 +61,7 @@ public class AndroidResourceMergingActionBuilder { * The primary resource for merging. This resource will overwrite any resource or data value in * the transitive closure. */ - private AndroidResourceMergingActionBuilder withPrimary(CompiledMergableAndroidData primary) { + private AndroidResourceMergingActionBuilder withPrimary(ParsedAndroidResources primary) { this.primary = primary; return this; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceValidatorActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceValidatorActionBuilder.java index 231a2e1d20..631118d84b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceValidatorActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidResourceValidatorActionBuilder.java @@ -27,7 +27,7 @@ import com.google.devtools.build.lib.rules.android.AndroidConfiguration.AndroidA public class AndroidResourceValidatorActionBuilder { // Inputs - private CompiledMergableAndroidData primary; + private ParsedAndroidResources primary; private Artifact mergedResources; // Outputs @@ -50,7 +50,7 @@ public class AndroidResourceValidatorActionBuilder { } /** The primary resource container. We mostly propagate its values, but update the R.txt. */ - private AndroidResourceValidatorActionBuilder withPrimary(CompiledMergableAndroidData primary) { + private AndroidResourceValidatorActionBuilder withPrimary(ParsedAndroidResources primary) { this.primary = primary; return this; } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/CompiledMergableAndroidData.java b/src/main/java/com/google/devtools/build/lib/rules/android/CompiledMergableAndroidData.java deleted file mode 100644 index e931db4780..0000000000 --- a/src/main/java/com/google/devtools/build/lib/rules/android/CompiledMergableAndroidData.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018 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.lib.rules.android; - -import com.google.devtools.build.lib.actions.Artifact; - -/** - * A {@link MergableAndroidData} that may also contain a compiled symbols file. - * - * <p>TODO(b/76418178): Once resources and assets are completely decoupled and {@link - * ResourceContainer} is removed, this interface can be replaced with {@link ParsedAndroidResources} - */ -public interface CompiledMergableAndroidData extends MergableAndroidData { - Iterable<Artifact> getArtifacts(); - - Artifact getManifest(); - - boolean isManifestExported(); -} diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ParsedAndroidResources.java b/src/main/java/com/google/devtools/build/lib/rules/android/ParsedAndroidResources.java index 501079c72d..f58047cc6e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/ParsedAndroidResources.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/ParsedAndroidResources.java @@ -27,8 +27,7 @@ import java.util.Optional; import javax.annotation.Nullable; /** Wraps parsed (and, if requested, compiled) android resources. */ -public class ParsedAndroidResources extends AndroidResources - implements CompiledMergableAndroidData { +public class ParsedAndroidResources extends AndroidResources implements MergableAndroidData { private final Artifact symbols; @Nullable private final Artifact compiledSymbols; private final Label label; @@ -111,33 +110,27 @@ public class ParsedAndroidResources extends AndroidResources this.dataBindingContext = dataBindingContext; } - @Override public Artifact getSymbols() { return symbols; } - @Override @Nullable public Artifact getCompiledSymbols() { return compiledSymbols; } - @Override public Iterable<Artifact> getArtifacts() { return getResources(); } - @Override public Artifact getManifest() { return manifest.getManifest(); } - @Override public boolean isManifestExported() { return manifest.isExported(); } - @Override public Label getLabel() { return label; } |