Search in sources :

Example 36 with AppBundleBuilder

use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.

the class BuildApksDeviceSpecTest method deviceSpec_systemApkMode_partialDeviceSpecMissingDensity_throws.

@Test
@Theory
public void deviceSpec_systemApkMode_partialDeviceSpecMissingDensity_throws() throws Exception {
    DeviceSpec deviceSpec = mergeSpecs(abis("arm64-v8a"));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).setApkBuildMode(SYSTEM);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Device spec must have screen density and ABIs set when running with 'system' mode" + " flag.");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) SYSTEM(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.SYSTEM) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.createDeviceSpecFile(com.android.tools.build.bundletool.testing.DeviceFactory.createDeviceSpecFile) DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) Theory(org.junit.experimental.theories.Theory) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AppBundleFactory.createInstantBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createInstantBundle) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) DeviceFactory.deviceWithSdk(com.android.tools.build.bundletool.testing.DeviceFactory.deviceWithSdk) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) HDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.HDPI) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResultUtils.instantApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.instantApkVariants) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) PrintStream(java.io.PrintStream) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) XHDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.XHDPI) Rule(org.junit.Rule) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test) Theory(org.junit.experimental.theories.Theory)

Example 37 with AppBundleBuilder

use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.

the class BuildApksDeviceSpecTest method deviceSpec_systemApkMode_partialDeviceSpecMissingAbi_throws.

@Test
@Theory
public void deviceSpec_systemApkMode_partialDeviceSpecMissingAbi_throws() throws Exception {
    DeviceSpec deviceSpec = mergeSpecs(density(DensityAlias.MDPI));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setDeviceSpec(deviceSpec).setApkBuildMode(SYSTEM);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Device spec must have screen density and ABIs set when running with 'system' mode" + " flag.");
}
Also used : DeviceSpec(com.android.bundle.Devices.DeviceSpec) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) SYSTEM(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.SYSTEM) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.createDeviceSpecFile(com.android.tools.build.bundletool.testing.DeviceFactory.createDeviceSpecFile) DeviceSpec(com.android.bundle.Devices.DeviceSpec) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) Theory(org.junit.experimental.theories.Theory) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AppBundleFactory.createInstantBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createInstantBundle) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) DeviceFactory.deviceWithSdk(com.android.tools.build.bundletool.testing.DeviceFactory.deviceWithSdk) ByteArrayOutputStream(java.io.ByteArrayOutputStream) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) HDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.HDPI) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResultUtils.instantApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.instantApkVariants) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) ResultUtils.splitApkVariants(com.android.tools.build.bundletool.model.utils.ResultUtils.splitApkVariants) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) PrintStream(java.io.PrintStream) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) XHDPI(com.android.bundle.Targeting.ScreenDensity.DensityAlias.XHDPI) Rule(org.junit.Rule) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test) Theory(org.junit.experimental.theories.Theory)

Example 38 with AppBundleBuilder

use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.

the class AddTransparencyCommandTest method createBundle.

private static void createBundle(Path path, boolean hasSharedUserId, int minSdkVersion) throws Exception {
    AppBundle appBundle = new AppBundleBuilder().addModule(BASE_MODULE, module -> addCodeFilesToBundleModule(module, hasSharedUserId, minSdkVersion)).addModule(FEATURE_MODULE1, module -> addCodeFilesToBundleModule(module, hasSharedUserId, minSdkVersion)).addModule(FEATURE_MODULE2, module -> addCodeFilesToBundleModule(module, hasSharedUserId, minSdkVersion)).build();
    new AppBundleSerializer().writeToDisk(appBundle, path);
}
Also used : KeyPair(java.security.KeyPair) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Mode(com.android.tools.build.bundletool.commands.AddTransparencyCommand.Mode) ZipFile(java.util.zip.ZipFile) Splitter(com.google.common.base.Splitter) Path(java.nio.file.Path) Theory(org.junit.experimental.theories.Theory) KeyPairGenerator(java.security.KeyPairGenerator) JsonWebSignature(org.jose4j.jws.JsonWebSignature) MIN_RSA_KEY_LENGTH(com.android.tools.build.bundletool.commands.AddTransparencyCommand.MIN_RSA_KEY_LENGTH) CommandExecutionException(com.android.tools.build.bundletool.model.exceptions.CommandExecutionException) RequiredFlagNotSetException(com.android.tools.build.bundletool.flags.Flag.RequiredFlagNotSetException) Signature(java.security.Signature) RSA_USING_SHA256(org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA256) KeyStore(java.security.KeyStore) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) ManifestProtoUtils.withMinSdkVersion(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withMinSdkVersion) List(java.util.List) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Certificate(java.security.cert.Certificate) JsonFormat(com.google.protobuf.util.JsonFormat) Password(com.android.tools.build.bundletool.model.Password) PrivateKey(java.security.PrivateKey) SignerConfig(com.android.tools.build.bundletool.model.SignerConfig) CodeTransparencyVersion(com.android.tools.build.bundletool.transparency.CodeTransparencyVersion) Optional(java.util.Optional) CodeTransparency(com.android.bundle.CodeTransparencyOuterClass.CodeTransparency) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) RunWith(org.junit.runner.RunWith) Hashing(com.google.common.hash.Hashing) BundleModuleBuilder(com.android.tools.build.bundletool.testing.BundleModuleBuilder) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) UnknownFlagsException(com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException) ImmutableList(com.google.common.collect.ImmutableList) Charset(java.nio.charset.Charset) Theories(org.junit.experimental.theories.Theories) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) CharSource(com.google.common.io.CharSource) ByteSource(com.google.common.io.ByteSource) CodeTransparencyTestUtils.createJwsToken(com.android.tools.build.bundletool.testing.CodeTransparencyTestUtils.createJwsToken) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) CodeTransparencyFactory(com.android.tools.build.bundletool.transparency.CodeTransparencyFactory) Before(org.junit.Before) CertificateFactory(com.android.tools.build.bundletool.testing.CertificateFactory) BaseEncoding(com.google.common.io.BaseEncoding) Files(java.nio.file.Files) InvalidBundleException(com.android.tools.build.bundletool.model.exceptions.InvalidBundleException) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) Test(org.junit.Test) BUNDLETOOL_NAMESPACE(com.android.tools.build.bundletool.model.BundleMetadata.BUNDLETOOL_NAMESPACE) BundleMetadata(com.android.tools.build.bundletool.model.BundleMetadata) Truth.assertThat(com.google.common.truth.Truth.assertThat) ManifestProtoUtils.withSharedUserId(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withSharedUserId) Rule(org.junit.Rule) XmlNode(com.android.aapt.Resources.XmlNode) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AddTransparencyCommand.createJwtWithoutSignature(com.android.tools.build.bundletool.commands.AddTransparencyCommand.createJwtWithoutSignature) AppBundle(com.android.tools.build.bundletool.model.AppBundle) BundleModule(com.android.tools.build.bundletool.model.BundleModule) CodeRelatedFile(com.android.bundle.CodeTransparencyOuterClass.CodeRelatedFile) DexMergingChoice(com.android.tools.build.bundletool.commands.AddTransparencyCommand.DexMergingChoice) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer)

Example 39 with AppBundleBuilder

use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.

the class BuildApksCommandTest method createAppBundle.

private void createAppBundle(Path path, Optional<CodeTransparency> codeTransparency) throws Exception {
    AppBundleBuilder appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app")).build());
    if (codeTransparency.isPresent()) {
        appBundle.addMetadataFile(BundleMetadata.BUNDLETOOL_NAMESPACE, BundleMetadata.TRANSPARENCY_SIGNED_FILE_NAME, CharSource.wrap(createJwsToken(JsonFormat.printer().print(codeTransparency.get()))).asByteSource(Charset.defaultCharset()));
    }
    new AppBundleSerializer().writeToDisk(appBundle.build(), path);
}
Also used : AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer)

Example 40 with AppBundleBuilder

use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.

the class BuildApksConnectedDeviceTest method connectedDevice_universalApk_throws.

@Test
public void connectedDevice_universalApk_throws() throws Exception {
    AppBundle appBundle = new AppBundleBuilder().addModule("base", module -> module.setManifest(androidManifest("com.app"))).build();
    bundleSerializer.writeToDisk(appBundle, bundlePath);
    BuildApksCommand.Builder command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setGenerateOnlyForConnectedDevice(true).setApkBuildMode(UNIVERSAL).setAdbPath(sdkDirPath.resolve("platform-tools").resolve("adb")).setAdbServer(fakeAdbServer);
    Throwable exception = assertThrows(InvalidCommandException.class, command::build);
    assertThat(exception).hasMessageThat().contains("Optimizing for connected device only possible when running with 'default' mode flag.");
}
Also used : AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) UNIVERSAL(com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.UNIVERSAL) DeviceState(com.android.ddmlib.IDevice.DeviceState) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) Variant(com.android.bundle.Commands.Variant) DeviceFactory.abis(com.android.tools.build.bundletool.testing.DeviceFactory.abis) DensityAlias(com.android.bundle.Targeting.ScreenDensity.DensityAlias) ZipFile(java.util.zip.ZipFile) Path(java.nio.file.Path) FakeSystemEnvironmentProvider(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider) ImmutableMap(com.google.common.collect.ImmutableMap) CommandExecutionException(com.android.tools.build.bundletool.model.exceptions.CommandExecutionException) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) FlagParser(com.android.tools.build.bundletool.flags.FlagParser) DeviceFactory.sdkVersion(com.android.tools.build.bundletool.testing.DeviceFactory.sdkVersion) ApkSet(com.android.bundle.Commands.ApkSet) SystemEnvironmentProvider(com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) DeviceFactory.density(com.android.tools.build.bundletool.testing.DeviceFactory.density) TruthZip.assertThat(com.android.tools.build.bundletool.testing.truth.zip.TruthZip.assertThat) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) DeviceFactory.locales(com.android.tools.build.bundletool.testing.DeviceFactory.locales) RunWith(org.junit.runner.RunWith) BuildApksResult(com.android.bundle.Commands.BuildApksResult) DeviceFactory.mergeSpecs(com.android.tools.build.bundletool.testing.DeviceFactory.mergeSpecs) ApkSetUtils.extractTocFromApkSetFile(com.android.tools.build.bundletool.testing.ApkSetUtils.extractTocFromApkSetFile) ImmutableList(com.google.common.collect.ImmutableList) AppBundleSerializer(com.android.tools.build.bundletool.io.AppBundleSerializer) ApkDescription(com.android.bundle.Commands.ApkDescription) DeviceFactory.lDeviceWithDensity(com.android.tools.build.bundletool.testing.DeviceFactory.lDeviceWithDensity) ANDROID_HOME(com.android.tools.build.bundletool.testing.FakeSystemEnvironmentProvider.ANDROID_HOME) AdbServer(com.android.tools.build.bundletool.device.AdbServer) Before(org.junit.Before) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) Files(java.nio.file.Files) FakeDevice(com.android.tools.build.bundletool.testing.FakeDevice) Test(org.junit.Test) JUnit4(org.junit.runners.JUnit4) Truth.assertThat(com.google.common.truth.Truth.assertThat) AppBundleFactory.createMinSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinSdkBundle) Rule(org.junit.Rule) Ignore(org.junit.Ignore) FakeAdbServer(com.android.tools.build.bundletool.testing.FakeAdbServer) AppBundleFactory.createMaxSdkBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMaxSdkBundle) IncompatibleDeviceException(com.android.tools.build.bundletool.model.exceptions.IncompatibleDeviceException) InvalidCommandException(com.android.tools.build.bundletool.model.exceptions.InvalidCommandException) AppBundle(com.android.tools.build.bundletool.model.AppBundle) TemporaryFolder(org.junit.rules.TemporaryFolder) AppBundleFactory.createLdpiHdpiAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createLdpiHdpiAppBundle) AppBundleFactory.createMinMaxSdkAppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createMinMaxSdkAppBundle) AppBundleFactory.createX86AppBundle(com.android.tools.build.bundletool.testing.AppBundleFactory.createX86AppBundle) AppBundle(com.android.tools.build.bundletool.model.AppBundle) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) Test(org.junit.Test)

Aggregations

AppBundleBuilder (com.android.tools.build.bundletool.testing.AppBundleBuilder)155 Test (org.junit.Test)153 AppBundle (com.android.tools.build.bundletool.model.AppBundle)134 ManifestProtoUtils.androidManifest (com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest)123 Truth.assertThat (com.google.common.truth.Truth.assertThat)123 RunWith (org.junit.runner.RunWith)123 Path (java.nio.file.Path)113 ZipFile (java.util.zip.ZipFile)113 Before (org.junit.Before)113 Rule (org.junit.Rule)113 TemporaryFolder (org.junit.rules.TemporaryFolder)113 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)112 AppBundleSerializer (com.android.tools.build.bundletool.io.AppBundleSerializer)105 ImmutableList (com.google.common.collect.ImmutableList)102 BuildApksResult (com.android.bundle.Commands.BuildApksResult)101 Variant (com.android.bundle.Commands.Variant)94 InvalidBundleException (com.android.tools.build.bundletool.model.exceptions.InvalidBundleException)91 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)88 ApkDescription (com.android.bundle.Commands.ApkDescription)87 BundleConfig (com.android.bundle.Config.BundleConfig)87