@@ -13,7 +13,8 @@ import { injector } from "../common/yok";
13
13
export class IOSNativeTargetService implements IIOSNativeTargetService {
14
14
constructor (
15
15
protected $fs : IFileSystem ,
16
- protected $pbxprojDomXcode : IPbxprojDomXcode
16
+ protected $pbxprojDomXcode : IPbxprojDomXcode ,
17
+ protected $logger : ILogger
17
18
) { }
18
19
19
20
public addTargetToProject (
@@ -141,19 +142,51 @@ export class IOSNativeTargetService implements IIOSNativeTargetService {
141
142
targetUuid
142
143
) ;
143
144
}
145
+ const properties : IXcodeTargetBuildConfigurationProperty [ ] = [ ] ;
144
146
147
+ // Set for both release and debug
145
148
if ( configurationJson . targetBuildConfigurationProperties ) {
146
- const properties : IXcodeTargetBuildConfigurationProperty [ ] = [ ] ;
147
149
_ . forEach (
148
150
configurationJson . targetBuildConfigurationProperties ,
149
151
( value , name : string ) => properties . push ( { value, name } )
150
152
) ;
151
- this . setXcodeTargetBuildConfigurationProperties (
152
- properties ,
153
- targetName ,
154
- project
153
+ }
154
+
155
+ if ( configurationJson . targetNamedBuildConfigurationProperties ) {
156
+ _ . forEach (
157
+ configurationJson . targetNamedBuildConfigurationProperties ,
158
+ ( value , name : string ) => {
159
+ var buildName : BuildNames = null ;
160
+ switch ( name ) {
161
+ case "debug" : {
162
+ buildName = BuildNames . debug ;
163
+ break ;
164
+ }
165
+ case "release" : {
166
+ buildName = BuildNames . release ;
167
+ break ;
168
+ }
169
+ default : {
170
+ this . $logger . warn (
171
+ "Ignoring targetNamedBuildConfigurationProperties: %s. Only 'release', 'debug' are allowed." ,
172
+ name
173
+ ) ;
174
+ }
175
+ }
176
+ if ( buildName ) {
177
+ _ . forEach ( value , ( value , name : string ) =>
178
+ properties . push ( { value, name, buildNames : [ buildName ] } )
179
+ ) ;
180
+ }
181
+ }
155
182
) ;
156
183
}
184
+
185
+ this . setXcodeTargetBuildConfigurationProperties (
186
+ properties ,
187
+ targetName ,
188
+ project
189
+ ) ;
157
190
}
158
191
}
159
192
}
0 commit comments