@@ -230,7 +230,7 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) {
230230 file = this . addPluginFile ( path , opt ) ;
231231 if ( ! file ) return false ;
232232 } else {
233- file = new pbxFile ( path , opt ) ;
233+ file = new pbxFile ( path , opt ) ;
234234 if ( this . hasFile ( file . path ) ) return false ;
235235 }
236236
@@ -241,10 +241,10 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) {
241241 correctForResourcesPath ( file , this ) ;
242242 file . fileRef = this . generateUuid ( ) ;
243243 }
244-
244+
245245 this . addToPbxBuildFileSection ( file ) ; // PBXBuildFile
246246 this . addToPbxResourcesBuildPhase ( file ) ; // PBXResourcesBuildPhase
247-
247+
248248 if ( ! opt . plugin ) {
249249 this . addToPbxFileReferenceSection ( file ) ; // PBXFileReference
250250 if ( group ) {
@@ -253,9 +253,9 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) {
253253 else {
254254 this . addToResourcesPbxGroup ( file ) ; // PBXGroup
255255 }
256-
256+
257257 }
258-
258+
259259 return file ;
260260}
261261
@@ -279,7 +279,7 @@ pbxProject.prototype.removeResourceFile = function(path, opt, group) {
279279 }
280280 else {
281281 this . removeFromResourcesPbxGroup ( file ) ; // PBXGroup
282- }
282+ }
283283 this . removeFromPbxResourcesBuildPhase ( file ) ; // PBXResourcesBuildPhase
284284
285285 return file ;
@@ -1906,5 +1906,16 @@ pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) {
19061906 return file ;
19071907}
19081908
1909+ pbxProject . prototype . addTargetAttribute = function ( prop , value , target ) {
1910+ var attributes = this . getFirstProject ( ) [ 'firstProject' ] [ 'attributes' ] ;
1911+ if ( attributes [ 'TargetAttributes' ] === undefined ) {
1912+ attributes [ 'TargetAttributes' ] = { } ;
1913+ }
1914+ target = target || this . getFirstTarget ( ) ;
1915+ if ( attributes [ 'TargetAttributes' ] [ target . uuid ] === undefined ) {
1916+ attributes [ 'TargetAttributes' ] [ target . uuid ] = { } ;
1917+ }
1918+ attributes [ 'TargetAttributes' ] [ target . uuid ] [ prop ] = value ;
1919+ }
19091920
19101921module . exports = pbxProject ;
0 commit comments