Skip to content

Commit fe105da

Browse files
Added support for 'alwaysOutOfDate' PBX Shell Script property
1 parent c491d3a commit fe105da

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/pbxProject.js

+4
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,10 @@ function pbxShellScriptBuildPhaseObj(obj, options, phaseName) {
16441644
obj.shellPath = options.shellPath;
16451645
obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"';
16461646

1647+
if (options.alwaysOutOfDate != null) {
1648+
obj.alwaysOutOfDate = options.alwaysOutOfDate;
1649+
}
1650+
16471651
return obj;
16481652
}
16491653

test/addBuildPhase.js

+22
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,26 @@ exports.addBuildPhase = {
194194
test.equal(buildPhase.shellScript, '"echo \\"hello world!\\""');
195195
test.done();
196196
},
197+
'should add the PBXBuildPhase with alwaysOutOfDate property': function (test) {
198+
var options = {
199+
shellPath: '/bin/sh',
200+
shellScript: 'test',
201+
alwaysOutOfDate: true
202+
};
203+
204+
var buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase;
205+
test.equal(buildPhase.shellPath, '/bin/sh');
206+
test.equal(buildPhase.shellScript, '"test"');
207+
test.equal(buildPhase.alwaysOutOfDate, true);
208+
test.done();
209+
},
210+
'should add the PBXBuildPhase without alwaysOutOfDate property': function (test) {
211+
var options = {shellPath: '/bin/sh', shellScript: 'test'};
212+
213+
var buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase;
214+
test.equal(buildPhase.shellPath, '/bin/sh');
215+
test.equal(buildPhase.shellScript, '"test"');
216+
test.equal(buildPhase.alwaysOutOfDate, null);
217+
test.done();
218+
},
197219
}

0 commit comments

Comments
 (0)