Skip to content

Commit

Permalink
Added support for 'alwaysOutOfDate' PBX Shell Script property
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-saia-datadog committed Jul 8, 2024
1 parent c491d3a commit ddde70a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/pbxProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
22 changes: 22 additions & 0 deletions test/addBuildPhase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
}

0 comments on commit ddde70a

Please sign in to comment.