use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBinaryIntegrationTest method testAppleBundleDebugFormatRespectsDefaultConfigSettingNoDebug.
@Test
public void testAppleBundleDebugFormatRespectsDefaultConfigSettingNoDebug() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_application_bundle_no_debug", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:DemoApp");
workspace.runBuckCommand("build", "--config", "apple.default_debug_info_format_for_binaries=none", target.getFullyQualifiedName()).assertSuccess();
BuildTarget appTarget = target.withFlavors(AppleDebugFormat.NONE.getFlavor());
assertThat(Files.exists(workspace.getPath(BuildTargets.getGenPath(filesystem, appTarget, "%s").resolve(appTarget.getShortName() + ".app.dSYM").resolve("Contents/Resources/DWARF").resolve(appTarget.getShortName()))), equalTo(false));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class ExternalApplePackageIntegrationTest method usesExternalPackagerAndSetsSdkroot.
@Test
public void usesExternalPackagerAndSetsSdkroot() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "external_apple_package", tmp);
workspace.setUp();
workspace.runBuckBuild("//:FooPackage#iphonesimulator-x86_64").assertSuccess();
assertThat(workspace.getFileContents("buck-out/gen/FooPackage#iphonesimulator-x86_64/FooPackage.omg"), matchesPattern("I AM A BUNDLE FROM .*/iPhoneSimulator\\.sdk .*/FooBundle.app\n"));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBundleIntegrationTest method appBundleWithExtensionBundleDependency.
@Test
public void appBundleWithExtensionBundleDependency() throws IOException {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_app_with_extension", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:DemoAppWithExtension#no-debug");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("targets", "--show-output", target.getFullyQualifiedName());
result.assertSuccess();
Path appPath = BuildTargets.getGenPath(filesystem, BuildTarget.builder(target).addFlavors(AppleDescriptions.NO_INCLUDE_FRAMEWORKS_FLAVOR).build(), "%s").resolve(target.getShortName() + ".app");
assertEquals(String.format("%s %s", target.getFullyQualifiedName(), appPath), result.getStdout().trim());
result = workspace.runBuckCommand("build", target.getFullyQualifiedName());
result.assertSuccess();
assertTrue(Files.exists(workspace.getPath(appPath.resolve("DemoAppWithExtension"))));
assertTrue(Files.exists(workspace.getPath(appPath.resolve("PlugIns/DemoExtension.appex/DemoExtension"))));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBundleIntegrationTest method appleBundleDoesNotPropagateIncludeFrameworkFlavors.
@Test
public void appleBundleDoesNotPropagateIncludeFrameworkFlavors() throws Exception {
assumeTrue(Platform.detect() == Platform.MACOS);
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_app_with_extension", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:DemoAppWithExtension#no-debug");
ProjectWorkspace.ProcessResult result = workspace.runBuckCommand("build", "--show-output", target.getFullyQualifiedName());
result.assertSuccess();
BuckBuildLog buckBuildLog = workspace.getBuildLog();
ImmutableSet<String> targetsThatShouldContainIncludeFrameworkFlavors = ImmutableSet.of("//:DemoAppWithExtension", "//:DemoExtension");
ImmutableSet<Flavor> includeFrameworkFlavors = ImmutableSet.of(InternalFlavor.of("no-include-frameworks"), InternalFlavor.of("include-frameworks"));
for (BuildTarget builtTarget : buckBuildLog.getAllTargets()) {
if (Sets.intersection(builtTarget.getFlavors(), includeFrameworkFlavors).isEmpty()) {
assertThat(builtTarget.getUnflavoredBuildTarget().getFullyQualifiedName(), not(in(targetsThatShouldContainIncludeFrameworkFlavors)));
} else {
assertThat(builtTarget.getUnflavoredBuildTarget().getFullyQualifiedName(), in(targetsThatShouldContainIncludeFrameworkFlavors));
}
}
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace in project buck by facebook.
the class AppleBundleIntegrationTest method simpleApplicationBundleWithCodeSigningAndEntitlements.
@Test
public void simpleApplicationBundleWithCodeSigningAndEntitlements() throws IOException, InterruptedException {
assumeTrue(Platform.detect() == Platform.MACOS);
assumeTrue(FakeAppleDeveloperEnvironment.supportsCodeSigning());
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "simple_application_bundle_with_codesigning_and_entitlements", tmp);
workspace.setUp();
BuildTarget target = BuildTargetFactory.newInstance("//:DemoApp#iphoneos-arm64,no-debug");
workspace.runBuckCommand("build", target.getFullyQualifiedName()).assertSuccess();
workspace.verify(Paths.get("DemoApp_output.expected"), BuildTargets.getGenPath(filesystem, BuildTarget.builder(target).addFlavors(AppleDescriptions.NO_INCLUDE_FRAMEWORKS_FLAVOR).build(), "%s"));
workspace.assertFilesEqual(Paths.get("DemoApp.xcent.expected"), BuildTargets.getScratchPath(filesystem, BuildTarget.builder(target).addFlavors(AppleDescriptions.NO_INCLUDE_FRAMEWORKS_FLAVOR).build(), "%s.xcent"));
Path appPath = workspace.getPath(BuildTargets.getGenPath(filesystem, BuildTarget.builder(target).addFlavors(AppleDescriptions.NO_INCLUDE_FRAMEWORKS_FLAVOR).build(), "%s").resolve(target.getShortName() + ".app"));
assertTrue(Files.exists(appPath.resolve(target.getShortName())));
assertTrue(checkCodeSigning(appPath));
}
Aggregations