private ImmutableMap<ApkTargeting, Variant> extractStandaloneVariantsByTargeting( BuildApksResult result) { return Maps.uniqueIndex( standaloneApkVariants(result), variant -> getOnlyElement(apkDescriptions(variant)).getTargeting()); }
public ImmutableList<ZipPath> getMatchingApksFromVariant(Variant variant) { ImmutableList.Builder<ZipPath> matchedApksBuilder = ImmutableList.builder(); Predicate<String> moduleNameMatcher = getModuleNameMatcher(variant); for (ApkSet apkSet : variant.getApkSetList()) { String moduleName = apkSet.getModuleMetadata().getName(); for (ApkDescription apkDescription : apkSet.getApkDescriptionList()) { ApkTargeting apkTargeting = apkDescription.getTargeting(); boolean isSplit = !apkDescription.hasStandaloneApkMetadata(); checkCompatibleWithApkTargeting(apkTargeting); if (matchesApk(apkTargeting, isSplit, moduleName, moduleNameMatcher)) { matchedApksBuilder.add(ZipPath.create(apkDescription.getPath())); } } } return matchedApksBuilder.build(); }
variant -> { ApkDescription apkDescription = getOnlyElement(apkDescriptions(variant)); return getOnlyElement(apkDescription.getTargeting().getAbiTargeting().getValueList()); }); assertThat(standaloneVariantsByAbi.keySet())
Maps.uniqueIndex( apkDescriptions(standaloneApkVariants(result)), apkDesc -> getOnlyElement(apkDesc.getTargeting().getAbiTargeting().getValueList()));
assertThat(stubSystemApk.getTargeting()).isEqualToDefaultInstance(); File systemApkFile = extractFromApkSetFile(apkSetFile, stubSystemApk.getPath(), outputDir); try (ZipFile systemApkZipFile = new ZipFile(systemApkFile)) {
ApkDescription apkDescription = getOnlyElement(apkDescriptions(variant)); return getOnlyElement( apkDescription.getTargeting().getAbiTargeting().getValueList()); }); ApkDescription apkDescription = apkDescriptions(variant).get(0); return getOnlyElement( apkDescription.getTargeting().getAbiTargeting().getValueList()); });
assertThat(systemApk.getTargeting()).isEqualToDefaultInstance();
assertThat(universalApk.getTargeting()).isEqualToDefaultInstance();
Maps.uniqueIndex( apkDescriptions(splitApkVariants(result)), apkDesc -> apkDesc.getTargeting().getAbiTargeting()); assertThat(splitApksByAbiTargeting.keySet()) .containsExactly(AbiTargeting.getDefaultInstance(), abiTargeting(AbiAlias.X86)); assertThat(standaloneApks.get(0).getTargeting().getAbiTargeting()) .isEqualTo(abiTargeting(AbiAlias.X86, ImmutableSet.of())); File standaloneApkFile =