Read packages from ResourcesZip instead of options.
RELNOTES: None
// limitations under the License.
package com.google.devtools.build.android;
-import static java.util.stream.Collectors.toSet;
import com.android.builder.core.VariantConfiguration;
import com.google.common.collect.ImmutableList;
@@ -36,6 +35,7 @@ import java.io.File;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.function.Function;
@@ -99,14 +99,7 @@ public class Aapt2ResourceShrinkingAction {
.profileUsing(profiler)
.dependencies(ImmutableList.of(StaticLibrary.from(aapt2ConfigOptions.androidJar)));
- final Set<String> packages =
- options
- .dependencyManifests
- .stream()
- .map(Path::toFile)
- .map(manifestToPackageUsing(executorService))
- .map(futureToString())
- .collect(toSet());
+ final Set<String> packages = new HashSet<>(resourcesZip.asPackages());
if (aapt2ShrinkOptions.useProtoApk) {
try (final ShrunkProtoApk shrunk =
