-
Notifications
You must be signed in to change notification settings - Fork 7
Add naming strategy option for XCFrameworks #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Only one reviewer per PR, or is it playing with me? 😂 I'll leave comments separately, no worries. |
No - you're right. I've changed it to you - it's first come first serve 😆 |
9254501 to
eca9fb4
Compare
|
Need more time on this one. Feel free to merge if needed. |
| // export async function updateLibraryInstallPathInXCFramework( | ||
| // xcframeworkPath: string | ||
| // ) { | ||
| // for (const file of fs.readdirSync(xcframeworkPath, { | ||
| // withFileTypes: true, | ||
| // recursive: true, | ||
| // })) { | ||
| // if (file.isDirectory() && path.extname(file.name) === ".framework") { | ||
| // const libraryName = path.basename(file.name, ".framework"); | ||
| // const libraryPath = path.join(file.parentPath, file.name, libraryName); | ||
| // assert(fs.existsSync(libraryPath), `Expected library at: ${libraryPath}`); | ||
| // const newInstallName = getLibraryInstallName(xcframeworkPath); | ||
| // await spawn("install_name_tool", ["-id", newInstallName, libraryPath]); | ||
| // } | ||
| // } | ||
| // } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably be deleted, but I'll let it stick around here for a bit longer in case it comes in handy 🙈
|
I'll take what I can get 😉 I plan to merge this EOD. I have the Android support based on this and I'd like to refactor the CLI to have a single "xcframeworks" command with sub-commands, like "list", "copy", etc. I'd also like to get started on setting up CI to build and test all of this 🙏 |
Add an option to choose a naming strategy of XCFrameworks as they're vendored (i.e. copied and renamed) into the host package.
You can choose between two modes:
The option defaults to
package-nameas I believe that strikes the right balance between DX and compatibility with the existing ecosystem og packages shipping Node-API modules (of which the vast majority ships only one per package).You can opt-into the "hash" strategy if you need to, by running
pod installwith an enviroment variable:and setting the
namingoption on the Babel plugin:https://github.com/callstackincubator/react-native-node-api-modules/blob/9254501866f58510efe9c2e202d7feeeb2071ddf/apps/test-app/babel.config.js#L3
What it looks like
With the examples sub-packages renamed to
example-${counter}, this is what it looks like to a dev:Frameworks in Xcode
Frameworks on disk