@@ -217,13 +217,13 @@ pbxProject.prototype.removeFramework = function (fpath, opt) {
217217
218218 if ( opt ) {
219219 if ( opt . customFramework == true ) {
220- this . removeFromFrameworkSearchPaths ( path . dirname ( fpath ) ) ;
220+ this . removeFromFrameworkSearchPaths ( file ) ;
221221 }
222222 if ( opt . embed == true ) {
223- this . removePbxFromFrameworksBuildPhase ( file ) ;
223+ this . removeFromPbxEmbedFrameworksBuildPhase ( file , opt ) ;
224224 }
225225 }
226-
226+
227227 return file ;
228228}
229229
@@ -269,10 +269,11 @@ pbxProject.prototype.removeFromPbxBuildFileSection = function (file) {
269269 if ( this . pbxBuildFileSection ( ) [ uuid ] . fileRef_comment == file . basename ) {
270270 file . uuid = uuid ;
271271 delete this . pbxBuildFileSection ( ) [ uuid ] ;
272+
273+ var commentKey = f ( "%s_comment" , file . uuid ) ;
274+ delete this . pbxBuildFileSection ( ) [ commentKey ] ;
272275 }
273276 }
274- var commentKey = f ( "%s_comment" , file . uuid ) ;
275- delete this . pbxBuildFileSection ( ) [ commentKey ] ;
276277}
277278
278279pbxProject . prototype . addToPbxFileReferenceSection = function ( file ) {
@@ -412,21 +413,14 @@ pbxProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) {
412413 embedFrameworks . files . push ( pbxBuildPhaseObj ( embedFile ) ) ;
413414}
414415
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 ) ;
417418 embedFile . group = 'Embed Frameworks' ;
418419
419420 var embedFrameworks = this . pbxEmbedFrameworksBuildPhaseObj ( ) ;
420421 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 ) ;
430424 break ;
431425 }
432426 }
@@ -760,7 +754,10 @@ function pbxFileReferenceComment(file) {
760754 return file . basename ;
761755}
762756
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+ }
764761 return f ( "%s in %s" , file . basename , file . group ) ;
765762}
766763
0 commit comments