diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 9a2f5ed..b22c6cb 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1682,6 +1682,29 @@ pbxProject.prototype.getFirstTarget = function() { } } +//Returns an array of objects containing the uuid and target +pbxProject.prototype.getAllTargets = function() { + //Holds all target json information + var targets = []; + + //Get raw target info + var targetUuids = this.getFirstProject()['firstProject']['targets']; + + //for each target index + for (var uuid in targetUuids) { + var uuidValue = uuid.value; + var target = this.pbxNativeTargetSection()[uuidValue]; + + targets.push({ + uuid: uuidValue, + target: target + }); + } + + return targets; + +} + /*** NEW ***/ pbxProject.prototype.addToPbxGroup = function (file, groupKey) {