@@ -811,7 +811,7 @@ pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
811811 return { uuid : target , target : nativeTargets [ target ] } ;
812812}
813813
814- pbxProject . prototype . addBuildPhase = function ( filePathsArray , buildPhaseType , comment , target , folderType , subfolderPath ) {
814+ pbxProject . prototype . addBuildPhase = function ( filePathsArray , buildPhaseType , comment , target , optionsOrFolderType , subfolderPath ) {
815815 var buildPhaseSection ,
816816 fileReferenceSection = this . pbxFileReferenceSection ( ) ,
817817 buildFileSection = this . pbxBuildFileSection ( ) ,
@@ -827,7 +827,9 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co
827827 filePathToBuildFile = { } ;
828828
829829 if ( buildPhaseType === 'PBXCopyFilesBuildPhase' ) {
830- buildPhase = pbxCopyFilesBuildPhaseObj ( buildPhase , folderType , subfolderPath , comment ) ;
830+ buildPhase = pbxCopyFilesBuildPhaseObj ( buildPhase , optionsOrFolderType , subfolderPath , comment ) ;
831+ } else if ( buildPhaseType === 'PBXShellScriptBuildPhase' ) {
832+ buildPhase = pbxShellScriptBuildPhaseObj ( buildPhase , optionsOrFolderType , comment )
831833 }
832834
833835 if ( ! this . hash . project . objects [ buildPhaseType ] ) {
@@ -1490,7 +1492,7 @@ function pbxBuildPhaseObj(file) {
14901492 return obj ;
14911493}
14921494
1493- function pbxCopyFilesBuildPhaseObj ( obj , folderType , subfolderPath , phaseName ) {
1495+ function pbxCopyFilesBuildPhaseObj ( obj , folderType , subfolderPath , phaseName ) {
14941496
14951497 // Add additional properties for 'CopyFiles' build phase
14961498 var DESTINATION_BY_TARGETTYPE = {
@@ -1527,6 +1529,16 @@ function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName){
15271529 return obj ;
15281530}
15291531
1532+ function pbxShellScriptBuildPhaseObj ( obj , options , phaseName ) {
1533+ obj . name = '"' + phaseName + '"' ;
1534+ obj . inputPaths = options . inputPaths || [ ] ;
1535+ obj . outputPaths = options . outputPaths || [ ] ;
1536+ obj . shellPath = options . shellPath ;
1537+ obj . shellScript = '"' + options . shellScript . replace ( / " / g, '\\"' ) + '"' ;
1538+
1539+ return obj ;
1540+ }
1541+
15301542function pbxBuildFileComment ( file ) {
15311543 return longComment ( file ) ;
15321544}
0 commit comments