cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [35/50] [abbrv] cordova-node-xcode git commit: Adding and removing knownRegions to/from PBXProject section
Date Tue, 11 Apr 2017 21:04:57 GMT
Adding and removing knownRegions to/from PBXProject section


Project: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/commit/92b4acd7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/tree/92b4acd7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/diff/92b4acd7

Branch: refs/heads/master
Commit: 92b4acd7a6c467a624ead304fb94c7435e3e5f44
Parents: 59506f1
Author: John Warmann <john.warmann@gmail.com>
Authored: Fri Dec 16 18:57:10 2016 -0500
Committer: John Warmann <john.warmann@gmail.com>
Committed: Fri Dec 16 18:57:10 2016 -0500

----------------------------------------------------------------------
 lib/pbxProject.js | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-node-xcode/blob/92b4acd7/lib/pbxProject.js
----------------------------------------------------------------------
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index b86fff4..6468a83 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -1872,6 +1872,39 @@ pbxProject.prototype.addLocalizationVariantGroup = function(name) {
     return localizationVariantGroup;
 };
 
+pbxProject.prototype.addKnownRegion = function (name) {
+  if (!this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions']) {
+    this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'] = [];
+  }
+  if (!this.hasKnownRegion(name)) {
+    this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'].push(name);
+  }
+}
+
+pbxProject.prototype.removeKnownRegion = function (name) {
+  var regions = this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'];
+  if (regions) {
+    for (var i = 0; i < regions.length; i++) {
+      if (regions[i] === name) {
+        regions.splice(i, 1);
+        break;
+      }
+    }
+    this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'] = regions;
+  }
+}
+
+pbxProject.prototype.hasKnownRegion = function (name) {
+  var regions = this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'];
+  if (regions) {
+    for (var i in regions) {
+      if (regions[i] === name) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
 
 pbxProject.prototype.getPBXObject = function(name) {
     return this.hash.project.objects[name];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message