use of com.android.tools.build.bundletool.model.utils.SystemEnvironmentProvider in project bundletool by google.
the class BuildApksCommandTest method noKeystoreProvidedPrintsWarning_debugKeystore.
@Test
public void noKeystoreProvidedPrintsWarning_debugKeystore() throws Exception {
Path debugKeystorePath = tmpDir.resolve(".android").resolve("debug.keystore");
FileUtils.createParentDirectories(debugKeystorePath);
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.fromFlags(new FlagParser().parse("--bundle=" + bundlePath, "--output=" + outputFilePath, "--aapt2=" + AAPT2_PATH), new PrintStream(output), provider, fakeAdbServer);
assertThat(new String(output.toByteArray(), UTF_8)).contains("INFO: The APKs will be signed with the debug keystore");
}
Aggregations