use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidExopackageBinaryIntegrationTest method testEditingSecondaryDexClassGetsAbiHitForExopackage.
@Test
public void testEditingSecondaryDexClassGetsAbiHitForExopackage() throws IOException {
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "package com", "package\ncom");
workspace.resetBuildLogFile();
workspace.runBuckBuild(DEX_EXOPACKAGE_TARGET).assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetHadMatchingInputRuleKey(DEX_EXOPACKAGE_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidExopackageBinaryIntegrationTest method testEditingSecondaryDexClassGetsAbiHitForDexAndNativeExopackage.
@Test
public void testEditingSecondaryDexClassGetsAbiHitForDexAndNativeExopackage() throws IOException {
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "package com", "package\ncom");
workspace.resetBuildLogFile();
workspace.runBuckBuild(DEX_AND_NATIVE_EXOPACKAGE_TARGET).assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetHadMatchingInputRuleKey(DEX_AND_NATIVE_EXOPACKAGE_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidBinaryIntegrationTest method testResourcesTrimming.
@Test
public void testResourcesTrimming() throws IOException {
// Enable trimming.
workspace.replaceFileContents("apps/multidex/BUCK", "# ARGS_FOR_APP", "trim_resource_ids = True, # ARGS_FOR_APP");
workspace.runBuckCommand("build", "//apps/multidex:disassemble_app_r_dot_java").assertSuccess();
// Make sure we only see what we expect.
verifyTrimmedRDotJava(ImmutableSet.of("top_layout", "title"));
// Make a change.
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "R.layout.top_layout", "0 /* NO RESOURCE HERE */");
// Make sure everything gets rebuilt, and we only see what we expect.
workspace.resetBuildLogFile();
workspace.runBuckCommand("build", "//apps/multidex:disassemble_app_r_dot_java").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//apps/multidex:app#compile_uber_r_dot_java");
buildLog.assertTargetBuiltLocally("//apps/multidex:app#dex_uber_r_dot_java");
verifyTrimmedRDotJava(ImmutableSet.of("title"));
// Turn off trimming and turn on exopackage, and rebuilt.
workspace.replaceFileContents("apps/multidex/BUCK", "trim_resource_ids = True, # ARGS_FOR_APP", "exopackage_modes = ['secondary_dex'], # ARGS_FOR_APP");
workspace.runBuckCommand("build", SIMPLE_TARGET).assertSuccess();
// Make a change.
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "0 /* NO RESOURCE HERE */", "R.layout.top_layout");
// rebuilt and verify that we get an ABI hit.
workspace.resetBuildLogFile();
workspace.runBuckCommand("build", SIMPLE_TARGET).assertSuccess();
buildLog = workspace.getBuildLog();
buildLog.assertTargetHadMatchingInputRuleKey(SIMPLE_TARGET);
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidBinaryIntegrationTest method testDexingIsInputBased.
@Test
public void testDexingIsInputBased() throws IOException {
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//java/com/sample/lib:lib#dex");
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "import", "import /* no output change */");
workspace.runBuckBuild(SIMPLE_TARGET).assertSuccess();
buildLog = workspace.getBuildLog();
buildLog.assertNotTargetBuiltLocally("//java/com/sample/lib:lib#dex");
buildLog.assertTargetHadMatchingInputRuleKey("//java/com/sample/lib:lib#dex");
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "import", "import /* \n some output change */");
workspace.runBuckBuild(SIMPLE_TARGET).assertSuccess();
buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//java/com/sample/lib:lib#dex");
}
use of com.facebook.buck.testutil.integration.BuckBuildLog in project buck by facebook.
the class AndroidBinaryIntegrationTest method testResourcesTrimmingWithPattern.
@Test
public void testResourcesTrimmingWithPattern() throws IOException {
// Enable trimming.
workspace.replaceFileContents("apps/multidex/BUCK", "# ARGS_FOR_APP", "keep_resource_pattern = '^app_.*', trim_resource_ids = True, # ARGS_FOR_APP");
workspace.runBuckCommand("build", "//apps/multidex:disassemble_app_r_dot_java").assertSuccess();
// Make sure we only see what we expect.
verifyTrimmedRDotJava(ImmutableSet.of("app_icon", "app_name", "top_layout", "title"));
// Make a change.
workspace.replaceFileContents("java/com/sample/lib/Sample.java", "R.layout.top_layout", "0 /* NO RESOURCE HERE */");
// Make sure everything gets rebuilt, and we only see what we expect.
workspace.resetBuildLogFile();
workspace.runBuckCommand("build", "//apps/multidex:disassemble_app_r_dot_java").assertSuccess();
BuckBuildLog buildLog = workspace.getBuildLog();
buildLog.assertTargetBuiltLocally("//apps/multidex:app#compile_uber_r_dot_java");
buildLog.assertTargetBuiltLocally("//apps/multidex:app#dex_uber_r_dot_java");
verifyTrimmedRDotJava(ImmutableSet.of("app_icon", "app_name", "title"));
}
Aggregations