added PBXVariantGroup for localization and nodeunit test cases
diff --git a/lib/pbxFile.js b/lib/pbxFile.js
index 67cb6cf..768122a 100644
--- a/lib/pbxFile.js
+++ b/lib/pbxFile.js
@@ -29,7 +29,8 @@
xcdatamodel: 'wrapper.xcdatamodel',
xcodeproj: 'wrapper.pb-project',
xctest: 'wrapper.cfbundle',
- xib: 'file.xib'
+ xib: 'file.xib',
+ strings: 'text.plist.strings'
},
GROUP_BY_FILETYPE = {
'archive.ar': 'Frameworks',
@@ -59,7 +60,8 @@
'text': 4,
'text.plist.xml': 4,
'text.script.sh': 4,
- 'text.xcconfig': 4
+ 'text.xcconfig': 4,
+ 'text.plist.strings': 4
};
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index c568e50..14abeac 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -241,14 +241,21 @@
correctForResourcesPath(file, this);
file.fileRef = this.generateUuid();
}
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
-
+
+ if (!opt.variantGroup) {
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
+ }
+
if (!opt.plugin) {
this.addToPbxFileReferenceSection(file); // PBXFileReference
if (group) {
- this.addToPbxGroup(file, group); //Group other than Resources (i.e. 'splash')
+ if (this.getPBXGroupByKey(group)) {
+ this.addToPbxGroup(file, group); //Group other than Resources (i.e. 'splash')
+ }
+ else if (this.getPBXVariantGroupByKey(group)) {
+ this.addToPbxVariantGroup(file, group); // PBXVariantGroup
+ }
}
else {
this.addToResourcesPbxGroup(file); // PBXGroup
@@ -275,7 +282,12 @@
this.removeFromPbxBuildFileSection(file); // PBXBuildFile
this.removeFromPbxFileReferenceSection(file); // PBXFileReference
if (group) {
- this.removeFromPbxGroup(file, group); //Group other than Resources (i.e. 'splash')
+ if (this.getPBXGroupByKey(group)) {
+ this.removeFromPbxGroup(file, group); //Group other than Resources (i.e. 'splash')
+ }
+ else if (this.getPBXVariantGroupByKey(group)) {
+ this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup
+ }
}
else {
this.removeFromResourcesPbxGroup(file); // PBXGroup
@@ -1696,15 +1708,20 @@
/*** NEW ***/
-pbxProject.prototype.addToPbxGroup = function (file, groupKey) {
- var group = this.getPBXGroupByKey(groupKey);
+pbxProject.prototype.addToPbxGroupType = function (file, groupKey, groupType) {
+ var group = this.getPBXGroupByKeyAndType(groupKey, groupType);
if (group && group.children !== undefined) {
if (typeof file === 'string') {
//Group Key
var childGroup = {
value:file,
- comment: this.getPBXGroupByKey(file).name
};
+ if (this.getPBXGroupByKey(file)) {
+ childGroup.comment = this.getPBXGroupByKey(file).name;
+ }
+ else if (this.getPBXVariantGroupByKey(file)) {
+ childGroup.comment = this.getPBXVariantGroupByKey(file).name;
+ }
group.children.push(childGroup);
}
@@ -1715,8 +1732,53 @@
}
}
-pbxProject.prototype.removeFromPbxGroup = function (file, groupKey) {
- var group = this.getPBXGroupByKey(groupKey);
+pbxProject.prototype.addToPbxVariantGroup = function (file, groupKey) {
+ this.addToPbxGroupType(file, groupKey, 'PBXVariantGroup');
+}
+
+pbxProject.prototype.addToPbxGroup = function (file, groupKey) {
+ this.addToPbxGroupType(file, groupKey, 'PBXGroup');
+}
+
+
+
+pbxProject.prototype.pbxCreateGroupWithType = function(name, pathName, groupType) {
+ //Create object
+ var model = {
+ isa: '"' + groupType + '"',
+ children: [],
+ name: name,
+ sourceTree: '"<group>"'
+ };
+ if (pathName) model.path = pathName;
+ var key = this.generateUuid();
+
+ //Create comment
+ var commendId = key + '_comment';
+
+ //add obj and commentObj to groups;
+ var groups = this.hash.project.objects[groupType];
+ if (!groups) {
+ groups = this.hash.project.objects[groupType] = new Object();
+ }
+ groups[commendId] = name;
+ groups[key] = model;
+
+ return key;
+}
+
+pbxProject.prototype.pbxCreateVariantGroup = function(name) {
+ return this.pbxCreateGroupWithType(name, undefined, 'PBXVariantGroup')
+}
+
+pbxProject.prototype.pbxCreateGroup = function(name, pathName) {
+ return this.pbxCreateGroupWithType(name, pathName, 'PBXGroup');
+}
+
+
+
+pbxProject.prototype.removeFromPbxGroupAndType = function (file, groupKey, groupType) {
+ var group = this.getPBXGroupByKeyAndType(groupKey, groupType);
if (group) {
var groupChildren = group.children, i;
for(i in groupChildren) {
@@ -1729,12 +1791,32 @@
}
}
+pbxProject.prototype.removeFromPbxGroup = function (file, groupKey) {
+ this.removeFromPbxGroupAndType(file, groupKey, 'PBXGroup');
+}
+
+pbxProject.prototype.removeFromPbxVariantGroup = function (file, groupKey) {
+ this.removeFromPbxGroupAndType(file, groupKey, 'PBXVariantGroup');
+}
+
+
+
+pbxProject.prototype.getPBXGroupByKeyAndType = function(key, groupType) {
+ return this.hash.project.objects[groupType][key];
+};
+
pbxProject.prototype.getPBXGroupByKey = function(key) {
return this.hash.project.objects['PBXGroup'][key];
};
-pbxProject.prototype.findPBXGroupKey = function(criteria) {
- var groups = this.hash.project.objects['PBXGroup'];
+pbxProject.prototype.getPBXVariantGroupByKey = function(key) {
+ return this.hash.project.objects['PBXVariantGroup'][key];
+};
+
+
+
+pbxProject.prototype.findPBXGroupKeyAndType = function(criteria, groupType) {
+ var groups = this.hash.project.objects[groupType];
var target;
for (var key in groups) {
@@ -1765,29 +1847,31 @@
return target;
}
-pbxProject.prototype.pbxCreateGroup = function(name, pathName) {
-
- //Create object
- var model = {
- isa:"PBXGroup",
- children: [],
- name: name,
- path: pathName,
- sourceTree: '"<group>"'
- };
- var key = this.generateUuid();
-
- //Create comment
- var commendId = key + '_comment';
-
- //add obj and commentObj to groups;
- var groups = this.hash.project.objects['PBXGroup'];
- groups[commendId] = name;
- groups[key] = model;
-
- return key;
+pbxProject.prototype.findPBXGroupKey = function(criteria) {
+ return this.findPBXGroupKeyAndType(criteria, 'PBXGroup');
}
+pbxProject.prototype.findPBXVariantGroupKey = function(criteria) {
+ return this.findPBXGroupKeyAndType(criteria, 'PBXVariantGroup');
+}
+
+pbxProject.prototype.addLocalizationVariantGroup = function(name) {
+ var groupKey = this.pbxCreateVariantGroup(name);
+
+ var resourceGroupKey = this.findPBXGroupKey({name: 'Resources'});
+ this.addToPbxGroup(groupKey, resourceGroupKey);
+
+ var localizationVariantGroup = {
+ uuid: this.generateUuid(),
+ fileRef: groupKey,
+ basename: name
+ }
+ this.addToPbxBuildFileSection(localizationVariantGroup); // PBXBuildFile
+ this.addToPbxResourcesBuildPhase(localizationVariantGroup); //PBXResourcesBuildPhase
+
+ return localizationVariantGroup;
+};
+
pbxProject.prototype.getPBXObject = function(name) {
return this.hash.project.objects[name];
@@ -1804,7 +1888,13 @@
file.fileRef = this.generateUuid();
this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPbxGroup(file, group); // PBXGroup
+
+ if (this.getPBXGroupByKey(group)) {
+ this.addToPbxGroup(file, group); // PBXGroup
+ }
+ else if (this.getPBXVariantGroupByKey(group)) {
+ this.addToPbxVariantGroup(file, group); // PBXVariantGroup
+ }
return file;
}
@@ -1813,7 +1903,13 @@
var file = new pbxFile(path, opt);
this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromPbxGroup(file, group); // PBXGroup
+
+ if (this.getPBXGroupByKey(group)) {
+ this.removeFromPbxGroup(file, group); // PBXGroup
+ }
+ else if (this.getPBXVariantGroupByKey(group)) {
+ this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup
+ }
return file;
}
diff --git a/test/addResourceFile.js b/test/addResourceFile.js
index e464ecd..3959efb 100644
--- a/test/addResourceFile.js
+++ b/test/addResourceFile.js
@@ -210,6 +210,22 @@
test.done();
}
},
+ 'when added with { variantGroup: true }': {
+
+ 'should not add to the PBXResourcesBuildPhase and PBXBuildFile': function (test) {
+ var newFile = proj.addResourceFile('en.lproj/Localization.strings',
+ { variantGroup: true });
+
+ var sources = proj.pbxResourcesBuildPhaseObj();
+ test.equal(sources.files.length, 12);
+
+ var buildFileSection = proj.pbxBuildFileSection();
+ test.ok(buildFileSection[newFile.uuid] === undefined);
+
+ test.done();
+ },
+
+ },
'duplicate entries': {
'should return false': function (test) {
var newFile = proj.addResourceFile('Plugins/assets.bundle');
diff --git a/test/parser/projects/variantgroup.pbxproj b/test/parser/projects/variantgroup.pbxproj
new file mode 100644
index 0000000..0e7eac2
--- /dev/null
+++ b/test/parser/projects/variantgroup.pbxproj
@@ -0,0 +1,589 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
+ 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
+ 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; };
+ 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
+ 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
+ 305D5FD1115AB8F900A74A75 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 305D5FD0115AB8F900A74A75 /* MobileCoreServices.framework */; };
+ 3088BBBD154F3926009F9C59 /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */; };
+ 3088BBBE154F3926009F9C59 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */; };
+ 3088BBBF154F3926009F9C59 /* Default-Portrait@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */; };
+ 3088BBC0154F3926009F9C59 /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */; };
+ 3088BBC1154F3926009F9C59 /* Default@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */; };
+ 3088BBC2154F3926009F9C59 /* Default~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 3088BBBC154F3926009F9C59 /* Default~iphone.png */; };
+ 308D05371370CCF300D202BF /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D052E1370CCF300D202BF /* icon-72.png */; };
+ 308D05381370CCF300D202BF /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D052F1370CCF300D202BF /* icon.png */; };
+ 308D05391370CCF300D202BF /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 308D05301370CCF300D202BF /* icon@2x.png */; };
+ 30B4F30019D5E07200D9F7D8 /* Default-667h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F2FD19D5E07200D9F7D8 /* Default-667h.png */; };
+ 30B4F30119D5E07200D9F7D8 /* Default-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F2FE19D5E07200D9F7D8 /* Default-736h.png */; };
+ 30B4F30219D5E07200D9F7D8 /* Default-Landscape-736h.png in Resources */ = {isa = PBXBuildFile; fileRef = 30B4F2FF19D5E07200D9F7D8 /* Default-Landscape-736h.png */; };
+ 30C1856619D5FC0A00212699 /* icon-60@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30C1856519D5FC0A00212699 /* icon-60@3x.png */; };
+ 30FC414916E50CA1004E6F35 /* icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 30FC414816E50CA1004E6F35 /* icon-72@2x.png */; };
+ 5B1594DD16A7569C00FEF299 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B1594DC16A7569C00FEF299 /* AssetsLibrary.framework */; };
+ 7E7966DE1810823500FA85AD /* icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D41810823500FA85AD /* icon-40.png */; };
+ 7E7966DF1810823500FA85AD /* icon-40@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D51810823500FA85AD /* icon-40@2x.png */; };
+ 7E7966E01810823500FA85AD /* icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D61810823500FA85AD /* icon-50.png */; };
+ 7E7966E11810823500FA85AD /* icon-50@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D71810823500FA85AD /* icon-50@2x.png */; };
+ 7E7966E21810823500FA85AD /* icon-60.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D81810823500FA85AD /* icon-60.png */; };
+ 7E7966E31810823500FA85AD /* icon-60@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966D91810823500FA85AD /* icon-60@2x.png */; };
+ 7E7966E41810823500FA85AD /* icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DA1810823500FA85AD /* icon-76.png */; };
+ 7E7966E51810823500FA85AD /* icon-76@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DB1810823500FA85AD /* icon-76@2x.png */; };
+ 7E7966E61810823500FA85AD /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DC1810823500FA85AD /* icon-small.png */; };
+ 7E7966E71810823500FA85AD /* icon-small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DD1810823500FA85AD /* icon-small@2x.png */; };
+ D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; };
+ 07E3BDBD1DF1DEA500E49912 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 07E3BDBF1DF1DEAF00E49912 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = "<group>"; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = D2AAC07E0554694100DB518D;
+ remoteInfo = CordovaLib;
+ };
+ 301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
+ remoteInfo = CordovaLib;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 1D6058910D05DD3D006BFB54 /* HelloCordova.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloCordova.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1F766FDD13BBADB100FB74C0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
+ 1F766FE013BBADB100FB74C0 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Localizable.strings; sourceTree = "<group>"; };
+ 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = "CordovaLib/CordovaLib.xcodeproj"; sourceTree = "<group>"; };
+ 301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
+ 302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
+ 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
+ 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
+ 305D5FD0115AB8F900A74A75 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
+ 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; };
+ 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; };
+ 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x~ipad.png"; sourceTree = "<group>"; };
+ 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; };
+ 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x~iphone.png"; sourceTree = "<group>"; };
+ 3088BBBC154F3926009F9C59 /* Default~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default~iphone.png"; sourceTree = "<group>"; };
+ 308D052E1370CCF300D202BF /* icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72.png"; sourceTree = "<group>"; };
+ 308D052F1370CCF300D202BF /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
+ 308D05301370CCF300D202BF /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = "<group>"; };
+ 30B4F2FD19D5E07200D9F7D8 /* Default-667h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-667h.png"; sourceTree = "<group>"; };
+ 30B4F2FE19D5E07200D9F7D8 /* Default-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h.png"; sourceTree = "<group>"; };
+ 30B4F2FF19D5E07200D9F7D8 /* Default-Landscape-736h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape-736h.png"; sourceTree = "<group>"; };
+ 30C1856519D5FC0A00212699 /* icon-60@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-60@3x.png"; sourceTree = "<group>"; };
+ 30FC414816E50CA1004E6F35 /* icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-72@2x.png"; sourceTree = "<group>"; };
+ 32CA4F630368D1EE00C91783 /* HelloCordova-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HelloCordova-Prefix.pch"; sourceTree = "<group>"; };
+ 5B1594DC16A7569C00FEF299 /* AssetsLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; };
+ 7E7966D41810823500FA85AD /* icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-40.png"; sourceTree = "<group>"; };
+ 7E7966D51810823500FA85AD /* icon-40@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-40@2x.png"; sourceTree = "<group>"; };
+ 7E7966D61810823500FA85AD /* icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-50.png"; sourceTree = "<group>"; };
+ 7E7966D71810823500FA85AD /* icon-50@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-50@2x.png"; sourceTree = "<group>"; };
+ 7E7966D81810823500FA85AD /* icon-60.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-60.png"; sourceTree = "<group>"; };
+ 7E7966D91810823500FA85AD /* icon-60@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-60@2x.png"; sourceTree = "<group>"; };
+ 7E7966DA1810823500FA85AD /* icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-76.png"; sourceTree = "<group>"; };
+ 7E7966DB1810823500FA85AD /* icon-76@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-76@2x.png"; sourceTree = "<group>"; };
+ 7E7966DC1810823500FA85AD /* icon-small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small.png"; sourceTree = "<group>"; };
+ 7E7966DD1810823500FA85AD /* icon-small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-small@2x.png"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* HelloCordova-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "HelloCordova-Info.plist"; path = "../HelloCordova-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+ D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x~iphone.png"; sourceTree = "<group>"; };
+ EB87FDF21871DA7A0020F90C /* merges */ = {isa = PBXFileReference; lastKnownFileType = folder; name = merges; path = ../../merges; sourceTree = "<group>"; };
+ EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
+ EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
+ F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "HelloCordova/config.xml"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5B1594DD16A7569C00FEF299 /* AssetsLibrary.framework in Frameworks */,
+ 301BF552109A68D80062928A /* libCordova.a in Frameworks */,
+ 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */,
+ 305D5FD1115AB8F900A74A75 /* MobileCoreServices.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 302D95EE14D2391D003F00A1 /* MainViewController.h */,
+ 302D95EF14D2391D003F00A1 /* MainViewController.m */,
+ 302D95F014D2391D003F00A1 /* MainViewController.xib */,
+ 1D3623240D0F684500981E51 /* AppDelegate.h */,
+ 1D3623250D0F684500981E51 /* AppDelegate.m */,
+ );
+ name = Classes;
+ path = "HelloCordova/Classes";
+ sourceTree = SOURCE_ROOT;
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* HelloCordova.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ EB87FDF41871DAF40020F90C /* config.xml */,
+ EB87FDF31871DA8E0020F90C /* www */,
+ EB87FDF21871DA7A0020F90C /* merges */,
+ EB87FDF11871DA420020F90C /* Staging */,
+ 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */,
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 307C750510C5A3420062BCA9 /* Plugins */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* HelloCordova-Prefix.pch */,
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ path = "HelloCordova";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 308D052D1370CCF300D202BF /* icons */,
+ 308D05311370CCF300D202BF /* splash */,
+ 8D1107310486CEB800E47090 /* HelloCordova-Info.plist */,
+ );
+ name = Resources;
+ path = "HelloCordova/Resources";
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 5B1594DC16A7569C00FEF299 /* AssetsLibrary.framework */,
+ 288765FC0DF74451002DB57D /* CoreGraphics.framework */,
+ 305D5FD0115AB8F900A74A75 /* MobileCoreServices.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 301BF52E109A57CC0062928A /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 301BF535109A57CC0062928A /* libCordova.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 307C750510C5A3420062BCA9 /* Plugins */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Plugins;
+ path = "HelloCordova/Plugins";
+ sourceTree = SOURCE_ROOT;
+ };
+ 308D052D1370CCF300D202BF /* icons */ = {
+ isa = PBXGroup;
+ children = (
+ 30C1856519D5FC0A00212699 /* icon-60@3x.png */,
+ 7E7966D41810823500FA85AD /* icon-40.png */,
+ 7E7966D51810823500FA85AD /* icon-40@2x.png */,
+ 7E7966D61810823500FA85AD /* icon-50.png */,
+ 7E7966D71810823500FA85AD /* icon-50@2x.png */,
+ 7E7966D81810823500FA85AD /* icon-60.png */,
+ 7E7966D91810823500FA85AD /* icon-60@2x.png */,
+ 7E7966DA1810823500FA85AD /* icon-76.png */,
+ 7E7966DB1810823500FA85AD /* icon-76@2x.png */,
+ 7E7966DC1810823500FA85AD /* icon-small.png */,
+ 7E7966DD1810823500FA85AD /* icon-small@2x.png */,
+ 30FC414816E50CA1004E6F35 /* icon-72@2x.png */,
+ 308D052E1370CCF300D202BF /* icon-72.png */,
+ 308D052F1370CCF300D202BF /* icon.png */,
+ 308D05301370CCF300D202BF /* icon@2x.png */,
+ );
+ path = icons;
+ sourceTree = "<group>";
+ };
+ 308D05311370CCF300D202BF /* splash */ = {
+ isa = PBXGroup;
+ children = (
+ 30B4F2FD19D5E07200D9F7D8 /* Default-667h.png */,
+ 30B4F2FE19D5E07200D9F7D8 /* Default-736h.png */,
+ 30B4F2FF19D5E07200D9F7D8 /* Default-Landscape-736h.png */,
+ D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */,
+ 3088BBB7154F3926009F9C59 /* Default-Landscape@2x~ipad.png */,
+ 3088BBB8154F3926009F9C59 /* Default-Landscape~ipad.png */,
+ 3088BBB9154F3926009F9C59 /* Default-Portrait@2x~ipad.png */,
+ 3088BBBA154F3926009F9C59 /* Default-Portrait~ipad.png */,
+ 3088BBBB154F3926009F9C59 /* Default@2x~iphone.png */,
+ 3088BBBC154F3926009F9C59 /* Default~iphone.png */,
+ );
+ path = splash;
+ sourceTree = "<group>";
+ };
+ EB87FDF11871DA420020F90C /* Staging */ = {
+ isa = PBXGroup;
+ children = (
+ F840E1F0165FE0F500CFE078 /* config.xml */,
+ 301BF56E109A69640062928A /* www */,
+ );
+ name = Staging;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXVariantGroup section */
+07E3BDBC1DF1DEA500E49912 /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 07E3BDBD1DF1DEA500E49912 /* en */,
+ 07E3BDBF1DF1DEAF00E49912 /* ja */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* HelloCordova */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloCordova" */;
+ buildPhases = (
+ 304B58A110DAC018002A0835 /* Copy www directory */,
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 301BF551109A68C00062928A /* PBXTargetDependency */,
+ );
+ name = "HelloCordova";
+ productName = "HelloCordova";
+ productReference = 1D6058910D05DD3D006BFB54 /* HelloCordova.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0510;
+ };
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__CLI__" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ en,
+ es,
+ de,
+ se,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 301BF52E109A57CC0062928A /* Products */;
+ ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* HelloCordova */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 301BF535109A57CC0062928A /* libCordova.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libCordova.a;
+ remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E7966E41810823500FA85AD /* icon-76.png in Resources */,
+ 7E7966DF1810823500FA85AD /* icon-40@2x.png in Resources */,
+ 308D05371370CCF300D202BF /* icon-72.png in Resources */,
+ 30B4F30119D5E07200D9F7D8 /* Default-736h.png in Resources */,
+ 308D05381370CCF300D202BF /* icon.png in Resources */,
+ 308D05391370CCF300D202BF /* icon@2x.png in Resources */,
+ 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */,
+ 7E7966E01810823500FA85AD /* icon-50.png in Resources */,
+ 7E7966E31810823500FA85AD /* icon-60@2x.png in Resources */,
+ 7E7966E61810823500FA85AD /* icon-small.png in Resources */,
+ 3088BBBD154F3926009F9C59 /* Default-Landscape@2x~ipad.png in Resources */,
+ 3088BBBE154F3926009F9C59 /* Default-Landscape~ipad.png in Resources */,
+ 3088BBBF154F3926009F9C59 /* Default-Portrait@2x~ipad.png in Resources */,
+ 7E7966E71810823500FA85AD /* icon-small@2x.png in Resources */,
+ 3088BBC0154F3926009F9C59 /* Default-Portrait~ipad.png in Resources */,
+ 30B4F30019D5E07200D9F7D8 /* Default-667h.png in Resources */,
+ 7E7966DE1810823500FA85AD /* icon-40.png in Resources */,
+ 3088BBC1154F3926009F9C59 /* Default@2x~iphone.png in Resources */,
+ 7E7966E21810823500FA85AD /* icon-60.png in Resources */,
+ 3088BBC2154F3926009F9C59 /* Default~iphone.png in Resources */,
+ D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */,
+ 30B4F30219D5E07200D9F7D8 /* Default-Landscape-736h.png in Resources */,
+ 30C1856619D5FC0A00212699 /* icon-60@3x.png in Resources */,
+ 7E7966E11810823500FA85AD /* icon-50@2x.png in Resources */,
+ 7E7966E51810823500FA85AD /* icon-76@2x.png in Resources */,
+ 30FC414916E50CA1004E6F35 /* icon-72@2x.png in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 304B58A110DAC018002A0835 /* Copy www directory */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Copy www directory";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "cordova/lib/copy-www-build-step.sh";
+ showEnvVarsInLog = 0;
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
+ 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
+ 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 301BF551109A68C00062928A /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = CordovaLib;
+ targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "HelloCordova/HelloCordova-Prefix.pch";
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = "";
+ INFOPLIST_FILE = "HelloCordova/HelloCordova-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ OTHER_LDFLAGS = (
+ "-weak_framework",
+ CoreFoundation,
+ "-weak_framework",
+ UIKit,
+ "-weak_framework",
+ AVFoundation,
+ "-weak_framework",
+ CoreMedia,
+ "-weak-lSystem",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "HelloCordova";
+ TARGETED_DEVICE_FAMILY = "1";
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "HelloCordova/HelloCordova-Prefix.pch";
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = "";
+ INFOPLIST_FILE = "HelloCordova/HelloCordova-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ OTHER_LDFLAGS = (
+ "-weak_framework",
+ CoreFoundation,
+ "-weak_framework",
+ UIKit,
+ "-weak_framework",
+ AVFoundation,
+ "-weak_framework",
+ CoreMedia,
+ "-weak-lSystem",
+ "-ObjC",
+ );
+ PRODUCT_NAME = "HelloCordova";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = "";
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
+ "\"$(OBJROOT)/UninstalledProducts/include\"",
+ "\"$(BUILT_PRODUCTS_DIR)\"",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = (
+ "-weak_framework",
+ CoreFoundation,
+ "-weak_framework",
+ UIKit,
+ "-weak_framework",
+ AVFoundation,
+ "-weak_framework",
+ CoreMedia,
+ "-weak-lSystem",
+ "-ObjC",
+ );
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = NO;
+ USER_HEADER_SEARCH_PATHS = "";
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_THUMB_SUPPORT = NO;
+ GCC_VERSION = "";
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "\"$(TARGET_BUILD_DIR)/usr/local/lib/include\"",
+ "\"$(OBJROOT)/UninstalledProducts/include\"",
+ "\"$(BUILT_PRODUCTS_DIR)\"",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ OTHER_LDFLAGS = (
+ "-weak_framework",
+ CoreFoundation,
+ "-weak_framework",
+ UIKit,
+ "-weak_framework",
+ AVFoundation,
+ "-weak_framework",
+ CoreMedia,
+ "-weak-lSystem",
+ "-ObjC",
+ );
+ SDKROOT = iphoneos;
+ SKIP_INSTALL = NO;
+ USER_HEADER_SEARCH_PATHS = "";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "HelloCordova" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "__CLI__" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/test/variantGroup.js b/test/variantGroup.js
new file mode 100644
index 0000000..4b3733e
--- /dev/null
+++ b/test/variantGroup.js
@@ -0,0 +1,177 @@
+var pbx = require('../lib/pbxProject'),
+ project,
+ projectHash;
+
+var findChildInGroup = function(obj, target) {
+ var found = false;
+
+ for (var i = 0, j = obj.children.length; i < j; i++) {
+ if (obj.children[i].value === target) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+}
+
+var findFileByUUID = function(obj, target) {
+ var found = false;
+
+ for (var k = 0, l = obj.files.length; k < l; k++) {
+ if (obj.files[k].value === target) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+}
+
+var findByFileRef = function(obj, target) {
+ var found = false;
+
+ for (var property in obj) {
+ if (!/comment/.test(property)) {
+ if (obj[property].fileRef === target) {
+ found = true;
+ break;
+ }
+ }
+ }
+ return found;
+}
+
+var findByName = function(obj, target) {
+ var found = false;
+ for (var property in obj) {
+ if (!/comment/.test(property)) {
+ var value = obj[property];
+ if (value.name === target) {
+ found = true;
+ }
+ }
+ }
+ return found;
+}
+
+exports.setUp = function(callback) {
+ project = new pbx('test/parser/projects/variantgroup.pbxproj');
+ projectHash = project.parseSync();
+ callback();
+}
+
+exports.getVariantGroupByKey = {
+ 'should return PBXVariantGroup for Localizable.strings': function(test) {
+ var groupKey = project.findPBXVariantGroupKey({name: 'Localizable.strings'});
+ var group = project.getPBXVariantGroupByKey(groupKey);
+ test.ok(group.name === 'Localizable.strings');
+ test.done();
+ }
+}
+
+exports.createVariantGroup = {
+ 'should create a new Test Variant Group': function(test) {
+ delete project.getPBXObject('PBXVariantGroup');
+
+ var found = false;
+ var groups = project.getPBXObject('PBXVariantGroup');
+
+ var found = findByName(groups, 'Test');
+ test.ok(found === false);
+
+ var group = project.findPBXVariantGroupKey({name:'Test'});
+ test.ok(group === undefined);
+
+ project.pbxCreateVariantGroup('Test');
+
+ groups = project.getPBXObject('PBXVariantGroup');
+ found = findByName(groups, 'Test');
+ test.ok(found === true);
+
+ group = project.findPBXVariantGroupKey({name:'Test'});
+ test.ok(typeof group === 'string');
+ test.done();
+ }
+}
+
+exports.findVariantGroupKey = {
+ 'should return a valid group key':function(test) {
+ var keyByName = project.findPBXVariantGroupKey({ name: 'Localizable.strings'});
+ var nonExistingKey = project.findPBXVariantGroupKey({ name: 'Foo'});
+
+ test.ok(keyByName === '07E3BDBC1DF1DEA500E49912');
+ test.ok(nonExistingKey === undefined);
+
+ test.done();
+ }
+}
+
+exports.createLocalisationVariantGroup = {
+ 'should create a new localisation variationgroup then add group to Resources group': function(test) {
+ delete project.getPBXObject('PBXVariantGroup');
+
+ var localizationVariantGp = project.addLocalizationVariantGroup('InfoPlist.strings');
+
+ var resourceGroupKey = project.findPBXGroupKey({name: 'Resources'});
+ var resourceGroup = project.getPBXGroupByKey(resourceGroupKey);
+ var foundInResourcesGroup = findChildInGroup(resourceGroup, localizationVariantGp.fileRef );
+ test.ok(foundInResourcesGroup);
+
+ var foundInResourcesBuildPhase = false;
+ var sources = project.pbxResourcesBuildPhaseObj();
+ for (var i = 0, j = sources.files.length; i < j; i++) {
+ var file = sources.files[i];
+ if (file.value === localizationVariantGp.uuid) {
+ foundInResourcesBuildPhase = true;
+ }
+ }
+ test.ok(foundInResourcesBuildPhase);
+
+ test.done();
+ }
+}
+
+exports.addResourceFileToLocalisationGroup = {
+ 'should add resource file to the TestVariantGroup group' : function(test) {
+
+ var infoPlistVarGp = project.addLocalizationVariantGroup('InfoPlist.strings');
+ var testKey = infoPlistVarGp.fileRef;
+ var file = project.addResourceFile('Resources/en.lproj/Localization.strings', {variantGroup: true}, testKey);
+
+ var foundInLocalisationVariantGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey), file.fileRef );
+ test.ok(foundInLocalisationVariantGroup);
+
+ var foundInResourcesBuildPhase = false;
+ var sources = project.pbxResourcesBuildPhaseObj();
+ for (var i = 0, j = sources.files.length; i < j; i++) {
+ var sourceFile = sources.files[i];
+ if (sourceFile.value === file.fileRef) {
+ foundInResourcesBuildPhase = true;
+ }
+ }
+ test.ok(!foundInResourcesBuildPhase);
+
+ var buildFileSection = project.pbxBuildFileSection();
+ test.ok(buildFileSection[file.uuid] === undefined);
+
+ test.done();
+ }
+}
+
+exports.removeResourceFileFromGroup = {
+ 'should add resource file then remove resource file from Localizable.strings group' : function(test) {
+ var testKey = project.findPBXVariantGroupKey({name:'Localizable.strings'});
+ var file = project.addResourceFile('Resources/zh.lproj/Localization.strings', {}, testKey);
+
+ var foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey),file.fileRef );
+ test.ok(foundInGroup);
+
+ project.removeResourceFile('Resources/zh.lproj/Localization.strings', {}, testKey);
+
+ var foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey),file.fileRef );
+ test.ok(!foundInGroup);
+
+ test.done();
+ }
+}
\ No newline at end of file