@@ -155,8 +155,14 @@ const xcframeworkExtensionOption = new Option(
155155 "Don't rename the xcframework to .apple.node" ,
156156) . default ( false ) ;
157157
158+ const appleBundleIdentifierOption = new Option (
159+ "--apple-bundle-identifier <id>" ,
160+ "Unique CFBundleIdentifier used for Apple framework artifacts" ,
161+ ) . default ( undefined , "com.callstackincubator.node-api.{libraryName}" ) ;
162+
158163type AppleOpts = {
159164 xcframeworkExtension : boolean ;
165+ appleBundleIdentifier ?: string ;
160166} ;
161167
162168function getBuildPath ( baseBuildPath : string , triplet : Triplet ) {
@@ -233,7 +239,9 @@ export const platform: Platform<Triplet[], AppleOpts> = {
233239 }
234240 } ,
235241 amendCommand ( command ) {
236- return command . addOption ( xcframeworkExtensionOption ) ;
242+ return command
243+ . addOption ( xcframeworkExtensionOption )
244+ . addOption ( appleBundleIdentifierOption ) ;
237245 } ,
238246 async configure (
239247 triplets ,
@@ -284,7 +292,10 @@ export const platform: Platform<Triplet[], AppleOpts> = {
284292 } ) ,
285293 ) ;
286294 } ,
287- async build ( { spawn, triplet } , { build, target, configuration } ) {
295+ async build (
296+ { spawn, triplet } ,
297+ { build, target, configuration, appleBundleIdentifier } ,
298+ ) {
288299 // We expect the final application to sign these binaries
289300 if ( target . length > 1 ) {
290301 throw new Error ( "Building for multiple targets is not supported yet" ) ;
@@ -368,10 +379,11 @@ export const platform: Platform<Triplet[], AppleOpts> = {
368379 "Expected exactly one artifact" ,
369380 ) ;
370381 const [ artifact ] = artifacts ;
371- await createAppleFramework (
372- path . join ( buildPath , artifact . path ) ,
373- triplet . endsWith ( "-darwin" ) ,
374- ) ;
382+ await createAppleFramework ( {
383+ libraryPath : path . join ( buildPath , artifact . path ) ,
384+ versioned : triplet . endsWith ( "-darwin" ) ,
385+ bundleIdentifier : appleBundleIdentifier ,
386+ } ) ;
375387 }
376388 } ,
377389 isSupportedByHost : function ( ) : boolean | Promise < boolean > {
0 commit comments