@@ -217,13 +217,13 @@ pbxProject.prototype.removeFramework = function (fpath, opt) {
217
217
218
218
if ( opt ) {
219
219
if ( opt . customFramework == true ) {
220
- this . removeFromFrameworkSearchPaths ( path . dirname ( fpath ) ) ;
220
+ this . removeFromFrameworkSearchPaths ( file ) ;
221
221
}
222
222
if ( opt . embed == true ) {
223
- this . removePbxFromFrameworksBuildPhase ( file ) ;
223
+ this . removeFromPbxEmbedFrameworksBuildPhase ( file , opt ) ;
224
224
}
225
225
}
226
-
226
+
227
227
return file ;
228
228
}
229
229
@@ -269,10 +269,11 @@ pbxProject.prototype.removeFromPbxBuildFileSection = function (file) {
269
269
if ( this . pbxBuildFileSection ( ) [ uuid ] . fileRef_comment == file . basename ) {
270
270
file . uuid = uuid ;
271
271
delete this . pbxBuildFileSection ( ) [ uuid ] ;
272
+
273
+ var commentKey = f ( "%s_comment" , file . uuid ) ;
274
+ delete this . pbxBuildFileSection ( ) [ commentKey ] ;
272
275
}
273
276
}
274
- var commentKey = f ( "%s_comment" , file . uuid ) ;
275
- delete this . pbxBuildFileSection ( ) [ commentKey ] ;
276
277
}
277
278
278
279
pbxProject . prototype . addToPbxFileReferenceSection = function ( file ) {
@@ -412,21 +413,14 @@ pbxProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) {
412
413
embedFrameworks . files . push ( pbxBuildPhaseObj ( embedFile ) ) ;
413
414
}
414
415
415
- pbxProject . prototype . removeFromPbxEmbedFrameworksBuildPhase = function ( file ) {
416
- var embedFile = new pbxFile ( fpath ) ;
416
+ pbxProject . prototype . removeFromPbxEmbedFrameworksBuildPhase = function ( file , opt ) {
417
+ var embedFile = new pbxFile ( file . path ) ;
417
418
embedFile . group = 'Embed Frameworks' ;
418
419
419
420
var embedFrameworks = this . pbxEmbedFrameworksBuildPhaseObj ( ) ;
420
421
for ( var i in embedFrameworks . files ) {
421
- if ( embedFrameworks . files [ i ] . comment == longComment ( file ) ) {
422
- var uuid = embedFrameworks . files [ i ] . uuid ;
423
- if ( uuid in this . pbxBuildFileSection ( ) ) {
424
- delete this . pbxBuildFileSection ( ) [ uuid ] ;
425
- var commentKey = f ( "%s_comment" , uuid ) ;
426
- delete this . pbxBuildFileSection ( ) [ commentKey ] ;
427
- }
428
-
429
- sources . files . splice ( i , 1 ) ;
422
+ if ( embedFrameworks . files [ i ] . comment == longComment ( file , opt ) ) {
423
+ embedFrameworks . files . splice ( i , 1 ) ;
430
424
break ;
431
425
}
432
426
}
@@ -760,7 +754,10 @@ function pbxFileReferenceComment(file) {
760
754
return file . basename ;
761
755
}
762
756
763
- function longComment ( file ) {
757
+ function longComment ( file , opt ) {
758
+ if ( opt && opt . embed == true ) {
759
+ return f ( "%s in Embed %s" , file . basename , file . group ) ;
760
+ }
764
761
return f ( "%s in %s" , file . basename , file . group ) ;
765
762
}
766
763
0 commit comments