use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidBinaryIntegrationTest method testCxxLibraryDepModular.
@Test
public void testCxxLibraryDepModular() throws IOException {
String target = "//apps/sample:app_cxx_lib_dep_modular";
workspace.runBuckCommand("build", target).assertSuccess();
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(target), "%s.apk")));
zipInspector.assertFileDoesNotExist("lib/armeabi/libnative_cxx_lib.so");
zipInspector.assertFileExists("lib/armeabi/libgnustl_shared.so");
zipInspector.assertFileDoesNotExist("lib/armeabi-v7a/libnative_cxx_lib.so");
zipInspector.assertFileExists("lib/armeabi-v7a/libgnustl_shared.so");
zipInspector.assertFileDoesNotExist("lib/x86/libnative_cxx_lib.so");
zipInspector.assertFileExists("lib/x86/libgnustl_shared.so");
zipInspector.assertFileExists("assets/native.cxx.lib/libs.txt");
zipInspector.assertFileExists("assets/native.cxx.lib/libs.xzs");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidAarIntegrationTest method testCxxLibraryDependent.
@Test
public void testCxxLibraryDependent() throws IOException {
AssumeAndroidPlatform.assumeNdkIsAvailable();
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "android_aar_native_deps/cxx_deps", tmp);
workspace.setUp();
String target = "//:app";
workspace.runBuckBuild(target).assertSuccess();
Path aar = workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(target), AndroidAar.AAR_FORMAT));
ZipInspector zipInspector = new ZipInspector(aar);
zipInspector.assertFileExists("AndroidManifest.xml");
zipInspector.assertFileExists("classes.jar");
zipInspector.assertFileExists("R.txt");
zipInspector.assertFileExists("res/");
zipInspector.assertFileExists("jni/armeabi/libdep.so");
zipInspector.assertFileExists("jni/armeabi/libnative.so");
zipInspector.assertFileExists("jni/armeabi-v7a/libdep.so");
zipInspector.assertFileExists("jni/armeabi-v7a/libnative.so");
zipInspector.assertFileExists("jni/x86/libdep.so");
zipInspector.assertFileExists("jni/x86/libnative.so");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidAarIntegrationTest method testBuildAndroidAar.
@Test
public void testBuildAndroidAar() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "android_aar_build/caseA", tmp);
workspace.setUp();
String target = "//:app";
workspace.runBuckBuild(target).assertSuccess();
Path aar = workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(target), AndroidAar.AAR_FORMAT));
ZipInspector zipInspector = new ZipInspector(aar);
zipInspector.assertFileExists("AndroidManifest.xml");
zipInspector.assertFileExists("classes.jar");
zipInspector.assertFileExists("R.txt");
zipInspector.assertFileExists("assets/a.txt");
zipInspector.assertFileExists("assets/b.txt");
zipInspector.assertFileExists("res/raw/helloworld.txt");
zipInspector.assertFileExists("res/values/values.xml");
zipInspector.assertFileContents("res/values/values.xml", workspace.getFileContents("res/values/A.xml").trim());
Path contents = tmp.getRoot().resolve("aar-contents");
Unzip.extractZipFile(aar, contents, Unzip.ExistingFileMode.OVERWRITE);
try (JarFile classes = new JarFile(contents.resolve("classes.jar").toFile())) {
assertThat(classes.getJarEntry("com/example/HelloWorld.class"), Matchers.notNullValue());
}
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidBinaryIntegrationTest method testNonExopackageHasSecondary.
@Test
public void testNonExopackageHasSecondary() throws IOException {
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(SIMPLE_TARGET), "%s.apk")));
zipInspector.assertFileExists("assets/secondary-program-dex-jars/metadata.txt");
zipInspector.assertFileExists("assets/secondary-program-dex-jars/secondary-1.dex.jar");
zipInspector.assertFileDoesNotExist("classes2.dex");
zipInspector.assertFileExists("classes.dex");
zipInspector.assertFileExists("lib/armeabi/libfakenative.so");
}
use of com.facebook.buck.testutil.integration.ZipInspector in project buck by facebook.
the class AndroidBinaryIntegrationTest method testCompressLibsNoPackageModular.
@Test
public void testCompressLibsNoPackageModular() throws IOException {
String target = "//apps/sample:app_cxx_lib_no_package_modular";
workspace.runBuckCommand("build", target).assertSuccess();
ZipInspector zipInspector = new ZipInspector(workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTargetFactory.newInstance(target), "%s.apk")));
zipInspector.assertFileExists("assets/native.cxx.foo1/libs.xzs");
zipInspector.assertFileExists("assets/native.cxx.foo1/libs.txt");
zipInspector.assertFileExists("assets/native.cxx.libasset/libs.xzs");
zipInspector.assertFileExists("assets/native.cxx.libasset/libs.txt");
zipInspector.assertFileExists("lib/x86/libnative_cxx_libasset2.so");
zipInspector.assertFileExists("lib/x86/libnative_cxx_foo2.so");
zipInspector.assertFileDoesNotExist("assets/lib/libs.xzs");
zipInspector.assertFileDoesNotExist("assets/lib/metadata.txt");
zipInspector.assertFileDoesNotExist("lib/x86/libnative_cxx_foo1.so");
zipInspector.assertFileDoesNotExist("lib/x86/libnative_cxx_libasset.so");
zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_libasset.so");
zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_libasset2.so");
zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_foo1.so");
zipInspector.assertFileDoesNotExist("assets/lib/x86/libnative_cxx_foo2.so");
}
Aggregations