-
Notifications
You must be signed in to change notification settings - Fork 7
Make react-native-node-api-cmake spawn async and add spinners
#8
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
Changes from all commits
a833785
38d9e31
578dc69
2d63089
5a78b57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .DS_Store | ||
|
|
||
| node_modules/ | ||
| dist/ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| *.hprof | ||
| *.xcworkspace/ | ||
| *.zip | ||
| .DS_Store | ||
| .gradle/ | ||
| .idea/ | ||
| .vs/ | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import fs from "node:fs"; | |
| import path from "node:path"; | ||
|
|
||
| import type { SupportedTriplet } from "./triplets.js"; | ||
| import { spawn } from "bufout"; | ||
|
|
||
| export const APPLE_TRIPLETS = [ | ||
| "arm64;x86_64-apple-darwin", | ||
|
|
@@ -123,7 +124,6 @@ export function getAppleBuildArgs() { | |
| } | ||
|
|
||
| type XCframeworkOptions = { | ||
| libraryPaths: string[]; | ||
| frameworkPaths: string[]; | ||
| outputPath: string; | ||
| }; | ||
|
|
@@ -168,8 +168,7 @@ export function createFramework(libraryPath: string) { | |
| return frameworkPath; | ||
| } | ||
|
|
||
| export function createXCframework({ | ||
| libraryPaths, | ||
| export async function createXCframework({ | ||
| frameworkPaths, | ||
| outputPath, | ||
| }: XCframeworkOptions) { | ||
|
|
@@ -178,20 +177,18 @@ export function createXCframework({ | |
| // Ideally, it would only be necessary to delete the specific platform+arch, to allow selectively building from source. | ||
| fs.rmSync(outputPath, { recursive: true, force: true }); | ||
|
|
||
| const { status } = cp.spawnSync( | ||
| await spawn( | ||
| "xcodebuild", | ||
| [ | ||
| "-create-xcframework", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Is there a real use-case for using
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right - I'll remove that. It was likely a leftover from my copying out of this file 😬 |
||
| ...libraryPaths.flatMap((p) => ["-library", p]), | ||
| ...frameworkPaths.flatMap((p) => ["-framework", p]), | ||
| "-output", | ||
| outputPath, | ||
| ], | ||
| { | ||
| stdio: "inherit", | ||
| outputMode: "buffered", | ||
| } | ||
| ); | ||
| assert.equal(status, 0, "Failed to create xcframework"); | ||
| // Write a file to mark the xcframework is a Node-API module | ||
| // TODO: Consider including this in the Info.plist file instead | ||
| fs.writeFileSync( | ||
|
|
||
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.
Nit: Is this empty call on purpose or accidental leftover?
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.
On purpose - I wanted a bit of space to separate the executions 🙂