use of com.google.devtools.build.android.ParsedAndroidData.Builder in project bazel by bazelbuild.
the class AndroidResourceProcessor method deserializeSymbolsToData.
/** 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();
}
Aggregations