Search in sources :

Example 1 with ManifestEntries

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"));
}
Also used : ExecutionContext(com.facebook.buck.step.ExecutionContext) TestExecutionContext(com.facebook.buck.step.TestExecutionContext) ManifestEntries(com.facebook.buck.rules.coercer.ManifestEntries) Test(org.junit.Test)

Aggregations

ManifestEntries (com.facebook.buck.rules.coercer.ManifestEntries)1 ExecutionContext (com.facebook.buck.step.ExecutionContext)1 TestExecutionContext (com.facebook.buck.step.TestExecutionContext)1 Test (org.junit.Test)1