@@ -9,6 +9,7 @@ import { isObject, isString } from "./utils.mjs";
99 * @import {
1010 * ApplePlatform,
1111 * JSONObject,
12+ * JSONValue,
1213 * ProjectConfiguration,
1314 * XmlOptions,
1415 * } from "../scripts/types.js";
@@ -32,7 +33,7 @@ export const USER_HEADER_SEARCH_PATHS = "USER_HEADER_SEARCH_PATHS";
3233export const WARNING_CFLAGS = "WARNING_CFLAGS" ;
3334
3435/**
35- * @param {JSONObject } platformConfig
36+ * @param {JSONValue } platformConfig
3637 * @param {ProjectConfiguration } project
3738 * @param {string } projectRoot
3839 * @param {string } destination
@@ -45,7 +46,9 @@ export function applyBuildSettings(
4546 destination ,
4647 fs = nodefs
4748) {
48- const codeSignEntitlements = platformConfig [ "codeSignEntitlements" ] ;
49+ const config = isObject ( platformConfig ) ? platformConfig : { } ;
50+
51+ const codeSignEntitlements = config [ "codeSignEntitlements" ] ;
4952 if ( isString ( codeSignEntitlements ) ) {
5053 const appManifest = findFile ( "app.json" , projectRoot , fs ) ;
5154 if ( ! appManifest ) {
@@ -58,19 +61,19 @@ export function applyBuildSettings(
5861 project . buildSettings [ CODE_SIGN_ENTITLEMENTS ] = relPath ;
5962 }
6063
61- const codeSignIdentity = platformConfig [ "codeSignIdentity" ] ;
64+ const codeSignIdentity = config [ "codeSignIdentity" ] ;
6265 if ( isString ( codeSignIdentity ) ) {
6366 project . buildSettings [ CODE_SIGN_IDENTITY ] = codeSignIdentity ;
6467 }
6568
66- const developmentTeam = platformConfig [ "developmentTeam" ] ;
69+ const developmentTeam = config [ "developmentTeam" ] ;
6770 if ( isString ( developmentTeam ) ) {
6871 project . buildSettings [ DEVELOPMENT_TEAM ] = developmentTeam ;
6972 project . testsBuildSettings [ DEVELOPMENT_TEAM ] = developmentTeam ;
7073 project . uitestsBuildSettings [ DEVELOPMENT_TEAM ] = developmentTeam ;
7174 }
7275
73- const bundleIdentifier = platformConfig [ "bundleIdentifier" ] ;
76+ const bundleIdentifier = config [ "bundleIdentifier" ] ;
7477 if ( isString ( bundleIdentifier ) ) {
7578 project . buildSettings [ PRODUCT_BUNDLE_IDENTIFIER ] = bundleIdentifier ;
7679 project . testsBuildSettings [ PRODUCT_BUNDLE_IDENTIFIER ] =
@@ -79,7 +82,7 @@ export function applyBuildSettings(
7982 `${ bundleIdentifier } UITests` ;
8083 }
8184
82- const buildNumber = platformConfig [ "buildNumber" ] ;
85+ const buildNumber = config [ "buildNumber" ] ;
8386 project . buildSettings [ PRODUCT_BUILD_NUMBER ] =
8487 buildNumber && isString ( buildNumber ) ? buildNumber : "1" ;
8588
@@ -161,7 +164,7 @@ export function applyUserHeaderSearchPaths({ buildSettings }, destination) {
161164 const existingPaths = buildSettings [ USER_HEADER_SEARCH_PATHS ] ;
162165 const searchPaths = Array . isArray ( existingPaths ) ? existingPaths : [ ] ;
163166
164- searchPaths . push ( path . dirname ( destination ) ) ;
167+ searchPaths . push ( path . resolve ( path . dirname ( destination ) ) ) ;
165168
166169 buildSettings [ USER_HEADER_SEARCH_PATHS ] = searchPaths ;
167170}
0 commit comments