use of com.android.tools.build.bundletool.model.SigningConfiguration in project bundletool by google.
the class BuildApksCommandTest method populateMinV3SigningApi.
@Test
public void populateMinV3SigningApi() {
ByteArrayOutputStream output = new ByteArrayOutputStream();
int minV3Api = 30;
BuildApksCommand commandViaFlags = BuildApksCommand.fromFlags(new FlagParser().parse("--bundle=" + bundlePath, "--output=" + outputFilePath, "--aapt2=" + AAPT2_PATH, "--ks=" + keystorePath, "--ks-key-alias=" + KEY_ALIAS, "--ks-pass=pass:" + KEYSTORE_PASSWORD, "--key-pass=pass:" + KEY_PASSWORD, "--min-v3-rotation-api-version=" + minV3Api), new PrintStream(output), systemEnvironmentProvider, fakeAdbServer);
SigningConfiguration signingConfiguration = commandViaFlags.getSigningConfiguration().get();
assertThat(signingConfiguration.getMinimumV3RotationApiVersion()).hasValue(minV3Api);
}
use of com.android.tools.build.bundletool.model.SigningConfiguration in project bundletool by google.
the class BuildApksCommandTest method buildingViaFlagsAndBuilderHasSameResult_stamp_debugKey.
@Test
public void buildingViaFlagsAndBuilderHasSameResult_stamp_debugKey() throws Exception {
Path debugKeystorePath = tmpDir.resolve(".android").resolve("debug.keystore");
FileUtils.createParentDirectories(debugKeystorePath);
SigningConfiguration signingConfiguration = createDebugKeystore(debugKeystorePath, DEBUG_KEYSTORE_PASSWORD, DEBUG_KEY_ALIAS, DEBUG_KEY_PASSWORD);
SystemEnvironmentProvider provider = new FakeSystemEnvironmentProvider(/* variables= */
ImmutableMap.of(ANDROID_HOME, "/android/home", ANDROID_SERIAL, DEVICE_ID), /* properties= */
ImmutableMap.of(USER_HOME.key(), tmpDir.toString()));
ByteArrayOutputStream output = new ByteArrayOutputStream();
BuildApksCommand commandViaFlags = BuildApksCommand.fromFlags(new FlagParser().parse("--bundle=" + bundlePath, "--output=" + outputFilePath, "--aapt2=" + AAPT2_PATH, "--create-stamp=" + true), new PrintStream(output), provider, fakeAdbServer);
BuildApksCommand commandViaBuilder = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setSigningConfiguration(signingConfiguration).setSourceStamp(SourceStamp.builder().setSigningConfiguration(signingConfiguration).build()).setAapt2Command(commandViaFlags.getAapt2Command().get()).setExecutorServiceInternal(commandViaFlags.getExecutorService()).setExecutorServiceCreatedByBundleTool(true).setOutputPrintStream(commandViaFlags.getOutputPrintStream().get()).build();
assertThat(commandViaBuilder.getSourceStamp()).isEqualTo(commandViaFlags.getSourceStamp());
assertThat(commandViaBuilder.getSigningConfiguration()).isEqualTo(commandViaFlags.getSigningConfiguration());
}
Aggregations