Skip to content

Setup Package.swift to consume the binaries#49435

Closed
cipolleschi wants to merge 3 commits into
facebook:mainfrom
cipolleschi:export-D69660943
Closed

Setup Package.swift to consume the binaries#49435
cipolleschi wants to merge 3 commits into
facebook:mainfrom
cipolleschi:export-D69660943

Conversation

@cipolleschi
Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi commented Feb 14, 2025

Summary:
This change adds a Package.swift file that allows to consume the binary from a local path.

As soon as we publish this on Maven, we will update the path to the url.

Changelog:

[Internal] - Add the Package.swift file to consume the binary

Differential Revision: D69660943

Test Plan

Tested in a sample app.

Just created a Sample App from Xcode, and renamed the ViewController. m --> ViewController.mm

Then I added the package dependency through the Package Dependencies tab in Xcode

Screenshot 2025-02-14 at 16 50 25

I modified Target's header search path to point to:

${BUILD_DIR}/${CONFIGURATION}-${PLATFORM_NAME}/ReactNativeDependencies.framework/Headers
Screenshot 2025-02-14 at 16 49 09

After this step, it works flawlessly:

Screenshot 2025-02-14 at 14 20 29

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Feb 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D69660943

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D69660943

Summary:

This change adds the logic to copy the Headers files from the dependency folder to the generated frameworks folder.

There is a slight possibility that this function will be implemented by the Swift PM build system, as I open [this question](https://forums.swift.org/t/xcodebuild-does-not-generate-headers-if-the-source-is-swift-pm/77856) on the Swift forums.

In that case, we would be able to drop this.

## Changelog:
[Internal] - Add function to copy headers over to the .frameworks

Reviewed By: cortinico

Differential Revision: D69656046
Summary:

This change adds a function to create the xcframework sarting from the various .framework's slice built before.

## Changelog:
[Internal] - Add function to create the xcframework

Differential Revision: D69660662
Summary:

This change adds a Package.swift file that allows to consume the binary from a local path.

As soon as we publish this on Maven, we will update the path to the url.

## Changelog:
[Internal] - Add the Package.swift file to consume the binary

Reviewed By: cortinico

Differential Revision: D69660943
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D69660943

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 11e53c0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants