use of com.facebook.buck.step.ExecutionContext 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"));
}
use of com.facebook.buck.step.ExecutionContext in project buck by facebook.
the class AaptStepTest method shouldNotEmitFailOnInsertWithoutManifestEntries.
@Test
public void shouldNotEmitFailOnInsertWithoutManifestEntries() throws Exception {
AaptStep aaptStep = buildAaptStep(proguardConfig, true, false, ManifestEntries.empty());
ExecutionContext executionContext = createTestExecutionContext(Verbosity.ALL);
ImmutableList<String> command = aaptStep.getShellCommandInternal(executionContext);
assertFalse(command.contains("--error-on-failed-insert"));
}
use of com.facebook.buck.step.ExecutionContext in project buck by facebook.
the class AaptStepTest method shouldEmitVerbosityFlagWithVerboseContext.
@Test
public void shouldEmitVerbosityFlagWithVerboseContext() throws Exception {
AaptStep aaptStep = buildAaptStep(proguardConfig, false, false, ManifestEntries.empty());
ExecutionContext executionContext = createTestExecutionContext(Verbosity.ALL);
ImmutableList<String> command = aaptStep.getShellCommandInternal(executionContext);
assertTrue(command.contains("-v"));
}
use of com.facebook.buck.step.ExecutionContext in project buck by facebook.
the class AaptStepTest method shouldEmitNoCrunchFlagIfNotCrunch.
@Test
public void shouldEmitNoCrunchFlagIfNotCrunch() throws Exception {
AaptStep aaptStep = buildAaptStep(proguardConfig, false, false, ManifestEntries.empty());
ExecutionContext executionContext = createTestExecutionContext(Verbosity.ALL);
ImmutableList<String> command = aaptStep.getShellCommandInternal(executionContext);
assertTrue(command.contains("--no-crunch"));
}
use of com.facebook.buck.step.ExecutionContext in project buck by facebook.
the class AaptStepTest method shouldNotEmitNoCrunchFlagIfCrunch.
@Test
public void shouldNotEmitNoCrunchFlagIfCrunch() throws Exception {
AaptStep aaptStep = buildAaptStep(proguardConfig, true, false, ManifestEntries.empty());
ExecutionContext executionContext = createTestExecutionContext(Verbosity.ALL);
ImmutableList<String> command = aaptStep.getShellCommandInternal(executionContext);
assertFalse(command.contains("--no-crunch"));
}
Aggregations