@@ -318,9 +318,8 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
318
318
isa : 'PBXGroup' ,
319
319
children : [ ] ,
320
320
name : name ,
321
- path : path ,
322
321
sourceTree : sourceTree ? sourceTree : '"<group>"'
323
- } ,
322
+ } , //path is mandatory only for the main group
324
323
fileReferenceSection = this . pbxFileReferenceSection ( ) ,
325
324
filePathToReference = { } ;
326
325
@@ -335,6 +334,7 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
335
334
}
336
335
337
336
for ( var index = 0 ; index < filePathsArray . length ; index ++ ) {
337
+
338
338
var filePath = filePathsArray [ index ] ,
339
339
filePathQuoted = "\"" + filePath + "\"" ;
340
340
if ( filePathToReference [ filePath ] ) {
@@ -345,7 +345,8 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
345
345
continue ;
346
346
}
347
347
348
- var file = new pbxFile ( filePath ) ;
348
+ var srcRootPath = $path . join ( this . filepath , "../.." ) ;
349
+ var file = new pbxFile ( $path . relative ( srcRootPath , filePath ) ) ;
349
350
if ( fs . lstatSync ( filePath ) . isDirectory ( ) ) {
350
351
file . uuid = this . generateUuid ( ) ;
351
352
file . fileRef = file . uuid ;
@@ -375,7 +376,7 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
375
376
if ( opt . isMain ) {
376
377
let mainGroup = this . findMainPbxGroup ( ) ;
377
378
if ( mainGroup ) {
378
- var file = new pbxFile ( pbxGroup . path ) ;
379
+ var file = new pbxFile ( $path . relative ( this . filepath , path ) ) ;
379
380
file . fileRef = pbxGroupUuid ;
380
381
mainGroup . children . push ( pbxGroupChild ( file ) ) ;
381
382
}
0 commit comments