diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 1133940..79ff2cc 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1644,6 +1644,10 @@ function pbxShellScriptBuildPhaseObj(obj, options, phaseName) { obj.shellPath = options.shellPath; obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"'; + if (options.alwaysOutOfDate !== null) { + obj.alwaysOutOfDate = options.alwaysOutOfDate; + } + return obj; } diff --git a/test/addBuildPhase.js b/test/addBuildPhase.js index eb105f8..c1ace69 100644 --- a/test/addBuildPhase.js +++ b/test/addBuildPhase.js @@ -194,4 +194,26 @@ exports.addBuildPhase = { test.equal(buildPhase.shellScript, '"echo \\"hello world!\\""'); test.done(); }, + 'should add the PBXBuildPhase with alwaysOutOfDate property': function (test) { + var options = { + shellPath: '/bin/sh', + shellScript: 'test', + alwaysOutOfDate: true + }; + + var buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase; + test.equal(buildPhase.shellPath, '/bin/sh'); + test.equal(buildPhase.shellScript, '"test"'); + test.equal(buildPhase.alwaysOutOfDate, 1); + test.done(); + }, + 'should add the PBXBuildPhase without alwaysOutOfDate property': function (test) { + var options = {shellPath: '/bin/sh', shellScript: 'test'}; + + var buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase; + test.equal(buildPhase.shellPath, '/bin/sh'); + test.equal(buildPhase.shellScript, '"test"'); + test.equal(buildPhase.alwaysOutOfDate, null); + test.done(); + }, }