Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
[Apple] Fix Remove copy standard swift libraries step phase from AppC…
Browse files Browse the repository at this point in the history
…lips bundle. (#2564)

* Remove copy standard swift libraries step phase from AppClips bundle

* Remove unnecessary new line

* Commit to run tests again (flaky test failed)

Co-authored-by: Lucas Marçal <[email protected]>
  • Loading branch information
Lcsmarcal and Lucas Marçal authored Dec 16, 2020
1 parent 3ba8a81 commit 2dfc734
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/com/facebook/buck/apple/AppleBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ public ImmutableList<Step> getBuildSteps(
sdkPath,
lipo,
bundleBinaryPath,
destinations);
destinations,
isAppClip.orElse(false));

for (BuildRule extraBinary : extraBinaries) {
Path outputPath = getBundleBinaryPathForBuildRule(extraBinary);
Expand Down Expand Up @@ -667,7 +668,8 @@ public ImmutableList<Step> getBuildSteps(
sdkPath,
lipo,
bundleBinaryPath,
destinations);
destinations,
isAppClip.orElse(false));
}

// Ensure the bundle directory is archived so we can fetch it later.
Expand Down Expand Up @@ -812,7 +814,8 @@ public void addSwiftStdlibStepIfNeeded(
sdkPath,
lipo,
bundleBinaryPath,
destinations);
destinations,
isAppClip.orElse(false));
}

private void copyAnotherCopyOfWatchKitStub(
Expand Down
4 changes: 3 additions & 1 deletion src/com/facebook/buck/apple/AppleResourceProcessing.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ public static void addSwiftStdlibStepIfNeeded(
Path sdkPath,
Tool lipo,
Path bundleBinaryPath,
AppleBundleDestinations destinations) {
AppleBundleDestinations destinations,
boolean isAppClip) {
// It's apparently safe to run this even on a non-swift bundle (in that case, no libs
// are copied over).
boolean shouldCopySwiftStdlib =
!bundleExtension.equals(AppleBundleExtension.APPEX.toFileExtension())
&& (!bundleExtension.equals(AppleBundleExtension.FRAMEWORK.toFileExtension())
&& !isAppClip
|| copySwiftStdlibToFrameworks);

if (swiftStdlibTool.isPresent() && shouldCopySwiftStdlib) {
Expand Down
2 changes: 2 additions & 0 deletions test/com/facebook/buck/apple/AppleBundleIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,10 @@ public void appClipApplicationBundle() throws IOException {
assertTrue(Files.exists(appPath.resolve("Info.plist")));

Path appClipPath = appPath.resolve("AppClips/Clip.app/");

assertTrue(Files.exists(appClipPath.resolve("Clip")));
assertTrue(Files.exists(appClipPath.resolve("Info.plist")));
assertFalse(Files.exists(appClipPath.resolve("Frameworks")));
}

@Test
Expand Down

0 comments on commit 2dfc734

Please sign in to comment.