@@ -53,7 +53,7 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
53
53
)
54
54
)
55
55
. concat ( this . getBuildLoggingArgs ( ) )
56
- . concat ( this . getXcodeProjectArgs ( platformData . projectRoot , projectData ) ) ;
56
+ . concat ( this . getXcodeProjectArgs ( platformData , projectData ) ) ;
57
57
58
58
return args ;
59
59
}
@@ -78,7 +78,7 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
78
78
buildConfig . release ? Configurations . Release : Configurations . Debug ,
79
79
"-allowProvisioningUpdates" ,
80
80
]
81
- . concat ( this . getXcodeProjectArgs ( platformData . projectRoot , projectData ) )
81
+ . concat ( this . getXcodeProjectArgs ( platformData , projectData ) )
82
82
. concat ( architectures )
83
83
. concat (
84
84
this . getBuildCommonArgs (
@@ -108,51 +108,43 @@ export class XcodebuildArgsService implements IXcodebuildArgsService {
108
108
}
109
109
110
110
public getXcodeProjectArgs (
111
- projectRoot : string ,
111
+ platformData : IPlatformData ,
112
112
projectData : IProjectData
113
113
) : string [ ] {
114
114
const xcworkspacePath = path . join (
115
- projectRoot ,
115
+ platformData . projectRoot ,
116
116
`${ projectData . projectName } .xcworkspace`
117
117
) ;
118
118
// Introduced in Xcode 14+
119
119
// ref: https://forums.swift.org/t/telling-xcode-14-beta-4-to-trust-build-tool-plugins-programatically/59305/5
120
120
const skipPackageValidation = "-skipPackagePluginValidation" ;
121
121
122
- // TODO:
123
- // 1. make sure file exists
124
- // 2. use ios/visionos based on platform target
122
+ const extraArgs : string [ ] = [
123
+ "-scheme" ,
124
+ projectData . projectName ,
125
+ skipPackageValidation ,
126
+ ] ;
127
+
125
128
const BUILD_SETTINGS_FILE_PATH = path . join (
126
129
projectData . appResourcesDirectoryPath ,
127
- "iOS" ,
130
+ platformData . normalizedPlatformName ,
128
131
constants . BUILD_XCCONFIG_FILE_NAME
129
132
) ;
130
133
134
+ if ( this . $fs . exists ( BUILD_SETTINGS_FILE_PATH ) ) {
135
+ extraArgs . push ( "-xcconfig" ) ;
136
+ extraArgs . push ( BUILD_SETTINGS_FILE_PATH ) ;
137
+ }
138
+
131
139
if ( this . $fs . exists ( xcworkspacePath ) ) {
132
- return [
133
- "-workspace" ,
134
- xcworkspacePath ,
135
- "-scheme" ,
136
- projectData . projectName ,
137
- skipPackageValidation ,
138
- "-xcconfig" ,
139
- BUILD_SETTINGS_FILE_PATH ,
140
- ] ;
140
+ return [ "-workspace" , xcworkspacePath , ...extraArgs ] ;
141
141
}
142
142
143
143
const xcodeprojPath = path . join (
144
- projectRoot ,
144
+ platformData . projectRoot ,
145
145
`${ projectData . projectName } .xcodeproj`
146
146
) ;
147
- return [
148
- "-project" ,
149
- xcodeprojPath ,
150
- "-scheme" ,
151
- projectData . projectName ,
152
- skipPackageValidation ,
153
- "-xcconfig" ,
154
- BUILD_SETTINGS_FILE_PATH ,
155
- ] ;
147
+ return [ "-project" , xcodeprojPath , ...extraArgs ] ;
156
148
}
157
149
158
150
private getBuildLoggingArgs ( ) : string [ ] {
0 commit comments