use of com.facebook.buck.io.ProjectFilesystem in project buck by facebook.
the class PrebuiltAppleFrameworkIntegrationTest method testPrebuiltAppleFrameworkLinks.
@Test
public void testPrebuiltAppleFrameworkLinks() throws IOException, InterruptedException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "prebuilt_apple_framework_links", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(workspace.getDestPath());
BuildTarget target = BuildTargetFactory.newInstance("//app:TestApp");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
Path testBinaryPath = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s"));
assertTrue(Files.exists(testBinaryPath));
ProcessExecutor.Result otoolResult = workspace.runCommand("otool", "-L", testBinaryPath.toString());
assertEquals(0, otoolResult.getExitCode());
assertThat(otoolResult.getStdout().orElse(""), containsString("@rpath/BuckTest.framework/BuckTest"));
assertThat(otoolResult.getStdout().orElse(""), not(containsString("BuckTest.dylib")));
}
use of com.facebook.buck.io.ProjectFilesystem in project buck by facebook.
the class PrebuiltAppleFrameworkIntegrationTest method testPrebuiltAppleFrameworkBuildsSomething.
@Test
public void testPrebuiltAppleFrameworkBuildsSomething() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "prebuilt_apple_framework_builds", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(workspace.getDestPath());
BuildTarget target = BuildTargetFactory.newInstance("//prebuilt:BuckTest");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
assertTrue(Files.exists(workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s"))));
}
use of com.facebook.buck.io.ProjectFilesystem in project buck by facebook.
the class PrebuiltAppleFrameworkIntegrationTest method testStaticWithDependencies.
@Test
public void testStaticWithDependencies() throws IOException, InterruptedException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "prebuilt_apple_framework_static", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(workspace.getDestPath());
BuildTarget target = BuildTargetFactory.newInstance("//app:TestApp#static,macosx-x86_64");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
Path testBinaryPath = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s"));
ProcessExecutor.Result otoolResult = workspace.runCommand("otool", "-L", testBinaryPath.toString());
assertEquals(0, otoolResult.getExitCode());
assertThat(otoolResult.getStdout().orElse(""), containsString("Foundation.framework"));
assertThat(otoolResult.getStdout().orElse(""), not(containsString("@rpath/BuckTest.framework/BuckTest")));
ProcessExecutor.Result nmResult = workspace.runCommand("nm", testBinaryPath.toString());
assertEquals(0, nmResult.getExitCode());
assertThat(nmResult.getStdout().orElse(""), containsString("S _OBJC_CLASS_$_Hello"));
assertThat(nmResult.getStdout().orElse(""), not(containsString("U _OBJC_CLASS_$_Hello")));
assertThat(nmResult.getStdout().orElse(""), containsString("S _OBJC_CLASS_$_Strings"));
assertThat(nmResult.getStdout().orElse(""), not(containsString("U _OBJC_CLASS_$_Strings")));
}
use of com.facebook.buck.io.ProjectFilesystem in project buck by facebook.
the class PrebuiltAppleFrameworkIntegrationTest method testPrebuiltAppleFrameworkCopiedToBundle.
@Test
public void testPrebuiltAppleFrameworkCopiedToBundle() throws IOException, InterruptedException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "prebuilt_apple_framework_links", tmp);
workspace.setUp();
ProjectFilesystem filesystem = new ProjectFilesystem(workspace.getDestPath());
BuildTarget target = BuildTargetFactory.newInstance("//app:TestAppBundle#dwarf-and-dsym,include-frameworks");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
Path includedFramework = workspace.getPath(BuildTargets.getGenPath(filesystem, target, "%s")).resolve("TestAppBundle.app").resolve("Frameworks").resolve("BuckTest.framework");
assertTrue(Files.isDirectory(includedFramework));
}
use of com.facebook.buck.io.ProjectFilesystem in project buck by facebook.
the class ArtifactCacheBuckConfigTest method createFromText.
public static ArtifactCacheBuckConfig createFromText(String... lines) throws IOException {
ProjectFilesystem projectFilesystem = new FakeProjectFilesystem();
StringReader reader = new StringReader(Joiner.on('\n').join(lines));
return new ArtifactCacheBuckConfig(BuckConfigTestUtils.createFromReader(reader, projectFilesystem, Architecture.detect(), Platform.detect(), ImmutableMap.copyOf(System.getenv())));
}
Aggregations