From f40b91c0fee574efe664e727fd51cce4391994ed Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 9 Aug 2016 20:40:05 -0700 Subject: [PATCH] Added getAllTargets() --- lib/pbxProject.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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) {