aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-03-24 03:12:29 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-24 12:19:27 +0000
commit5e1a420f1b385382a2df5359faf3ae773aa8d61e (patch)
tree8736029d0bf4beebaffa46af230ab4834738caa8 /src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java
parent58a615c4941e041d68bceeb68b0d77269f6143f5 (diff)
*** Reason for rollback *** Rolling forward with the correct changes to the AndroidResourceMergingAction. Tested manually. *** Original change description *** Automated [] rollback of commit a58f245a4b40c0ef961b1f30d96b16a9349711c3. *** Reason for rollback *** broke over 100k targets, in the depot, see [] *** Original change description *** Move library R generation to a separate action, ensuring the merging happens off the java critical path. -- PiperOrigin-RevId: 151087737 MOS_MIGRATED_REVID=151087737
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java')
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java
index 836c3855cb..1c9982aecc 100644
--- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java
+++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessor.java
@@ -28,7 +28,6 @@ import com.android.builder.model.AaptOptions;
import com.android.ide.common.internal.CommandLineRunner;
import com.android.ide.common.internal.ExecutorSingleton;
import com.android.ide.common.internal.LoggedErrorException;
-import com.android.ide.common.res2.MergingException;
import com.android.io.FileWrapper;
import com.android.io.StreamException;
import com.android.repository.Revision;
@@ -46,7 +45,6 @@ import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.devtools.build.android.Converters.ExistingPathConverter;
import com.google.devtools.build.android.Converters.RevisionConverter;
-import com.google.devtools.build.android.ParsedAndroidData.Builder;
import com.google.devtools.build.android.SplitConfigurationFilter.UnrecognizedSplitsException;
import com.google.devtools.build.android.resources.RClassGenerator;
import com.google.devtools.common.options.Converters.CommaSeparatedOptionListConverter;
@@ -734,55 +732,4 @@ public class AndroidResourceProcessor {
}
return Files.createDirectories(out);
}
-
- /** Deserializes a list of serialized resource paths to a {@link ParsedAndroidData}. */
- public ParsedAndroidData deserializeSymbolsToData(List<Path> symbolPaths)
- throws IOException, MergingException {
- AndroidDataDeserializer deserializer = AndroidDataDeserializer.create();
- final ListeningExecutorService executorService =
- MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(15));
- final Builder deserializedDataBuilder = ParsedAndroidData.Builder.newBuilder();
- try (Closeable closeable = ExecutorServiceCloser.createWith(executorService)) {
- List<ListenableFuture<Boolean>> deserializing = new ArrayList<>();
- for (final Path symbolPath : symbolPaths) {
- deserializing.add(
- executorService.submit(
- new Deserialize(deserializer, symbolPath, deserializedDataBuilder)));
- }
- FailedFutureAggregator<MergingException> aggregator =
- FailedFutureAggregator.createForMergingExceptionWithMessage(
- "Failure(s) during dependency parsing");
- aggregator.aggregateAndMaybeThrow(deserializing);
- }
- return deserializedDataBuilder.build();
- }
-
- /** Task to deserialize resources from a path. */
- private static final class Deserialize implements Callable<Boolean> {
-
- private final Path symbolPath;
-
- private final Builder finalDataBuilder;
- private final AndroidDataDeserializer deserializer;
-
- private Deserialize(
- AndroidDataDeserializer deserializer, Path symbolPath, Builder finalDataBuilder) {
- this.deserializer = deserializer;
- this.symbolPath = symbolPath;
- this.finalDataBuilder = finalDataBuilder;
- }
-
- @Override
- public Boolean call() throws Exception {
- final Builder parsedDataBuilder = ParsedAndroidData.Builder.newBuilder();
- deserializer.read(symbolPath, parsedDataBuilder.consumers());
- // The builder isn't threadsafe, so synchronize the copyTo call.
- synchronized (finalDataBuilder) {
- // All the resources are sorted before writing, so they can be aggregated in
- // whatever order here.
- parsedDataBuilder.copyTo(finalDataBuilder);
- }
- return Boolean.TRUE;
- }
- }
}