@@ -19,7 +19,7 @@ var util = require('util'),
19
19
f = util . format ,
20
20
EventEmitter = require ( 'events' ) . EventEmitter ,
21
21
$path = require ( 'path' ) ,
22
- uuid = require ( 'uuid' ) ,
22
+ $ uuid = require ( 'uuid' ) ,
23
23
fork = require ( 'child_process' ) . fork ,
24
24
pbxWriter = require ( './pbxWriter' ) ,
25
25
pbxFile = require ( './pbxFile' ) . pbxFile ,
@@ -91,7 +91,7 @@ pbxProject.prototype.allUuids = function() {
91
91
}
92
92
93
93
pbxProject . prototype . generateUuid = function ( ) {
94
- var id = uuid . v4 ( )
94
+ var id = $ uuid. v4 ( )
95
95
. replace ( / - / g, '' )
96
96
. substr ( 0 , 24 )
97
97
. toUpperCase ( )
@@ -482,19 +482,19 @@ pbxProject.prototype.addToPbxBuildFileSection = function(file) {
482
482
}
483
483
484
484
pbxProject . prototype . removeFromPbxBuildFileSection = function ( file ) {
485
- var uuid ;
485
+ var fileUuid ;
486
486
487
- for ( uuid in this . pbxBuildFileSection ( ) ) {
488
- if ( this . pbxBuildFileSection ( ) [ uuid ] . fileRef_comment == file . basename ) {
489
- file . uuid = uuid ;
490
- this . removeFromPbxBuildFileSectionByUuid ( uuid ) ;
487
+ for ( fileUuid in this . pbxBuildFileSection ( ) ) {
488
+ if ( this . pbxBuildFileSection ( ) [ fileUuid ] . fileRef_comment == file . basename ) {
489
+ file . uuid = fileUuid ;
490
+ this . removeFromPbxBuildFileSectionByUuid ( fileUuid ) ;
491
491
}
492
492
}
493
493
}
494
494
495
- pbxProject . prototype . removeFromPbxBuildFileSectionByUuid = function ( uuid ) {
495
+ pbxProject . prototype . removeFromPbxBuildFileSectionByUuid = function ( itemUuid ) {
496
496
var buildSection = this . pbxBuildFileSection ( ) ;
497
- removeItemAndCommentFromSectionByUuid ( buildSection , uuid ) ;
497
+ removeItemAndCommentFromSectionByUuid ( buildSection , itemUuid ) ;
498
498
}
499
499
500
500
pbxProject . prototype . findMainPbxGroup = function ( ) {
@@ -1639,8 +1639,8 @@ pbxProject.prototype.removeTarget = function(target, targetKey) {
1639
1639
1640
1640
//remove files from all build phases from PBXBuildFile section
1641
1641
for ( let k = 0 ; k < files . length ; k ++ ) {
1642
- const uuid = files [ k ] . value ;
1643
- this . removeFromPbxBuildFileSectionByUuid ( uuid ) ;
1642
+ const fileUuid = files [ k ] . value ;
1643
+ this . removeFromPbxBuildFileSectionByUuid ( fileUuid ) ;
1644
1644
}
1645
1645
1646
1646
//remove target from the project itself
@@ -1712,7 +1712,7 @@ pbxProject.prototype.removeTarget = function(target, targetKey) {
1712
1712
removeItemAndCommentFromSectionByUuid ( pbxCopySection , copyPhaseId ) ;
1713
1713
} else {
1714
1714
//if there are other files in the copy phase, just remove the product
1715
- copyPhase . files ( p , 1 ) ;
1715
+ copyPhase . files . splice ( p , 1 ) ;
1716
1716
}
1717
1717
break ;
1718
1718
}
@@ -1769,10 +1769,10 @@ pbxProject.prototype.removeTarget = function(target, targetKey) {
1769
1769
this . removePbxGroup ( unquote ( target . name ) ) ;
1770
1770
} ;
1771
1771
1772
- function removeItemAndCommentFromSectionByUuid ( section , uuid ) {
1773
- var commentKey = f ( "%s_comment" , uuid )
1772
+ function removeItemAndCommentFromSectionByUuid ( section , itemUuid ) {
1773
+ var commentKey = f ( "%s_comment" , itemUuid )
1774
1774
delete section [ commentKey ] ;
1775
- delete section [ uuid ] ;
1775
+ delete section [ itemUuid ] ;
1776
1776
}
1777
1777
1778
1778
// helper recursive prop search+replace
0 commit comments