@@ -702,7 +702,7 @@ pbxProject.prototype.removePbxGroupByKey = function(groupKey, path) {
702
702
if ( ! group ) {
703
703
return ;
704
704
}
705
-
705
+
706
706
path = path || "" ;
707
707
var children = group . children ;
708
708
@@ -1064,7 +1064,7 @@ pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
1064
1064
containerPortal : this . hash . project [ 'rootObject' ] ,
1065
1065
containerPortal_comment : this . hash . project [ 'rootObject_comment' ] ,
1066
1066
proxyType : 1 ,
1067
- remoteGlobalIDString : dependencyTargetUuid ,
1067
+ remoteGlobalIDString : dependencyTargetUuid ,
1068
1068
remoteInfo : nativeTargets [ dependencyTargetUuid ] . name
1069
1069
} ,
1070
1070
targetDependency = {
@@ -1087,6 +1087,35 @@ pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
1087
1087
return { uuid : target , target : nativeTargets [ target ] } ;
1088
1088
}
1089
1089
1090
+ pbxProject . prototype . removeBuildPhase = function ( comment , target ) { // Build phase files should be removed separately
1091
+ var buildPhaseUuid = undefined ,
1092
+ buildPhaseTargetUuid = target || this . getFirstTarget ( ) . uuid
1093
+
1094
+ if ( this . hash . project . objects [ 'PBXNativeTarget' ] [ buildPhaseTargetUuid ] [ 'buildPhases' ] ) {
1095
+ let phases = this . hash . project . objects [ 'PBXNativeTarget' ] [ buildPhaseTargetUuid ] [ 'buildPhases' ] ;
1096
+ for ( let i = 0 ; i < phases . length ; i ++ ) {
1097
+ const phase = phases [ i ] ;
1098
+ if ( phase . comment === comment ) {
1099
+ buildPhaseUuid = phase . value ;
1100
+ let commentKey = f ( "%s_comment" , buildPhaseUuid )
1101
+ if ( this . hash . project . objects [ 'PBXCopyFilesBuildPhase' ] ) {
1102
+ let phase = this . hash . project . objects [ 'PBXCopyFilesBuildPhase' ] [ commentKey ]
1103
+ delete phase
1104
+ }
1105
+
1106
+ if ( this . hash . project . objects [ 'PBXShellScriptBuildPhase' ] ) {
1107
+ let phase = this . hash . project . objects [ 'PBXShellScriptBuildPhase' ] [ commentKey ]
1108
+ delete phase
1109
+ }
1110
+
1111
+ phases . splice ( i , 1 ) ;
1112
+ }
1113
+ }
1114
+
1115
+ }
1116
+
1117
+ }
1118
+
1090
1119
pbxProject . prototype . addBuildPhase = function ( filePathsArray , buildPhaseType , comment , target , optionsOrFolderType , subfolderPath ) {
1091
1120
var buildPhaseSection ,
1092
1121
fileReferenceSection = this . pbxFileReferenceSection ( ) ,
0 commit comments