use of com.facebook.buck.rules.coercer.ManifestEntries in project buck by facebook.
the class AaptStepTest method shouldEmitFlagsForManifestEntries.
@Test
public void shouldEmitFlagsForManifestEntries() throws Exception {
ManifestEntries entries = ManifestEntries.builder().setMinSdkVersion(3).setTargetSdkVersion(5).setVersionCode(7).setVersionName("eleven").setDebugMode(true).build();
AaptStep aaptStep = buildAaptStep(proguardConfig, true, false, entries);
ExecutionContext executionContext = createTestExecutionContext(Verbosity.ALL);
ImmutableList<String> command = aaptStep.getShellCommandInternal(executionContext);
assertTrue(command.contains("--min-sdk-version"));
assertEquals("3", command.get(command.indexOf("--min-sdk-version") + 1));
assertTrue(command.contains("--target-sdk-version"));
assertEquals("5", command.get(command.indexOf("--target-sdk-version") + 1));
assertTrue(command.contains("--version-code"));
assertEquals("7", command.get(command.indexOf("--version-code") + 1));
assertTrue(command.contains("--version-name"));
assertEquals("eleven", command.get(command.indexOf("--version-name") + 1));
assertTrue(command.contains("--debug-mode"));
// This should be present because we've emitted > 0 manifest-changing flags.
assertTrue(command.contains("--error-on-failed-insert"));
}
Aggregations