Merge pull request #1 from alunny/master
merge latest updates into mcgrews3-fork
diff --git a/lib/pbxFile.js b/lib/pbxFile.js
index 4431f0d..ed6a56d 100644
--- a/lib/pbxFile.js
+++ b/lib/pbxFile.js
@@ -94,9 +94,14 @@
}
function detectGroup(fileRef) {
- var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
+ var extension = path.extname(fileRef.basename).substring(1),
+ filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
groupName = GROUP_BY_FILETYPE[unquoted(filetype)];
+ if (extension === 'xcdatamodeld') {
+ return 'Sources';
+ }
+
if (!groupName) {
return DEFAULT_GROUP;
}
@@ -105,18 +110,18 @@
}
function detectSourcetree(fileRef) {
-
+
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
sourcetree = SOURCETREE_BY_FILETYPE[unquoted(filetype)];
if (fileRef.explicitFileType) {
return DEFAULT_PRODUCT_SOURCETREE;
}
-
+
if (fileRef.customFramework) {
return DEFAULT_SOURCETREE;
}
-
+
if (!sourcetree) {
return DEFAULT_SOURCETREE;
}
@@ -131,7 +136,7 @@
if (fileRef.customFramework) {
return filePath;
}
-
+
if (defaultPath) {
return path.join(defaultPath, path.basename(filePath));
}
@@ -151,23 +156,22 @@
function pbxFile(filepath, opt) {
var opt = opt || {};
-
+
self = this;
+ this.basename = path.basename(filepath);
this.lastKnownFileType = opt.lastKnownFileType || detectType(filepath);
this.group = detectGroup(self);
// for custom frameworks
if (opt.customFramework == true) {
this.customFramework = true;
- this.dirname = path.dirname(filepath);
+ this.dirname = path.dirname(filepath).replace(/\\/g, '/');
}
- this.basename = path.basename(filepath);
- this.path = defaultPath(this, filepath);
+ this.path = defaultPath(this, filepath).replace(/\\/g, '/');
this.fileEncoding = this.defaultEncoding = opt.defaultEncoding || defaultEncoding(self);
-
// When referencing products / build output files
if (opt.explicitFileType) {
this.explicitFileType = opt.explicitFileType;
@@ -189,6 +193,14 @@
this.settings = {};
this.settings.COMPILER_FLAGS = util.format('"%s"', opt.compilerFlags);
}
+
+ if (opt.sign) {
+ if (!this.settings)
+ this.settings = {};
+ if (!this.settings.ATTRIBUTES)
+ this.settings.ATTRIBUTES = [];
+ this.settings.ATTRIBUTES.push('CodeSignOnCopy');
+ }
}
module.exports = pbxFile;
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index 833a9bc..da05245 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -1,1599 +1,1844 @@
-var util = require('util'),
- f = util.format,
- EventEmitter = require('events').EventEmitter,
- path = require('path'),
- uuid = require('node-uuid'),
- fork = require('child_process').fork,
- pbxWriter = require('./pbxWriter'),
- pbxFile = require('./pbxFile'),
- fs = require('fs'),
- parser = require('./parser/pbxproj'),
- COMMENT_KEY = /_comment$/
-
-function pbxProject(filename) {
- if (!(this instanceof pbxProject))
- return new pbxProject(filename);
-
- this.filepath = path.resolve(filename)
-}
-
-util.inherits(pbxProject, EventEmitter)
-
-pbxProject.prototype.parse = function(cb) {
- var worker = fork(__dirname + '/parseJob.js', [this.filepath])
-
- worker.on('message', function(msg) {
- if (msg.name == 'SyntaxError' || msg.code) {
- this.emit('error', msg);
- } else {
- this.hash = msg;
- this.emit('end', null, msg)
- }
- }.bind(this));
-
- if (cb) {
- this.on('error', cb);
- this.on('end', cb);
- }
-
- return this;
-}
-
-pbxProject.prototype.parseSync = function() {
- var file_contents = fs.readFileSync(this.filepath, 'utf-8');
-
- this.hash = parser.parse(file_contents);
- return this;
-}
-
-pbxProject.prototype.writeSync = function() {
- this.writer = new pbxWriter(this.hash);
- return this.writer.writeSync();
-}
-
-pbxProject.prototype.allUuids = function() {
- var sections = this.hash.project.objects,
- uuids = [],
- section;
-
- for (key in sections) {
- section = sections[key]
- uuids = uuids.concat(Object.keys(section))
- }
-
- uuids = uuids.filter(function(str) {
- return !COMMENT_KEY.test(str) && str.length == 24;
- });
-
- return uuids;
-}
-
-pbxProject.prototype.generateUuid = function() {
- var id = uuid.v4()
- .replace(/-/g, '')
- .substr(0, 24)
- .toUpperCase()
-
- if (this.allUuids().indexOf(id) >= 0) {
- return this.generateUuid();
- } else {
- return id;
- }
-}
-
-pbxProject.prototype.addPluginFile = function(path, opt) {
- var file = new pbxFile(path, opt);
-
- file.plugin = true; // durr
- correctForPluginsPath(file, this);
-
- // null is better for early errors
- if (this.hasFile(file.path)) return null;
-
- file.fileRef = this.generateUuid();
-
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPluginsPbxGroup(file); // PBXGroup
-
- return file;
-}
-
-pbxProject.prototype.removePluginFile = function(path, opt) {
- var file = new pbxFile(path, opt);
- correctForPluginsPath(file, this);
-
- this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromPluginsPbxGroup(file); // PBXGroup
-
- return file;
-}
-
-pbxProject.prototype.addProductFile = function(targetPath, opt) {
- var file = new pbxFile(targetPath, opt);
-
- file.includeInIndex = 0;
- file.fileRef = this.generateUuid();
- file.target = opt ? opt.target : undefined;
- file.group = opt ? opt.group : undefined;
- file.uuid = this.generateUuid();
- file.path = file.basename;
-
- this.addToPbxFileReferenceSection(file);
- this.addToProductsPbxGroup(file); // PBXGroup
-
- return file;
-}
-
-pbxProject.prototype.removeProductFile = function(path, opt) {
- var file = new pbxFile(path, opt);
-
- this.removeFromProductsPbxGroup(file); // PBXGroup
-
- return file;
-}
-
-/**
- *
- * @param path {String}
- * @param opt {Object} see pbxFile for avail options
- * @param group {String} group key
- * @returns {Object} file; see pbxFile
- */
-pbxProject.prototype.addSourceFile = function (path, opt, group) {
- var file;
- if (group) {
- file = this.addFile(path, group, opt);
- }
- else {
- file = this.addPluginFile(path, opt);
- }
-
- if (!file) return false;
-
- file.target = opt ? opt.target : undefined;
- file.uuid = this.generateUuid();
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase
-
- return file;
-}
-
-/**
- *
- * @param path {String}
- * @param opt {Object} see pbxFile for avail options
- * @param group {String} group key
- * @returns {Object} file; see pbxFile
- */
-pbxProject.prototype.removeSourceFile = function (path, opt, group) {
- var file;
- if (group) {
- file = this.removeFile(path, group, opt);
- }
- else {
- file = this.removePluginFile(path, opt);
- }
- file.target = opt ? opt.target : undefined;
- this.removeFromPbxBuildFileSection(file); // PBXBuildFile
- this.removeFromPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase
-
- return file;
-}
-
-/**
- *
- * @param path {String}
- * @param opt {Object} see pbxFile for avail options
- * @param group {String} group key
- * @returns {Object} file; see pbxFile
- */
-pbxProject.prototype.addHeaderFile = function (path, opt, group) {
- if (group) {
- return this.addFile(path, group, opt);
- }
- else {
- return this.addPluginFile(path, opt);
- }
-}
-
-/**
- *
- * @param path {String}
- * @param opt {Object} see pbxFile for avail options
- * @param group {String} group key
- * @returns {Object} file; see pbxFile
- */
-pbxProject.prototype.removeHeaderFile = function (path, opt, group) {
- if (group) {
- return this.removeFile(path, group, opt);
- }
- else {
- return this.removePluginFile(path, opt);
- }
-}
-
-pbxProject.prototype.addResourceFile = function(path, opt) {
- opt = opt || {};
-
- var file;
-
- if (opt.plugin) {
- file = this.addPluginFile(path, opt);
- if (!file) return false;
- } else {
- file = new pbxFile(path, opt);
- if (this.hasFile(file.path)) return false;
- }
-
- file.uuid = this.generateUuid();
- file.target = opt ? opt.target : undefined;
-
- if (!opt.plugin) {
- correctForResourcesPath(file, this);
- file.fileRef = this.generateUuid();
- }
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
-
- if (!opt.plugin) {
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToResourcesPbxGroup(file); // PBXGroup
- }
-
- return file;
-}
-
-pbxProject.prototype.removeResourceFile = function(path, opt) {
- var file = new pbxFile(path, opt);
- file.target = opt ? opt.target : undefined;
-
- correctForResourcesPath(file, this);
-
- this.removeFromPbxBuildFileSection(file); // PBXBuildFile
- this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromResourcesPbxGroup(file); // PBXGroup
- this.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
-
- return file;
-}
-
-pbxProject.prototype.addFramework = function(fpath, opt) {
-
- var file = new pbxFile(fpath, opt);
-
- file.uuid = this.generateUuid();
- file.fileRef = this.generateUuid();
- file.target = opt ? opt.target : undefined;
-
- if (this.hasFile(file.path)) return false;
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToFrameworksPbxGroup(file); // PBXGroup
- this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
-
- if (opt && opt.customFramework == true) {
- this.addToFrameworkSearchPaths(file);
- }
-
- return file;
-}
-
-pbxProject.prototype.removeFramework = function(fpath, opt) {
- var file = new pbxFile(fpath, opt);
- file.target = opt ? opt.target : undefined;
-
- this.removeFromPbxBuildFileSection(file); // PBXBuildFile
- this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromFrameworksPbxGroup(file); // PBXGroup
- this.removeFromPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
-
- if (opt && opt.customFramework) {
- this.removeFromFrameworkSearchPaths(path.dirname(fpath));
- }
-
- return file;
-}
-
-
-pbxProject.prototype.addCopyfile = function(fpath, opt) {
- var file = new pbxFile(fpath, opt);
-
- // catch duplicates
- if (this.hasFile(file.path)) {
- file = this.hasFile(file.path);
- }
-
- file.fileRef = file.uuid = this.generateUuid();
- file.target = opt ? opt.target : undefined;
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPbxCopyfilesBuildPhase(file); // PBXCopyFilesBuildPhase
-
- return file;
-}
-
-pbxProject.prototype.pbxCopyfilesBuildPhaseObj = function(target) {
- return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', target);
-}
-
-pbxProject.prototype.addToPbxCopyfilesBuildPhase = function(file) {
- var sources = this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', file.target);
- sources.files.push(pbxBuildPhaseObj(file));
-}
-
-pbxProject.prototype.removeCopyfile = function(fpath, opt) {
- var file = new pbxFile(fpath, opt);
- file.target = opt ? opt.target : undefined;
-
- this.removeFromPbxBuildFileSection(file); // PBXBuildFile
- this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromPbxCopyfilesBuildPhase(file); // PBXFrameworksBuildPhase
-
- return file;
-}
-
-pbxProject.prototype.removeFromPbxCopyfilesBuildPhase = function(file) {
- var sources = this.pbxCopyfilesBuildPhaseObj(file.target);
- for (i in sources.files) {
- if (sources.files[i].comment == longComment(file)) {
- sources.files.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addStaticLibrary = function(path, opt) {
- opt = opt || {};
-
- var file;
-
- if (opt.plugin) {
- file = this.addPluginFile(path, opt);
- if (!file) return false;
- } else {
- file = new pbxFile(path, opt);
- if (this.hasFile(file.path)) return false;
- }
-
- file.uuid = this.generateUuid();
- file.target = opt ? opt.target : undefined;
-
- if (!opt.plugin) {
- file.fileRef = this.generateUuid();
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- }
-
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
- this.addToLibrarySearchPaths(file); // make sure it gets built!
-
- return file;
-}
-
-// helper addition functions
-pbxProject.prototype.addToPbxBuildFileSection = function(file) {
- var commentKey = f("%s_comment", file.uuid);
-
- this.pbxBuildFileSection()[file.uuid] = pbxBuildFileObj(file);
- this.pbxBuildFileSection()[commentKey] = pbxBuildFileComment(file);
-}
-
-pbxProject.prototype.removeFromPbxBuildFileSection = function(file) {
- var uuid;
-
- for (uuid in this.pbxBuildFileSection()) {
- if (this.pbxBuildFileSection()[uuid].fileRef_comment == file.basename) {
- file.uuid = uuid;
- delete this.pbxBuildFileSection()[uuid];
- }
- }
- var commentKey = f("%s_comment", file.uuid);
- delete this.pbxBuildFileSection()[commentKey];
-}
-
-pbxProject.prototype.addPbxGroup = function(filePathsArray, name, path, sourceTree) {
- var groups = this.hash.project.objects['PBXGroup'],
- pbxGroupUuid = this.generateUuid(),
- commentKey = f("%s_comment", pbxGroupUuid),
- pbxGroup = {
- isa: 'PBXGroup',
- children: [],
- name: name,
- path: path,
- sourceTree: sourceTree ? sourceTree : '"<group>"'
- },
- fileReferenceSection = this.pbxFileReferenceSection(),
- filePathToReference = {};
-
- for (var key in fileReferenceSection) {
- // only look for comments
- if (!COMMENT_KEY.test(key)) continue;
-
- var fileReferenceKey = key.split(COMMENT_KEY)[0],
- fileReference = fileReferenceSection[fileReferenceKey];
-
- filePathToReference[fileReference.path] = { fileRef: fileReferenceKey, basename: fileReferenceSection[key] };
- }
-
- for (var index = 0; index < filePathsArray.length; index++) {
- var filePath = filePathsArray[index],
- filePathQuoted = "\"" + filePath + "\"";
- if (filePathToReference[filePath]) {
- pbxGroup.children.push(pbxGroupChild(filePathToReference[filePath]));
- continue;
- } else if (filePathToReference[filePathQuoted]) {
- pbxGroup.children.push(pbxGroupChild(filePathToReference[filePathQuoted]));
- continue;
- }
-
- var file = new pbxFile(filePath);
- file.uuid = this.generateUuid();
- file.fileRef = this.generateUuid();
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- pbxGroup.children.push(pbxGroupChild(file));
- }
-
- if (groups) {
- groups[pbxGroupUuid] = pbxGroup;
- groups[commentKey] = name;
- }
-
- return { uuid: pbxGroupUuid, pbxGroup: pbxGroup };
-}
-
-pbxProject.prototype.addToPbxProjectSection = function(target) {
-
- var newTarget = {
- value: target.uuid,
- comment: pbxNativeTargetComment(target.pbxNativeTarget)
- };
-
- this.pbxProjectSection()[this.getFirstProject()['uuid']]['targets'].push(newTarget);
-}
-
-pbxProject.prototype.addToPbxNativeTargetSection = function(target) {
- var commentKey = f("%s_comment", target.uuid);
-
- this.pbxNativeTargetSection()[target.uuid] = target.pbxNativeTarget;
- this.pbxNativeTargetSection()[commentKey] = target.pbxNativeTarget.name;
-}
-
-pbxProject.prototype.addToPbxFileReferenceSection = function(file) {
- var commentKey = f("%s_comment", file.fileRef);
-
- this.pbxFileReferenceSection()[file.fileRef] = pbxFileReferenceObj(file);
- this.pbxFileReferenceSection()[commentKey] = pbxFileReferenceComment(file);
-}
-
-pbxProject.prototype.removeFromPbxFileReferenceSection = function(file) {
-
- var i;
- var refObj = pbxFileReferenceObj(file);
- for (i in this.pbxFileReferenceSection()) {
- if (this.pbxFileReferenceSection()[i].name == refObj.name ||
- ('"' + this.pbxFileReferenceSection()[i].name + '"') == refObj.name ||
- this.pbxFileReferenceSection()[i].path == refObj.path ||
- ('"' + this.pbxFileReferenceSection()[i].path + '"') == refObj.path) {
- file.fileRef = file.uuid = i;
- delete this.pbxFileReferenceSection()[i];
- break;
- }
- }
- var commentKey = f("%s_comment", file.fileRef);
- if (this.pbxFileReferenceSection()[commentKey] != undefined) {
- delete this.pbxFileReferenceSection()[commentKey];
- }
-
- return file;
-}
-
-pbxProject.prototype.addToPluginsPbxGroup = function(file) {
- var pluginsGroup = this.pbxGroupByName('Plugins');
- pluginsGroup.children.push(pbxGroupChild(file));
-}
-
-pbxProject.prototype.removeFromPluginsPbxGroup = function(file) {
- var pluginsGroupChildren = this.pbxGroupByName('Plugins').children, i;
- for (i in pluginsGroupChildren) {
- if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
- pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
- pluginsGroupChildren.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addToResourcesPbxGroup = function(file) {
- var pluginsGroup = this.pbxGroupByName('Resources');
- pluginsGroup.children.push(pbxGroupChild(file));
-}
-
-pbxProject.prototype.removeFromResourcesPbxGroup = function(file) {
- var pluginsGroupChildren = this.pbxGroupByName('Resources').children, i;
- for (i in pluginsGroupChildren) {
- if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
- pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
- pluginsGroupChildren.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addToFrameworksPbxGroup = function(file) {
- var pluginsGroup = this.pbxGroupByName('Frameworks');
- pluginsGroup.children.push(pbxGroupChild(file));
-}
-
-pbxProject.prototype.removeFromFrameworksPbxGroup = function(file) {
- var pluginsGroupChildren = this.pbxGroupByName('Frameworks').children;
-
- for (i in pluginsGroupChildren) {
- if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
- pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
- pluginsGroupChildren.splice(i, 1);
- break;
- }
- }
-}
-
-
-pbxProject.prototype.addToProductsPbxGroup = function(file) {
- var productsGroup = this.pbxGroupByName('Products');
- productsGroup.children.push(pbxGroupChild(file));
-}
-
-pbxProject.prototype.removeFromProductsPbxGroup = function(file) {
- var productsGroupChildren = this.pbxGroupByName('Products').children, i;
- for (i in productsGroupChildren) {
- if (pbxGroupChild(file).value == productsGroupChildren[i].value &&
- pbxGroupChild(file).comment == productsGroupChildren[i].comment) {
- productsGroupChildren.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addToPbxSourcesBuildPhase = function(file) {
- var sources = this.pbxSourcesBuildPhaseObj(file.target);
- sources.files.push(pbxBuildPhaseObj(file));
-}
-
-pbxProject.prototype.removeFromPbxSourcesBuildPhase = function(file) {
-
- var sources = this.pbxSourcesBuildPhaseObj(file.target), i;
- for (i in sources.files) {
- if (sources.files[i].comment == longComment(file)) {
- sources.files.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addToPbxResourcesBuildPhase = function(file) {
- var sources = this.pbxResourcesBuildPhaseObj(file.target);
- sources.files.push(pbxBuildPhaseObj(file));
-}
-
-pbxProject.prototype.removeFromPbxResourcesBuildPhase = function(file) {
- var sources = this.pbxResourcesBuildPhaseObj(file.target), i;
-
- for (i in sources.files) {
- if (sources.files[i].comment == longComment(file)) {
- sources.files.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addToPbxFrameworksBuildPhase = function(file) {
- var sources = this.pbxFrameworksBuildPhaseObj(file.target);
- sources.files.push(pbxBuildPhaseObj(file));
-}
-
-pbxProject.prototype.removeFromPbxFrameworksBuildPhase = function(file) {
- var sources = this.pbxFrameworksBuildPhaseObj(file.target);
- for (i in sources.files) {
- if (sources.files[i].comment == longComment(file)) {
- sources.files.splice(i, 1);
- break;
- }
- }
-}
-
-pbxProject.prototype.addXCConfigurationList = function(configurationObjectsArray, defaultConfigurationName, comment) {
- var pbxBuildConfigurationSection = this.pbxXCBuildConfigurationSection(),
- pbxXCConfigurationListSection = this.pbxXCConfigurationList(),
- xcConfigurationListUuid = this.generateUuid(),
- commentKey = f("%s_comment", xcConfigurationListUuid),
- xcConfigurationList = {
- isa: 'XCConfigurationList',
- buildConfigurations: [],
- defaultConfigurationIsVisible: 0,
- defaultConfigurationName: defaultConfigurationName
- };
-
- for (var index = 0; index < configurationObjectsArray.length; index++) {
- var configuration = configurationObjectsArray[index],
- configurationUuid = this.generateUuid(),
- configurationCommentKey = f("%s_comment", configurationUuid);
-
- pbxBuildConfigurationSection[configurationUuid] = configuration;
- pbxBuildConfigurationSection[configurationCommentKey] = configuration.name;
- xcConfigurationList.buildConfigurations.push({ value: configurationUuid, comment: configuration.name });
- }
-
- if (pbxXCConfigurationListSection) {
- pbxXCConfigurationListSection[xcConfigurationListUuid] = xcConfigurationList;
- pbxXCConfigurationListSection[commentKey] = comment;
- }
-
- return { uuid: xcConfigurationListUuid, xcConfigurationList: xcConfigurationList };
-}
-
-pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
- if (!target)
- return undefined;
-
- var nativeTargets = this.pbxNativeTargetSection();
-
- if (typeof nativeTargets[target] == "undefined")
- throw new Error("Invalid target: " + target);
-
- for (var index = 0; index < dependencyTargets.length; index++) {
- var dependencyTarget = dependencyTargets[index];
- if (typeof nativeTargets[dependencyTarget] == "undefined")
- throw new Error("Invalid target: " + dependencyTarget);
- }
-
- var pbxTargetDependency = 'PBXTargetDependency',
- pbxContainerItemProxy = 'PBXContainerItemProxy',
- pbxTargetDependencySection = this.hash.project.objects[pbxTargetDependency],
- pbxContainerItemProxySection = this.hash.project.objects[pbxContainerItemProxy];
-
- for (var index = 0; index < dependencyTargets.length; index++) {
- var dependencyTargetUuid = dependencyTargets[index],
- dependencyTargetCommentKey = f("%s_comment", dependencyTargetUuid),
- targetDependencyUuid = this.generateUuid(),
- targetDependencyCommentKey = f("%s_comment", targetDependencyUuid),
- itemProxyUuid = this.generateUuid(),
- itemProxyCommentKey = f("%s_comment", itemProxyUuid),
- itemProxy = {
- isa: pbxContainerItemProxy,
- containerPortal: this.hash.project['rootObject'],
- containerPortal_comment: this.hash.project['rootObject_comment'],
- proxyType: 1,
- remoteGlobalIDString: dependencyTargetUuid,
- remoteInfo: nativeTargets[dependencyTargetUuid].name
- },
- targetDependency = {
- isa: pbxTargetDependency,
- target: dependencyTargetUuid,
- target_comment: nativeTargets[dependencyTargetCommentKey],
- targetProxy: itemProxyUuid,
- targetProxy_comment: pbxContainerItemProxy
- };
-
- if (pbxContainerItemProxySection && pbxTargetDependencySection) {
- pbxContainerItemProxySection[itemProxyUuid] = itemProxy;
- pbxContainerItemProxySection[itemProxyCommentKey] = pbxContainerItemProxy;
- pbxTargetDependencySection[targetDependencyUuid] = targetDependency;
- pbxTargetDependencySection[targetDependencyCommentKey] = pbxTargetDependency;
- nativeTargets[target].dependencies.push({ value: targetDependencyUuid, comment: pbxTargetDependency })
- }
- }
-
- return { uuid: target, target: nativeTargets[target] };
-}
-
-pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, comment, target, folderType, subfolderPath) {
- var buildPhaseSection,
- fileReferenceSection = this.pbxFileReferenceSection(),
- buildFileSection = this.pbxBuildFileSection(),
- buildPhaseUuid = this.generateUuid(),
- buildPhaseTargetUuid = target || this.getFirstTarget().uuid,
- commentKey = f("%s_comment", buildPhaseUuid),
- buildPhase = {
- isa: buildPhaseType,
- buildActionMask: 2147483647,
- files: [],
- runOnlyForDeploymentPostprocessing: 0
- },
- filePathToBuildFile = {};
-
- if (buildPhaseType === 'PBXCopyFilesBuildPhase') {
- buildPhase = pbxCopyFilesBuildPhaseObj(buildPhase, folderType, subfolderPath, comment);
- }
-
- if (!this.hash.project.objects[buildPhaseType]) {
- this.hash.project.objects[buildPhaseType] = new Object();
- }
-
- if (!this.hash.project.objects[buildPhaseType][buildPhaseUuid]) {
- this.hash.project.objects[buildPhaseType][buildPhaseUuid] = buildPhase;
- this.hash.project.objects[buildPhaseType][commentKey] = comment;
- }
-
- if (this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases']) {
- this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases'].push({
- value: buildPhaseUuid,
- comment: comment
- })
-
- }
-
-
- for (var key in buildFileSection) {
- // only look for comments
- if (!COMMENT_KEY.test(key)) continue;
-
- var buildFileKey = key.split(COMMENT_KEY)[0],
- buildFile = buildFileSection[buildFileKey];
- fileReference = fileReferenceSection[buildFile.fileRef];
-
- if (!fileReference) continue;
-
- var pbxFileObj = new pbxFile(fileReference.path);
-
- filePathToBuildFile[fileReference.path] = { uuid: buildFileKey, basename: pbxFileObj.basename, group: pbxFileObj.group };
- }
-
- for (var index = 0; index < filePathsArray.length; index++) {
- var filePath = filePathsArray[index],
- filePathQuoted = "\"" + filePath + "\"",
- file = new pbxFile(filePath);
-
- if (filePathToBuildFile[filePath]) {
- buildPhase.files.push(pbxBuildPhaseObj(filePathToBuildFile[filePath]));
- continue;
- } else if (filePathToBuildFile[filePathQuoted]) {
- buildPhase.files.push(pbxBuildPhaseObj(filePathToBuildFile[filePathQuoted]));
- continue;
- }
-
- file.uuid = this.generateUuid();
- file.fileRef = this.generateUuid();
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPbxBuildFileSection(file); // PBXBuildFile
- buildPhase.files.push(pbxBuildPhaseObj(file));
- }
-
- if (buildPhaseSection) {
- buildPhaseSection[buildPhaseUuid] = buildPhase;
- buildPhaseSection[commentKey] = comment;
- }
-
- return { uuid: buildPhaseUuid, buildPhase: buildPhase };
-}
-
-// helper access functions
-pbxProject.prototype.pbxProjectSection = function() {
- return this.hash.project.objects['PBXProject'];
-}
-pbxProject.prototype.pbxBuildFileSection = function() {
- return this.hash.project.objects['PBXBuildFile'];
-}
-
-pbxProject.prototype.pbxXCBuildConfigurationSection = function() {
- return this.hash.project.objects['XCBuildConfiguration'];
-}
-
-pbxProject.prototype.pbxFileReferenceSection = function() {
- return this.hash.project.objects['PBXFileReference'];
-}
-
-pbxProject.prototype.pbxNativeTargetSection = function() {
- return this.hash.project.objects['PBXNativeTarget'];
-}
-
-pbxProject.prototype.pbxXCConfigurationList = function() {
- return this.hash.project.objects['XCConfigurationList'];
-}
-
-pbxProject.prototype.pbxGroupByName = function(name) {
- var groups = this.hash.project.objects['PBXGroup'],
- key, groupKey;
-
- for (key in groups) {
- // only look for comments
- if (!COMMENT_KEY.test(key)) continue;
-
- if (groups[key] == name) {
- groupKey = key.split(COMMENT_KEY)[0];
- return groups[groupKey];
- }
- }
-
- return null;
-}
-
-pbxProject.prototype.pbxTargetByName = function(name) {
- return this.pbxItemByComment(name, 'PBXNativeTarget');
-}
-
-pbxProject.prototype.pbxItemByComment = function(name, pbxSectionName) {
- var section = this.hash.project.objects[pbxSectionName],
- key, itemKey;
-
- for (key in section) {
- // only look for comments
- if (!COMMENT_KEY.test(key)) continue;
-
- if (section[key] == name) {
- itemKey = key.split(COMMENT_KEY)[0];
- return section[itemKey];
- }
- }
-
- return null;
-}
-
-pbxProject.prototype.pbxSourcesBuildPhaseObj = function(target) {
- return this.buildPhaseObject('PBXSourcesBuildPhase', 'Sources', target);
-}
-
-pbxProject.prototype.pbxResourcesBuildPhaseObj = function(target) {
- return this.buildPhaseObject('PBXResourcesBuildPhase', 'Resources', target);
-}
-
-pbxProject.prototype.pbxFrameworksBuildPhaseObj = function(target) {
- return this.buildPhaseObject('PBXFrameworksBuildPhase', 'Frameworks', target);
-}
-
-// Find Build Phase from group/target
-pbxProject.prototype.buildPhase = function(group, target) {
-
- if (!target)
- return undefined;
-
- var nativeTargets = this.pbxNativeTargetSection();
- if (typeof nativeTargets[target] == "undefined")
- throw new Error("Invalid target: " + target);
-
- var nativeTarget = nativeTargets[target];
- var buildPhases = nativeTarget.buildPhases;
- for(var i in buildPhases)
- {
- var buildPhase = buildPhases[i];
- if (buildPhase.comment==group)
- return buildPhase.value + "_comment";
- }
- }
-
-pbxProject.prototype.buildPhaseObject = function(name, group, target) {
- var section = this.hash.project.objects[name],
- obj, sectionKey, key;
- var buildPhase = this.buildPhase(group, target);
-
- for (key in section) {
-
- // only look for comments
- if (!COMMENT_KEY.test(key)) continue;
-
- // select the proper buildPhase
- if (buildPhase && buildPhase!=key)
- continue;
- if (section[key] == group) {
- sectionKey = key.split(COMMENT_KEY)[0];
- return section[sectionKey];
- }
- }
- return null;
-}
-
-
-/**
- *
- * @param prop {String}
- * @param value {String|Array|Object|Number|Boolean}
- * @param build {String} Release or Debug
- */
-pbxProject.prototype.updateBuildProperty = function(prop, value, build) {
- var configs = this.pbxXCBuildConfigurationSection();
- for (var configName in configs) {
- if (!COMMENT_KEY.test(configName)) {
- var config = configs[configName];
- if ( (build && config.name === build) || (!build) ) {
- config.buildSettings[prop] = value;
- }
- }
- }
-}
-
-pbxProject.prototype.updateProductName = function(name) {
- this.updateBuildProperty('PRODUCT_NAME', '"' + name + '"');
-}
-
-pbxProject.prototype.removeFromFrameworkSearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- SEARCH_PATHS = 'FRAMEWORK_SEARCH_PATHS',
- config, buildSettings, searchPaths;
- var new_path = searchPathForFile(file, this);
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- searchPaths = buildSettings[SEARCH_PATHS];
-
- if (searchPaths) {
- var matches = searchPaths.filter(function(p) {
- return p.indexOf(new_path) > -1;
- });
- matches.forEach(function(m) {
- var idx = searchPaths.indexOf(m);
- searchPaths.splice(idx, 1);
- });
- }
-
- }
-}
-
-pbxProject.prototype.addToFrameworkSearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- config, buildSettings, searchPaths;
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- if (!buildSettings['FRAMEWORK_SEARCH_PATHS']
- || buildSettings['FRAMEWORK_SEARCH_PATHS'] === INHERITED) {
- buildSettings['FRAMEWORK_SEARCH_PATHS'] = [INHERITED];
- }
-
- buildSettings['FRAMEWORK_SEARCH_PATHS'].push(searchPathForFile(file, this));
- }
-}
-
-pbxProject.prototype.removeFromLibrarySearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- SEARCH_PATHS = 'LIBRARY_SEARCH_PATHS',
- config, buildSettings, searchPaths;
- var new_path = searchPathForFile(file, this);
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- searchPaths = buildSettings[SEARCH_PATHS];
-
- if (searchPaths) {
- var matches = searchPaths.filter(function(p) {
- return p.indexOf(new_path) > -1;
- });
- matches.forEach(function(m) {
- var idx = searchPaths.indexOf(m);
- searchPaths.splice(idx, 1);
- });
- }
-
- }
-}
-
-pbxProject.prototype.addToLibrarySearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- config, buildSettings, searchPaths;
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- if (!buildSettings['LIBRARY_SEARCH_PATHS']
- || buildSettings['LIBRARY_SEARCH_PATHS'] === INHERITED) {
- buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED];
- }
-
- if (typeof file === 'string') {
- buildSettings['LIBRARY_SEARCH_PATHS'].push(file);
- } else {
- buildSettings['LIBRARY_SEARCH_PATHS'].push(searchPathForFile(file, this));
- }
- }
-}
-
-pbxProject.prototype.removeFromHeaderSearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- SEARCH_PATHS = 'HEADER_SEARCH_PATHS',
- config, buildSettings, searchPaths;
- var new_path = searchPathForFile(file, this);
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- if (buildSettings[SEARCH_PATHS]) {
- var matches = buildSettings[SEARCH_PATHS].filter(function(p) {
- return p.indexOf(new_path) > -1;
- });
- matches.forEach(function(m) {
- var idx = buildSettings[SEARCH_PATHS].indexOf(m);
- buildSettings[SEARCH_PATHS].splice(idx, 1);
- });
- }
-
- }
-}
-pbxProject.prototype.addToHeaderSearchPaths = function(file) {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- INHERITED = '"$(inherited)"',
- config, buildSettings, searchPaths;
-
- for (config in configurations) {
- buildSettings = configurations[config].buildSettings;
-
- if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
- continue;
-
- if (!buildSettings['HEADER_SEARCH_PATHS']) {
- buildSettings['HEADER_SEARCH_PATHS'] = [INHERITED];
- }
-
- if (typeof file === 'string') {
- buildSettings['HEADER_SEARCH_PATHS'].push(file);
- } else {
- buildSettings['HEADER_SEARCH_PATHS'].push(searchPathForFile(file, this));
- }
- }
-}
-// a JS getter. hmmm
-pbxProject.prototype.__defineGetter__("productName", function() {
- var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
- config, productName;
-
- for (config in configurations) {
- productName = configurations[config].buildSettings['PRODUCT_NAME'];
-
- if (productName) {
- return unquote(productName);
- }
- }
-});
-
-// check if file is present
-pbxProject.prototype.hasFile = function(filePath) {
- var files = nonComments(this.pbxFileReferenceSection()),
- file, id;
- for (id in files) {
- file = files[id];
- if (file.path == filePath || file.path == ('"' + filePath + '"')) {
- return file;
- }
- }
-
- return false;
-}
-
-pbxProject.prototype.addTarget = function(name, type, subfolder) {
-
- // Setup uuid and name of new target
- var targetUuid = this.generateUuid(),
- targetType = type,
- targetSubfolder = subfolder || name,
- targetName = name.trim();
-
- // Check type against list of allowed target types
- if (!targetName) {
- throw new Error("Target name missing.");
- }
-
- // Check type against list of allowed target types
- if (!targetType) {
- throw new Error("Target type missing.");
- }
-
- // Check type against list of allowed target types
- if (!producttypeForTargettype(targetType)) {
- throw new Error("Target type invalid: " + targetType);
- }
-
- // Build Configuration: Create
- var buildConfigurationsList = [
- {
- name: 'Debug',
- isa: 'XCBuildConfiguration',
- buildSettings: {
- GCC_PREPROCESSOR_DEFINITIONS: ['"DEBUG=1"', '"$(inherited)"'],
- INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
- LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
- PRODUCT_NAME: '"' + targetName + '"',
- SKIP_INSTALL: 'YES'
- }
- },
- {
- name: 'Release',
- isa: 'XCBuildConfiguration',
- buildSettings: {
- INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
- LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
- PRODUCT_NAME: '"' + targetName + '"',
- SKIP_INSTALL: 'YES'
- }
- }
- ];
-
- // Build Configuration: Add
- var buildConfigurations = this.addXCConfigurationList(buildConfigurationsList, 'Release', 'Build configuration list for PBXNativeTarget "' + targetName +'"');
-
- // Product: Create
- var productName = targetName,
- productType = producttypeForTargettype(targetType),
- productFileType = filetypeForProducttype(productType),
- productFile = this.addProductFile(productName, { group: 'Copy Files', 'target': targetUuid, 'explicitFileType': productFileType}),
- productFileName = productFile.basename;
-
-
- // Product: Add to build file list
- this.addToPbxBuildFileSection(productFile);
-
- // Target: Create
- var target = {
- uuid: targetUuid,
- pbxNativeTarget: {
- isa: 'PBXNativeTarget',
- name: '"' + targetName + '"',
- productName: '"' + targetName + '"',
- productReference: productFile.fileRef,
- productType: '"' + producttypeForTargettype(targetType) + '"',
- buildConfigurationList: buildConfigurations.uuid,
- buildPhases: [],
- buildRules: [],
- dependencies: []
- }
- };
-
- // Target: Add to PBXNativeTarget section
- this.addToPbxNativeTargetSection(target)
-
- // Product: Embed (only for "extension"-type targets)
- if (targetType === 'app_extension') {
-
- // Create CopyFiles phase in first target
- this.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Copy Files', this.getFirstTarget().uuid, targetType)
-
- // Add product to CopyFiles phase
- this.addToPbxCopyfilesBuildPhase(productFile)
-
- // this.addBuildPhaseToTarget(newPhase.buildPhase, this.getFirstTarget().uuid)
-
- };
-
- // Target: Add uuid to root project
- this.addToPbxProjectSection(target);
-
- // Target: Add dependency for this target to first (main) target
- this.addTargetDependency(this.getFirstTarget().uuid, [target.uuid]);
-
-
- // Return target on success
- return target;
-
-};
-
-// helper recursive prop search+replace
-function propReplace(obj, prop, value) {
- var o = {};
- for (var p in obj) {
- if (o.hasOwnProperty.call(obj, p)) {
- if (typeof obj[p] == 'object' && !Array.isArray(obj[p])) {
- propReplace(obj[p], prop, value);
- } else if (p == prop) {
- obj[p] = value;
- }
- }
- }
-}
-
-// helper object creation functions
-function pbxBuildFileObj(file) {
- var obj = Object.create(null);
-
- obj.isa = 'PBXBuildFile';
- obj.fileRef = file.fileRef;
- obj.fileRef_comment = file.basename;
- if (file.settings) obj.settings = file.settings;
-
- return obj;
-}
-
-function pbxFileReferenceObj(file) {
- var fileObject = {
- isa: "PBXFileReference",
- name: "\"" + file.basename + "\"",
- path: "\"" + file.path.replace(/\\/g, '/') + "\"",
- sourceTree: file.sourceTree,
- fileEncoding: file.fileEncoding,
- lastKnownFileType: file.lastKnownFileType,
- explicitFileType: file.explicitFileType,
- includeInIndex: file.includeInIndex
- };
-
- return fileObject;
-}
-
-function pbxGroupChild(file) {
- var obj = Object.create(null);
-
- obj.value = file.fileRef;
- obj.comment = file.basename;
-
- return obj;
-}
-
-function pbxBuildPhaseObj(file) {
- var obj = Object.create(null);
-
- obj.value = file.uuid;
- obj.comment = longComment(file);
-
- return obj;
-}
-
-function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName){
-
- // Add additional properties for 'CopyFiles' build phase
- var DESTINATION_BY_TARGETTYPE = {
- application: 'wrapper',
- app_extension: 'plugins',
- bundle: 'wrapper',
- command_line_tool: 'wrapper',
- dynamic_library: 'products_directory',
- framework: 'shared_frameworks',
- static_library: 'products_directory',
- unit_test_bundle: 'wrapper',
- watch_app: 'wrapper',
- watch_extension: 'plugins'
- }
- var SUBFOLDERSPEC_BY_DESTINATION = {
- absolute_path: 0,
- executables: 6,
- frameworks: 10,
- java_resources: 15,
- plugins: 13,
- products_directory: 16,
- resources: 7,
- shared_frameworks: 11,
- shared_support: 12,
- wrapper: 1,
- xpc_services: 0
- }
-
- obj.name = '"' + phaseName + '"';
- obj.dstPath = subfolderPath || '""';
- obj.dstSubfolderSpec = SUBFOLDERSPEC_BY_DESTINATION[DESTINATION_BY_TARGETTYPE[folderType]];
-
- return obj;
-}
-
-function pbxBuildFileComment(file) {
- return longComment(file);
-}
-
-function pbxFileReferenceComment(file) {
- return file.basename || path.basename(file.path);
-}
-
-function pbxNativeTargetComment(target) {
- return target.name;
-}
-
-function longComment(file) {
- return f("%s in %s", file.basename, file.group);
-}
-
-// respect <group> path
-function correctForPluginsPath(file, project) {
- return correctForPath(file, project, 'Plugins');
-}
-
-function correctForResourcesPath(file, project) {
- return correctForPath(file, project, 'Resources');
-}
-
-function correctForFrameworksPath(file, project) {
- return correctForPath(file, project, 'Frameworks');
-}
-
-function correctForPath(file, project, group) {
- var r_group_dir = new RegExp('^' + group + '[\\\\/]');
-
- if (project.pbxGroupByName(group).path)
- file.path = file.path.replace(r_group_dir, '');
-
- return file;
-}
-
-function searchPathForFile(file, proj) {
- var plugins = proj.pbxGroupByName('Plugins'),
- pluginsPath = plugins ? plugins.path : null,
- fileDir = path.dirname(file.path);
-
- if (fileDir == '.') {
- fileDir = '';
- } else {
- fileDir = '/' + fileDir;
- }
-
- if (file.plugin && pluginsPath) {
- return '"\\"$(SRCROOT)/' + unquote(pluginsPath) + '\\""';
- } else if (file.customFramework && file.dirname) {
- return '"\\"' + file.dirname + '\\""';
- } else {
- return '"\\"$(SRCROOT)/' + proj.productName + fileDir + '\\""';
- }
-}
-
-function nonComments(obj) {
- var keys = Object.keys(obj),
- newObj = {}, i = 0;
-
- for (i; i < keys.length; i++) {
- if (!COMMENT_KEY.test(keys[i])) {
- newObj[keys[i]] = obj[keys[i]];
- }
- }
-
- return newObj;
-}
-
-function unquote(str) {
- if (str) return str.replace(/^"(.*)"$/, "$1");
-}
-
-
-function buildPhaseNameForIsa (isa) {
-
- BUILDPHASENAME_BY_ISA = {
- PBXCopyFilesBuildPhase: 'Copy Files',
- PBXResourcesBuildPhase: 'Resources',
- PBXSourcesBuildPhase: 'Sources',
- PBXFrameworksBuildPhase: 'Frameworks'
- }
-
- return BUILDPHASENAME_BY_ISA[isa]
-}
-
-function producttypeForTargettype (targetType) {
-
- PRODUCTTYPE_BY_TARGETTYPE = {
- application: 'com.apple.product-type.application',
- app_extension: 'com.apple.product-type.app-extension',
- bundle: 'com.apple.product-type.bundle',
- command_line_tool: 'com.apple.product-type.tool',
- dynamic_library: 'com.apple.product-type.library.dynamic',
- framework: 'com.apple.product-type.framework',
- static_library: 'com.apple.product-type.library.static',
- unit_test_bundle: 'com.apple.product-type.bundle.unit-test',
- watch_app: 'com.apple.product-type.application.watchapp',
- watch_extension: 'com.apple.product-type.watchkit-extension'
- };
-
- return PRODUCTTYPE_BY_TARGETTYPE[targetType]
-}
-
-function filetypeForProducttype (productType) {
-
- FILETYPE_BY_PRODUCTTYPE = {
- 'com.apple.product-type.application': '"wrapper.application"',
- 'com.apple.product-type.app-extension': '"wrapper.app-extension"',
- 'com.apple.product-type.bundle': '"wrapper.plug-in"',
- 'com.apple.product-type.tool': '"compiled.mach-o.dylib"',
- 'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"',
- 'com.apple.product-type.framework': '"wrapper.framework"',
- 'com.apple.product-type.library.static': '"archive.ar"',
- 'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"',
- 'com.apple.product-type.application.watchapp': '"wrapper.application"',
- 'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"'
- };
-
- return FILETYPE_BY_PRODUCTTYPE[productType]
-}
-
-pbxProject.prototype.getFirstProject = function() {
-
- // Get pbxProject container
- var pbxProjectContainer = this.pbxProjectSection();
-
- // Get first pbxProject UUID
- var firstProjectUuid = Object.keys(pbxProjectContainer)[0];
-
- // Get first pbxProject
- var firstProject = pbxProjectContainer[firstProjectUuid];
-
- return {
- uuid: firstProjectUuid,
- firstProject: firstProject
- }
-}
-
-pbxProject.prototype.getFirstTarget = function() {
-
- // Get first targets UUID
- var firstTargetUuid = this.getFirstProject()['firstProject']['targets'][0].value;
-
- // Get first pbxNativeTarget
- var firstTarget = this.pbxNativeTargetSection()[firstTargetUuid];
-
- return {
- uuid: firstTargetUuid,
- firstTarget: firstTarget
- }
-}
-
-/*** NEW ***/
-
-pbxProject.prototype.addToPbxGroup = function (file, groupKey) {
- var group = this.getPBXGroupByKey(groupKey);
- if (group && group.children !== undefined) {
- if (typeof file === 'string') {
- //Group Key
- var childGroup = {
- value:file,
- comment: this.getPBXGroupByKey(file).name
- };
-
- group.children.push(childGroup);
- }
- else {
- //File Object
- group.children.push(pbxGroupChild(file));
- }
- }
-}
-
-pbxProject.prototype.removeFromPbxGroup = function (file, groupKey) {
- var group = this.getPBXGroupByKey(groupKey);
- if (group) {
- var groupChildren = group.children, i;
- for(i in groupChildren) {
- if(pbxGroupChild(file).value == groupChildren[i].value &&
- pbxGroupChild(file).comment == groupChildren[i].comment) {
- groupChildren.splice(i, 1);
- break;
- }
- }
- }
-}
-
-pbxProject.prototype.getPBXGroupByKey = function(key) {
- return this.hash.project.objects['PBXGroup'][key];
-};
-
-pbxProject.prototype.findPBXGroupKey = function(criteria) {
- var groups = this.hash.project.objects['PBXGroup'];
- var target;
-
- for (var key in groups) {
- // only look for comments
- if (COMMENT_KEY.test(key)) continue;
-
- var group = groups[key];
- if (criteria && criteria.path && criteria.name) {
- if (criteria.path === group.path && criteria.name === group.name) {
- target = key;
- break
- }
- }
- else if (criteria && criteria.path) {
- if (criteria.path === group.path) {
- target = key;
- break
- }
- }
- else if (criteria && criteria.name) {
- if (criteria.name === group.name) {
- target = key;
- break
- }
- }
- }
-
- 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.getPBXObject = function(name) {
- return this.hash.project.objects[name];
-}
-
-
-
-pbxProject.prototype.addFile = function (path, group, opt) {
- var file = new pbxFile(path, opt);
-
- // null is better for early errors
- if (this.hasFile(file.path)) return null;
-
- file.fileRef = this.generateUuid();
-
- this.addToPbxFileReferenceSection(file); // PBXFileReference
- this.addToPbxGroup(file, group); // PBXGroup
-
- return file;
-}
-
-pbxProject.prototype.removeFile = function (path, group, opt) {
- var file = new pbxFile(path, opt);
-
- this.removeFromPbxFileReferenceSection(file); // PBXFileReference
- this.removeFromPbxGroup(file, group); // PBXGroup
-
- return file;
-}
-
-
-
-pbxProject.prototype.getBuildProperty = function(prop, build) {
- var target;
- var configs = this.pbxXCBuildConfigurationSection();
- for (var configName in configs) {
- if (!COMMENT_KEY.test(configName)) {
- var config = configs[configName];
- if ( (build && config.name === build) || (build === undefined) ) {
- if (config.buildSettings[prop] !== undefined) {
- target = config.buildSettings[prop];
- }
- }
- }
- }
- return target;
-}
-
-pbxProject.prototype.getBuildConfigByName = function(name) {
- var target = {};
- var configs = this.pbxXCBuildConfigurationSection();
- for (var configName in configs) {
- if (!COMMENT_KEY.test(configName)) {
- var config = configs[configName];
- if (config.name === name) {
- target[configName] = config;
- }
- }
- }
- return target;
-}
-
-
-module.exports = pbxProject;
+var util = require('util'),
+ f = util.format,
+ EventEmitter = require('events').EventEmitter,
+ path = require('path'),
+ uuid = require('node-uuid'),
+ fork = require('child_process').fork,
+ pbxWriter = require('./pbxWriter'),
+ pbxFile = require('./pbxFile'),
+ fs = require('fs'),
+ parser = require('./parser/pbxproj'),
+ plist = require('simple-plist'),
+ COMMENT_KEY = /_comment$/
+
+function pbxProject(filename) {
+ if (!(this instanceof pbxProject))
+ return new pbxProject(filename);
+
+ this.filepath = path.resolve(filename)
+}
+
+util.inherits(pbxProject, EventEmitter)
+
+pbxProject.prototype.parse = function(cb) {
+ var worker = fork(__dirname + '/parseJob.js', [this.filepath])
+
+ worker.on('message', function(msg) {
+ if (msg.name == 'SyntaxError' || msg.code) {
+ this.emit('error', msg);
+ } else {
+ this.hash = msg;
+ this.emit('end', null, msg)
+ }
+ }.bind(this));
+
+ if (cb) {
+ this.on('error', cb);
+ this.on('end', cb);
+ }
+
+ return this;
+}
+
+pbxProject.prototype.parseSync = function() {
+ var file_contents = fs.readFileSync(this.filepath, 'utf-8');
+
+ this.hash = parser.parse(file_contents);
+ return this;
+}
+
+pbxProject.prototype.writeSync = function() {
+ this.writer = new pbxWriter(this.hash);
+ return this.writer.writeSync();
+}
+
+pbxProject.prototype.allUuids = function() {
+ var sections = this.hash.project.objects,
+ uuids = [],
+ section;
+
+ for (key in sections) {
+ section = sections[key]
+ uuids = uuids.concat(Object.keys(section))
+ }
+
+ uuids = uuids.filter(function(str) {
+ return !COMMENT_KEY.test(str) && str.length == 24;
+ });
+
+ return uuids;
+}
+
+pbxProject.prototype.generateUuid = function() {
+ var id = uuid.v4()
+ .replace(/-/g, '')
+ .substr(0, 24)
+ .toUpperCase()
+
+ if (this.allUuids().indexOf(id) >= 0) {
+ return this.generateUuid();
+ } else {
+ return id;
+ }
+}
+
+pbxProject.prototype.addPluginFile = function(path, opt) {
+ var file = new pbxFile(path, opt);
+
+ file.plugin = true; // durr
+ correctForPluginsPath(file, this);
+
+ // null is better for early errors
+ if (this.hasFile(file.path)) return null;
+
+ file.fileRef = this.generateUuid();
+
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToPluginsPbxGroup(file); // PBXGroup
+
+ return file;
+}
+
+pbxProject.prototype.removePluginFile = function(path, opt) {
+ var file = new pbxFile(path, opt);
+ correctForPluginsPath(file, this);
+
+ this.removeFromPbxFileReferenceSection(file); // PBXFileReference
+ this.removeFromPluginsPbxGroup(file); // PBXGroup
+
+ return file;
+}
+
+pbxProject.prototype.addProductFile = function(targetPath, opt) {
+ var file = new pbxFile(targetPath, opt);
+
+ file.includeInIndex = 0;
+ file.fileRef = this.generateUuid();
+ file.target = opt ? opt.target : undefined;
+ file.group = opt ? opt.group : undefined;
+ file.uuid = this.generateUuid();
+ file.path = file.basename;
+
+ this.addToPbxFileReferenceSection(file);
+ this.addToProductsPbxGroup(file); // PBXGroup
+
+ return file;
+}
+
+pbxProject.prototype.removeProductFile = function(path, opt) {
+ var file = new pbxFile(path, opt);
+
+ this.removeFromProductsPbxGroup(file); // PBXGroup
+
+ return file;
+}
+
+/**
+ *
+ * @param path {String}
+ * @param opt {Object} see pbxFile for avail options
+ * @param group {String} group key
+ * @returns {Object} file; see pbxFile
+ */
+pbxProject.prototype.addSourceFile = function (path, opt, group) {
+ var file;
+ if (group) {
+ file = this.addFile(path, group, opt);
+ }
+ else {
+ file = this.addPluginFile(path, opt);
+ }
+
+ if (!file) return false;
+
+ file.target = opt ? opt.target : undefined;
+ file.uuid = this.generateUuid();
+
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase
+
+ return file;
+}
+
+/**
+ *
+ * @param path {String}
+ * @param opt {Object} see pbxFile for avail options
+ * @param group {String} group key
+ * @returns {Object} file; see pbxFile
+ */
+pbxProject.prototype.removeSourceFile = function (path, opt, group) {
+ var file;
+ if (group) {
+ file = this.removeFile(path, group, opt);
+ }
+ else {
+ file = this.removePluginFile(path, opt);
+ }
+ file.target = opt ? opt.target : undefined;
+ this.removeFromPbxBuildFileSection(file); // PBXBuildFile
+ this.removeFromPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase
+
+ return file;
+}
+
+/**
+ *
+ * @param path {String}
+ * @param opt {Object} see pbxFile for avail options
+ * @param group {String} group key
+ * @returns {Object} file; see pbxFile
+ */
+pbxProject.prototype.addHeaderFile = function (path, opt, group) {
+ if (group) {
+ return this.addFile(path, group, opt);
+ }
+ else {
+ return this.addPluginFile(path, opt);
+ }
+}
+
+/**
+ *
+ * @param path {String}
+ * @param opt {Object} see pbxFile for avail options
+ * @param group {String} group key
+ * @returns {Object} file; see pbxFile
+ */
+pbxProject.prototype.removeHeaderFile = function (path, opt, group) {
+ if (group) {
+ return this.removeFile(path, group, opt);
+ }
+ else {
+ return this.removePluginFile(path, opt);
+ }
+}
+
+pbxProject.prototype.addResourceFile = function(path, opt) {
+ opt = opt || {};
+
+ var file;
+
+ if (opt.plugin) {
+ file = this.addPluginFile(path, opt);
+ if (!file) return false;
+ } else {
+ file = new pbxFile(path, opt);
+ if (this.hasFile(file.path)) return false;
+ }
+
+ file.uuid = this.generateUuid();
+ file.target = opt ? opt.target : undefined;
+
+ if (!opt.plugin) {
+ correctForResourcesPath(file, this);
+ file.fileRef = this.generateUuid();
+ }
+
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
+
+ if (!opt.plugin) {
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToResourcesPbxGroup(file); // PBXGroup
+ }
+
+ return file;
+}
+
+pbxProject.prototype.removeResourceFile = function(path, opt) {
+ var file = new pbxFile(path, opt);
+ file.target = opt ? opt.target : undefined;
+
+ correctForResourcesPath(file, this);
+
+ this.removeFromPbxBuildFileSection(file); // PBXBuildFile
+ this.removeFromPbxFileReferenceSection(file); // PBXFileReference
+ this.removeFromResourcesPbxGroup(file); // PBXGroup
+ this.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
+
+ return file;
+}
+
+pbxProject.prototype.addFramework = function(fpath, opt) {
+
+ var file = new pbxFile(fpath, opt);
+
+ file.uuid = this.generateUuid();
+ file.fileRef = this.generateUuid();
+ file.target = opt ? opt.target : undefined;
+
+ if (this.hasFile(file.path)) return false;
+
+ var customFramework = opt && opt.customFramework == true;
+ var link = !opt || (opt.link == undefined || opt.link); //defaults to true if not specified
+ var embed = opt && opt.embed; //defaults to false if not specified
+
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToFrameworksPbxGroup(file); // PBXGroup
+
+ if (link) {
+ this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
+ }
+
+ if (customFramework) {
+ this.addToFrameworkSearchPaths(file);
+
+ if (embed) {
+ this.addToPbxEmbedFrameworksBuildPhase(file); // PBXCopyFilesBuildPhase
+ }
+ }
+
+ return file;
+}
+
+pbxProject.prototype.removeFramework = function(fpath, opt) {
+ var file = new pbxFile(fpath, opt);
+ file.target = opt ? opt.target : undefined;
+
+ this.removeFromPbxBuildFileSection(file); // PBXBuildFile
+ this.removeFromPbxFileReferenceSection(file); // PBXFileReference
+ this.removeFromFrameworksPbxGroup(file); // PBXGroup
+ this.removeFromPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
+ this.removeFromPbxEmbedFrameworksBuildPhase(file); // PBXCopyFilesBuildPhase
+
+ if (opt && opt.customFramework) {
+ this.removeFromFrameworkSearchPaths(file.dirname);
+ }
+
+ return file;
+}
+
+
+pbxProject.prototype.addCopyfile = function(fpath, opt) {
+ var file = new pbxFile(fpath, opt);
+
+ // catch duplicates
+ if (this.hasFile(file.path)) {
+ file = this.hasFile(file.path);
+ }
+
+ file.fileRef = file.uuid = this.generateUuid();
+ file.target = opt ? opt.target : undefined;
+
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToPbxCopyfilesBuildPhase(file); // PBXCopyFilesBuildPhase
+
+ return file;
+}
+
+pbxProject.prototype.pbxCopyfilesBuildPhaseObj = function(target) {
+ return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', target);
+}
+
+pbxProject.prototype.addToPbxCopyfilesBuildPhase = function(file) {
+ var sources = this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', file.target);
+ sources.files.push(pbxBuildPhaseObj(file));
+}
+
+pbxProject.prototype.removeCopyfile = function(fpath, opt) {
+ var file = new pbxFile(fpath, opt);
+ file.target = opt ? opt.target : undefined;
+
+ this.removeFromPbxBuildFileSection(file); // PBXBuildFile
+ this.removeFromPbxFileReferenceSection(file); // PBXFileReference
+ this.removeFromPbxCopyfilesBuildPhase(file); // PBXFrameworksBuildPhase
+
+ return file;
+}
+
+pbxProject.prototype.removeFromPbxCopyfilesBuildPhase = function(file) {
+ var sources = this.pbxCopyfilesBuildPhaseObj(file.target);
+ for (i in sources.files) {
+ if (sources.files[i].comment == longComment(file)) {
+ sources.files.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addStaticLibrary = function(path, opt) {
+ opt = opt || {};
+
+ var file;
+
+ if (opt.plugin) {
+ file = this.addPluginFile(path, opt);
+ if (!file) return false;
+ } else {
+ file = new pbxFile(path, opt);
+ if (this.hasFile(file.path)) return false;
+ }
+
+ file.uuid = this.generateUuid();
+ file.target = opt ? opt.target : undefined;
+
+ if (!opt.plugin) {
+ file.fileRef = this.generateUuid();
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ }
+
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase
+ this.addToLibrarySearchPaths(file); // make sure it gets built!
+
+ return file;
+}
+
+// helper addition functions
+pbxProject.prototype.addToPbxBuildFileSection = function(file) {
+ var commentKey = f("%s_comment", file.uuid);
+
+ this.pbxBuildFileSection()[file.uuid] = pbxBuildFileObj(file);
+ this.pbxBuildFileSection()[commentKey] = pbxBuildFileComment(file);
+}
+
+pbxProject.prototype.removeFromPbxBuildFileSection = function(file) {
+ var uuid;
+
+ for (uuid in this.pbxBuildFileSection()) {
+ if (this.pbxBuildFileSection()[uuid].fileRef_comment == file.basename) {
+ file.uuid = uuid;
+ delete this.pbxBuildFileSection()[uuid];
+ }
+ }
+ var commentKey = f("%s_comment", file.uuid);
+ delete this.pbxBuildFileSection()[commentKey];
+}
+
+pbxProject.prototype.addPbxGroup = function(filePathsArray, name, path, sourceTree) {
+ var groups = this.hash.project.objects['PBXGroup'],
+ pbxGroupUuid = this.generateUuid(),
+ commentKey = f("%s_comment", pbxGroupUuid),
+ pbxGroup = {
+ isa: 'PBXGroup',
+ children: [],
+ name: name,
+ path: path,
+ sourceTree: sourceTree ? sourceTree : '"<group>"'
+ },
+ fileReferenceSection = this.pbxFileReferenceSection(),
+ filePathToReference = {};
+
+ for (var key in fileReferenceSection) {
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ var fileReferenceKey = key.split(COMMENT_KEY)[0],
+ fileReference = fileReferenceSection[fileReferenceKey];
+
+ filePathToReference[fileReference.path] = { fileRef: fileReferenceKey, basename: fileReferenceSection[key] };
+ }
+
+ for (var index = 0; index < filePathsArray.length; index++) {
+ var filePath = filePathsArray[index],
+ filePathQuoted = "\"" + filePath + "\"";
+ if (filePathToReference[filePath]) {
+ pbxGroup.children.push(pbxGroupChild(filePathToReference[filePath]));
+ continue;
+ } else if (filePathToReference[filePathQuoted]) {
+ pbxGroup.children.push(pbxGroupChild(filePathToReference[filePathQuoted]));
+ continue;
+ }
+
+ var file = new pbxFile(filePath);
+ file.uuid = this.generateUuid();
+ file.fileRef = this.generateUuid();
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ pbxGroup.children.push(pbxGroupChild(file));
+ }
+
+ if (groups) {
+ groups[pbxGroupUuid] = pbxGroup;
+ groups[commentKey] = name;
+ }
+
+ return { uuid: pbxGroupUuid, pbxGroup: pbxGroup };
+}
+
+pbxProject.prototype.removePbxGroup = function (groupName) {
+ var section = this.hash.project.objects['PBXGroup'],
+ key, itemKey;
+
+ for (key in section) {
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ if (section[key] == groupName) {
+ itemKey = key.split(COMMENT_KEY)[0];
+ delete section[itemKey];
+ }
+ }
+}
+
+pbxProject.prototype.addToPbxProjectSection = function(target) {
+
+ var newTarget = {
+ value: target.uuid,
+ comment: pbxNativeTargetComment(target.pbxNativeTarget)
+ };
+
+ this.pbxProjectSection()[this.getFirstProject()['uuid']]['targets'].push(newTarget);
+}
+
+pbxProject.prototype.addToPbxNativeTargetSection = function(target) {
+ var commentKey = f("%s_comment", target.uuid);
+
+ this.pbxNativeTargetSection()[target.uuid] = target.pbxNativeTarget;
+ this.pbxNativeTargetSection()[commentKey] = target.pbxNativeTarget.name;
+}
+
+pbxProject.prototype.addToPbxFileReferenceSection = function(file) {
+ var commentKey = f("%s_comment", file.fileRef);
+
+ this.pbxFileReferenceSection()[file.fileRef] = pbxFileReferenceObj(file);
+ this.pbxFileReferenceSection()[commentKey] = pbxFileReferenceComment(file);
+}
+
+pbxProject.prototype.removeFromPbxFileReferenceSection = function(file) {
+
+ var i;
+ var refObj = pbxFileReferenceObj(file);
+ for (i in this.pbxFileReferenceSection()) {
+ if (this.pbxFileReferenceSection()[i].name == refObj.name ||
+ ('"' + this.pbxFileReferenceSection()[i].name + '"') == refObj.name ||
+ this.pbxFileReferenceSection()[i].path == refObj.path ||
+ ('"' + this.pbxFileReferenceSection()[i].path + '"') == refObj.path) {
+ file.fileRef = file.uuid = i;
+ delete this.pbxFileReferenceSection()[i];
+ break;
+ }
+ }
+ var commentKey = f("%s_comment", file.fileRef);
+ if (this.pbxFileReferenceSection()[commentKey] != undefined) {
+ delete this.pbxFileReferenceSection()[commentKey];
+ }
+
+ return file;
+}
+
+pbxProject.prototype.addToXcVersionGroupSection = function(file) {
+ if (!file.models || !file.currentModel) {
+ throw new Error("Cannot create a XCVersionGroup section from not a data model document file");
+ }
+
+ var commentKey = f("%s_comment", file.fileRef);
+
+ if (!this.xcVersionGroupSection()[file.fileRef]) {
+ this.xcVersionGroupSection()[file.fileRef] = {
+ isa: 'XCVersionGroup',
+ children: file.models.map(function (el) { return el.fileRef; }),
+ currentVersion: file.currentModel.fileRef,
+ name: path.basename(file.path),
+ path: file.path,
+ sourceTree: '"<group>"',
+ versionGroupType: 'wrapper.xcdatamodel'
+ };
+ this.xcVersionGroupSection()[commentKey] = path.basename(file.path);
+ }
+}
+
+pbxProject.prototype.addToPluginsPbxGroup = function(file) {
+ var pluginsGroup = this.pbxGroupByName('Plugins');
+ pluginsGroup.children.push(pbxGroupChild(file));
+}
+
+pbxProject.prototype.removeFromPluginsPbxGroup = function(file) {
+ var pluginsGroupChildren = this.pbxGroupByName('Plugins').children, i;
+ for (i in pluginsGroupChildren) {
+ if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
+ pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
+ pluginsGroupChildren.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToResourcesPbxGroup = function(file) {
+ var pluginsGroup = this.pbxGroupByName('Resources');
+ pluginsGroup.children.push(pbxGroupChild(file));
+}
+
+pbxProject.prototype.removeFromResourcesPbxGroup = function(file) {
+ var pluginsGroupChildren = this.pbxGroupByName('Resources').children, i;
+ for (i in pluginsGroupChildren) {
+ if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
+ pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
+ pluginsGroupChildren.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToFrameworksPbxGroup = function(file) {
+ var pluginsGroup = this.pbxGroupByName('Frameworks');
+ pluginsGroup.children.push(pbxGroupChild(file));
+}
+
+pbxProject.prototype.removeFromFrameworksPbxGroup = function(file) {
+ var pluginsGroupChildren = this.pbxGroupByName('Frameworks').children;
+
+ for (i in pluginsGroupChildren) {
+ if (pbxGroupChild(file).value == pluginsGroupChildren[i].value &&
+ pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) {
+ pluginsGroupChildren.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) {
+ var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target);
+ if (sources) {
+ sources.files.push(pbxBuildPhaseObj(file));
+ }
+}
+
+pbxProject.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) {
+ var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target);
+ if (sources) {
+ for (i in sources.files) {
+ if (sources.files[i].comment == longComment(file)) {
+ sources.files.splice(i, 1);
+ break;
+ }
+ }
+ }
+}
+
+pbxProject.prototype.addToProductsPbxGroup = function(file) {
+ var productsGroup = this.pbxGroupByName('Products');
+ productsGroup.children.push(pbxGroupChild(file));
+}
+
+pbxProject.prototype.removeFromProductsPbxGroup = function(file) {
+ var productsGroupChildren = this.pbxGroupByName('Products').children, i;
+ for (i in productsGroupChildren) {
+ if (pbxGroupChild(file).value == productsGroupChildren[i].value &&
+ pbxGroupChild(file).comment == productsGroupChildren[i].comment) {
+ productsGroupChildren.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToPbxSourcesBuildPhase = function(file) {
+ var sources = this.pbxSourcesBuildPhaseObj(file.target);
+ sources.files.push(pbxBuildPhaseObj(file));
+}
+
+pbxProject.prototype.removeFromPbxSourcesBuildPhase = function(file) {
+
+ var sources = this.pbxSourcesBuildPhaseObj(file.target), i;
+ for (i in sources.files) {
+ if (sources.files[i].comment == longComment(file)) {
+ sources.files.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToPbxResourcesBuildPhase = function(file) {
+ var sources = this.pbxResourcesBuildPhaseObj(file.target);
+ sources.files.push(pbxBuildPhaseObj(file));
+}
+
+pbxProject.prototype.removeFromPbxResourcesBuildPhase = function(file) {
+ var sources = this.pbxResourcesBuildPhaseObj(file.target), i;
+
+ for (i in sources.files) {
+ if (sources.files[i].comment == longComment(file)) {
+ sources.files.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addToPbxFrameworksBuildPhase = function(file) {
+ var sources = this.pbxFrameworksBuildPhaseObj(file.target);
+ sources.files.push(pbxBuildPhaseObj(file));
+}
+
+pbxProject.prototype.removeFromPbxFrameworksBuildPhase = function(file) {
+ var sources = this.pbxFrameworksBuildPhaseObj(file.target);
+ for (i in sources.files) {
+ if (sources.files[i].comment == longComment(file)) {
+ sources.files.splice(i, 1);
+ break;
+ }
+ }
+}
+
+pbxProject.prototype.addXCConfigurationList = function(configurationObjectsArray, defaultConfigurationName, comment) {
+ var pbxBuildConfigurationSection = this.pbxXCBuildConfigurationSection(),
+ pbxXCConfigurationListSection = this.pbxXCConfigurationList(),
+ xcConfigurationListUuid = this.generateUuid(),
+ commentKey = f("%s_comment", xcConfigurationListUuid),
+ xcConfigurationList = {
+ isa: 'XCConfigurationList',
+ buildConfigurations: [],
+ defaultConfigurationIsVisible: 0,
+ defaultConfigurationName: defaultConfigurationName
+ };
+
+ for (var index = 0; index < configurationObjectsArray.length; index++) {
+ var configuration = configurationObjectsArray[index],
+ configurationUuid = this.generateUuid(),
+ configurationCommentKey = f("%s_comment", configurationUuid);
+
+ pbxBuildConfigurationSection[configurationUuid] = configuration;
+ pbxBuildConfigurationSection[configurationCommentKey] = configuration.name;
+ xcConfigurationList.buildConfigurations.push({ value: configurationUuid, comment: configuration.name });
+ }
+
+ if (pbxXCConfigurationListSection) {
+ pbxXCConfigurationListSection[xcConfigurationListUuid] = xcConfigurationList;
+ pbxXCConfigurationListSection[commentKey] = comment;
+ }
+
+ return { uuid: xcConfigurationListUuid, xcConfigurationList: xcConfigurationList };
+}
+
+pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) {
+ if (!target)
+ return undefined;
+
+ var nativeTargets = this.pbxNativeTargetSection();
+
+ if (typeof nativeTargets[target] == "undefined")
+ throw new Error("Invalid target: " + target);
+
+ for (var index = 0; index < dependencyTargets.length; index++) {
+ var dependencyTarget = dependencyTargets[index];
+ if (typeof nativeTargets[dependencyTarget] == "undefined")
+ throw new Error("Invalid target: " + dependencyTarget);
+ }
+
+ var pbxTargetDependency = 'PBXTargetDependency',
+ pbxContainerItemProxy = 'PBXContainerItemProxy',
+ pbxTargetDependencySection = this.hash.project.objects[pbxTargetDependency],
+ pbxContainerItemProxySection = this.hash.project.objects[pbxContainerItemProxy];
+
+ for (var index = 0; index < dependencyTargets.length; index++) {
+ var dependencyTargetUuid = dependencyTargets[index],
+ dependencyTargetCommentKey = f("%s_comment", dependencyTargetUuid),
+ targetDependencyUuid = this.generateUuid(),
+ targetDependencyCommentKey = f("%s_comment", targetDependencyUuid),
+ itemProxyUuid = this.generateUuid(),
+ itemProxyCommentKey = f("%s_comment", itemProxyUuid),
+ itemProxy = {
+ isa: pbxContainerItemProxy,
+ containerPortal: this.hash.project['rootObject'],
+ containerPortal_comment: this.hash.project['rootObject_comment'],
+ proxyType: 1,
+ remoteGlobalIDString: dependencyTargetUuid,
+ remoteInfo: nativeTargets[dependencyTargetUuid].name
+ },
+ targetDependency = {
+ isa: pbxTargetDependency,
+ target: dependencyTargetUuid,
+ target_comment: nativeTargets[dependencyTargetCommentKey],
+ targetProxy: itemProxyUuid,
+ targetProxy_comment: pbxContainerItemProxy
+ };
+
+ if (pbxContainerItemProxySection && pbxTargetDependencySection) {
+ pbxContainerItemProxySection[itemProxyUuid] = itemProxy;
+ pbxContainerItemProxySection[itemProxyCommentKey] = pbxContainerItemProxy;
+ pbxTargetDependencySection[targetDependencyUuid] = targetDependency;
+ pbxTargetDependencySection[targetDependencyCommentKey] = pbxTargetDependency;
+ nativeTargets[target].dependencies.push({ value: targetDependencyUuid, comment: pbxTargetDependency })
+ }
+ }
+
+ return { uuid: target, target: nativeTargets[target] };
+}
+
+pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, comment, target, folderType, subfolderPath) {
+ var buildPhaseSection,
+ fileReferenceSection = this.pbxFileReferenceSection(),
+ buildFileSection = this.pbxBuildFileSection(),
+ buildPhaseUuid = this.generateUuid(),
+ buildPhaseTargetUuid = target || this.getFirstTarget().uuid,
+ commentKey = f("%s_comment", buildPhaseUuid),
+ buildPhase = {
+ isa: buildPhaseType,
+ buildActionMask: 2147483647,
+ files: [],
+ runOnlyForDeploymentPostprocessing: 0
+ },
+ filePathToBuildFile = {};
+
+ if (buildPhaseType === 'PBXCopyFilesBuildPhase') {
+ buildPhase = pbxCopyFilesBuildPhaseObj(buildPhase, folderType, subfolderPath, comment);
+ }
+
+ if (!this.hash.project.objects[buildPhaseType]) {
+ this.hash.project.objects[buildPhaseType] = new Object();
+ }
+
+ if (!this.hash.project.objects[buildPhaseType][buildPhaseUuid]) {
+ this.hash.project.objects[buildPhaseType][buildPhaseUuid] = buildPhase;
+ this.hash.project.objects[buildPhaseType][commentKey] = comment;
+ }
+
+ if (this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases']) {
+ this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases'].push({
+ value: buildPhaseUuid,
+ comment: comment
+ })
+
+ }
+
+
+ for (var key in buildFileSection) {
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ var buildFileKey = key.split(COMMENT_KEY)[0],
+ buildFile = buildFileSection[buildFileKey];
+ fileReference = fileReferenceSection[buildFile.fileRef];
+
+ if (!fileReference) continue;
+
+ var pbxFileObj = new pbxFile(fileReference.path);
+
+ filePathToBuildFile[fileReference.path] = { uuid: buildFileKey, basename: pbxFileObj.basename, group: pbxFileObj.group };
+ }
+
+ for (var index = 0; index < filePathsArray.length; index++) {
+ var filePath = filePathsArray[index],
+ filePathQuoted = "\"" + filePath + "\"",
+ file = new pbxFile(filePath);
+
+ if (filePathToBuildFile[filePath]) {
+ buildPhase.files.push(pbxBuildPhaseObj(filePathToBuildFile[filePath]));
+ continue;
+ } else if (filePathToBuildFile[filePathQuoted]) {
+ buildPhase.files.push(pbxBuildPhaseObj(filePathToBuildFile[filePathQuoted]));
+ continue;
+ }
+
+ file.uuid = this.generateUuid();
+ file.fileRef = this.generateUuid();
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToPbxBuildFileSection(file); // PBXBuildFile
+ buildPhase.files.push(pbxBuildPhaseObj(file));
+ }
+
+ if (buildPhaseSection) {
+ buildPhaseSection[buildPhaseUuid] = buildPhase;
+ buildPhaseSection[commentKey] = comment;
+ }
+
+ return { uuid: buildPhaseUuid, buildPhase: buildPhase };
+}
+
+// helper access functions
+pbxProject.prototype.pbxProjectSection = function() {
+ return this.hash.project.objects['PBXProject'];
+}
+pbxProject.prototype.pbxBuildFileSection = function() {
+ return this.hash.project.objects['PBXBuildFile'];
+}
+
+pbxProject.prototype.pbxXCBuildConfigurationSection = function() {
+ return this.hash.project.objects['XCBuildConfiguration'];
+}
+
+pbxProject.prototype.pbxFileReferenceSection = function() {
+ return this.hash.project.objects['PBXFileReference'];
+}
+
+pbxProject.prototype.pbxNativeTargetSection = function() {
+ return this.hash.project.objects['PBXNativeTarget'];
+}
+
+pbxProject.prototype.xcVersionGroupSection = function () {
+ if (typeof this.hash.project.objects['XCVersionGroup'] !== 'object') {
+ this.hash.project.objects['XCVersionGroup'] = {};
+ }
+
+ return this.hash.project.objects['XCVersionGroup'];
+}
+
+pbxProject.prototype.pbxXCConfigurationList = function() {
+ return this.hash.project.objects['XCConfigurationList'];
+}
+
+pbxProject.prototype.pbxGroupByName = function(name) {
+ var groups = this.hash.project.objects['PBXGroup'],
+ key, groupKey;
+
+ for (key in groups) {
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ if (groups[key] == name) {
+ groupKey = key.split(COMMENT_KEY)[0];
+ return groups[groupKey];
+ }
+ }
+
+ return null;
+}
+
+pbxProject.prototype.pbxTargetByName = function(name) {
+ return this.pbxItemByComment(name, 'PBXNativeTarget');
+}
+
+pbxProject.prototype.findTargetKey = function(name) {
+ var targets = this.hash.project.objects['PBXNativeTarget'];
+
+ for (var key in targets) {
+ // only look for comments
+ if (COMMENT_KEY.test(key)) continue;
+
+ var target = targets[key];
+ if (target.name === name) {
+ return key;
+ }
+ }
+
+ return null;
+}
+
+pbxProject.prototype.pbxItemByComment = function(name, pbxSectionName) {
+ var section = this.hash.project.objects[pbxSectionName],
+ key, itemKey;
+
+ for (key in section) {
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ if (section[key] == name) {
+ itemKey = key.split(COMMENT_KEY)[0];
+ return section[itemKey];
+ }
+ }
+
+ return null;
+}
+
+pbxProject.prototype.pbxSourcesBuildPhaseObj = function(target) {
+ return this.buildPhaseObject('PBXSourcesBuildPhase', 'Sources', target);
+}
+
+pbxProject.prototype.pbxResourcesBuildPhaseObj = function(target) {
+ return this.buildPhaseObject('PBXResourcesBuildPhase', 'Resources', target);
+}
+
+pbxProject.prototype.pbxFrameworksBuildPhaseObj = function(target) {
+ return this.buildPhaseObject('PBXFrameworksBuildPhase', 'Frameworks', target);
+}
+
+pbxProject.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) {
+ return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks', target);
+};
+
+// Find Build Phase from group/target
+pbxProject.prototype.buildPhase = function(group, target) {
+
+ if (!target)
+ return undefined;
+
+ var nativeTargets = this.pbxNativeTargetSection();
+ if (typeof nativeTargets[target] == "undefined")
+ throw new Error("Invalid target: " + target);
+
+ var nativeTarget = nativeTargets[target];
+ var buildPhases = nativeTarget.buildPhases;
+ for(var i in buildPhases)
+ {
+ var buildPhase = buildPhases[i];
+ if (buildPhase.comment==group)
+ return buildPhase.value + "_comment";
+ }
+ }
+
+pbxProject.prototype.buildPhaseObject = function(name, group, target) {
+ var section = this.hash.project.objects[name],
+ obj, sectionKey, key;
+ var buildPhase = this.buildPhase(group, target);
+
+ for (key in section) {
+
+ // only look for comments
+ if (!COMMENT_KEY.test(key)) continue;
+
+ // select the proper buildPhase
+ if (buildPhase && buildPhase!=key)
+ continue;
+ if (section[key] == group) {
+ sectionKey = key.split(COMMENT_KEY)[0];
+ return section[sectionKey];
+ }
+ }
+ return null;
+}
+
+pbxProject.prototype.addBuildProperty = function(prop, value, build_name) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ key, configuration;
+
+ for (key in configurations){
+ configuration = configurations[key];
+ if (!build_name || configuration.name === build_name){
+ configuration.buildSettings[prop] = value;
+ }
+ }
+}
+
+pbxProject.prototype.removeBuildProperty = function(prop, build_name) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ key, configuration;
+
+ for (key in configurations){
+ configuration = configurations[key];
+ if (configuration.buildSettings[prop] &&
+ !build_name || configuration.name === build_name){
+ delete configuration.buildSettings[prop];
+ }
+ }
+}
+
+/**
+ *
+ * @param prop {String}
+ * @param value {String|Array|Object|Number|Boolean}
+ * @param build {String} Release or Debug
+ */
+pbxProject.prototype.updateBuildProperty = function(prop, value, build) {
+ var configs = this.pbxXCBuildConfigurationSection();
+ for (var configName in configs) {
+ if (!COMMENT_KEY.test(configName)) {
+ var config = configs[configName];
+ if ( (build && config.name === build) || (!build) ) {
+ config.buildSettings[prop] = value;
+ }
+ }
+ }
+}
+
+pbxProject.prototype.updateProductName = function(name) {
+ this.updateBuildProperty('PRODUCT_NAME', '"' + name + '"');
+}
+
+pbxProject.prototype.removeFromFrameworkSearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ SEARCH_PATHS = 'FRAMEWORK_SEARCH_PATHS',
+ config, buildSettings, searchPaths;
+ var new_path = searchPathForFile(file, this);
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ searchPaths = buildSettings[SEARCH_PATHS];
+
+ if (searchPaths) {
+ var matches = searchPaths.filter(function(p) {
+ return p.indexOf(new_path) > -1;
+ });
+ matches.forEach(function(m) {
+ var idx = searchPaths.indexOf(m);
+ searchPaths.splice(idx, 1);
+ });
+ }
+
+ }
+}
+
+pbxProject.prototype.addToFrameworkSearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ config, buildSettings, searchPaths;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ if (!buildSettings['FRAMEWORK_SEARCH_PATHS']
+ || buildSettings['FRAMEWORK_SEARCH_PATHS'] === INHERITED) {
+ buildSettings['FRAMEWORK_SEARCH_PATHS'] = [INHERITED];
+ }
+
+ buildSettings['FRAMEWORK_SEARCH_PATHS'].push(searchPathForFile(file, this));
+ }
+}
+
+pbxProject.prototype.removeFromLibrarySearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ SEARCH_PATHS = 'LIBRARY_SEARCH_PATHS',
+ config, buildSettings, searchPaths;
+ var new_path = searchPathForFile(file, this);
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ searchPaths = buildSettings[SEARCH_PATHS];
+
+ if (searchPaths) {
+ var matches = searchPaths.filter(function(p) {
+ return p.indexOf(new_path) > -1;
+ });
+ matches.forEach(function(m) {
+ var idx = searchPaths.indexOf(m);
+ searchPaths.splice(idx, 1);
+ });
+ }
+
+ }
+}
+
+pbxProject.prototype.addToLibrarySearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ config, buildSettings, searchPaths;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ if (!buildSettings['LIBRARY_SEARCH_PATHS']
+ || buildSettings['LIBRARY_SEARCH_PATHS'] === INHERITED) {
+ buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED];
+ }
+
+ if (typeof file === 'string') {
+ buildSettings['LIBRARY_SEARCH_PATHS'].push(file);
+ } else {
+ buildSettings['LIBRARY_SEARCH_PATHS'].push(searchPathForFile(file, this));
+ }
+ }
+}
+
+pbxProject.prototype.removeFromHeaderSearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ SEARCH_PATHS = 'HEADER_SEARCH_PATHS',
+ config, buildSettings, searchPaths;
+ var new_path = searchPathForFile(file, this);
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ if (buildSettings[SEARCH_PATHS]) {
+ var matches = buildSettings[SEARCH_PATHS].filter(function(p) {
+ return p.indexOf(new_path) > -1;
+ });
+ matches.forEach(function(m) {
+ var idx = buildSettings[SEARCH_PATHS].indexOf(m);
+ buildSettings[SEARCH_PATHS].splice(idx, 1);
+ });
+ }
+
+ }
+}
+pbxProject.prototype.addToHeaderSearchPaths = function(file) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ config, buildSettings, searchPaths;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ if (!buildSettings['HEADER_SEARCH_PATHS']) {
+ buildSettings['HEADER_SEARCH_PATHS'] = [INHERITED];
+ }
+
+ if (typeof file === 'string') {
+ buildSettings['HEADER_SEARCH_PATHS'].push(file);
+ } else {
+ buildSettings['HEADER_SEARCH_PATHS'].push(searchPathForFile(file, this));
+ }
+ }
+}
+
+pbxProject.prototype.addToOtherLinkerFlags = function (flag) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ INHERITED = '"$(inherited)"',
+ OTHER_LDFLAGS = 'OTHER_LDFLAGS',
+ config, buildSettings;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName)
+ continue;
+
+ if (!buildSettings[OTHER_LDFLAGS]
+ || buildSettings[OTHER_LDFLAGS] === INHERITED) {
+ buildSettings[OTHER_LDFLAGS] = [INHERITED];
+ }
+
+ buildSettings[OTHER_LDFLAGS].push(flag);
+ }
+}
+
+pbxProject.prototype.removeFromOtherLinkerFlags = function (flag) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ OTHER_LDFLAGS = 'OTHER_LDFLAGS',
+ config, buildSettings;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) {
+ continue;
+ }
+
+ if (buildSettings[OTHER_LDFLAGS]) {
+ var matches = buildSettings[OTHER_LDFLAGS].filter(function (p) {
+ return p.indexOf(flag) > -1;
+ });
+ matches.forEach(function (m) {
+ var idx = buildSettings[OTHER_LDFLAGS].indexOf(m);
+ buildSettings[OTHER_LDFLAGS].splice(idx, 1);
+ });
+ }
+ }
+}
+
+pbxProject.prototype.addToBuildSettings = function (buildSetting, value) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ config, buildSettings;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ buildSettings[buildSetting] = value;
+ }
+}
+
+pbxProject.prototype.removeFromBuildSettings = function (buildSetting) {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ config, buildSettings;
+
+ for (config in configurations) {
+ buildSettings = configurations[config].buildSettings;
+
+ if (buildSettings[buildSetting]) {
+ delete buildSettings[buildSetting];
+ }
+ }
+}
+
+// a JS getter. hmmm
+pbxProject.prototype.__defineGetter__("productName", function() {
+ var configurations = nonComments(this.pbxXCBuildConfigurationSection()),
+ config, productName;
+
+ for (config in configurations) {
+ productName = configurations[config].buildSettings['PRODUCT_NAME'];
+
+ if (productName) {
+ return unquote(productName);
+ }
+ }
+});
+
+// check if file is present
+pbxProject.prototype.hasFile = function(filePath) {
+ var files = nonComments(this.pbxFileReferenceSection()),
+ file, id;
+ for (id in files) {
+ file = files[id];
+ if (file.path == filePath || file.path == ('"' + filePath + '"')) {
+ return file;
+ }
+ }
+
+ return false;
+}
+
+pbxProject.prototype.addTarget = function(name, type, subfolder) {
+
+ // Setup uuid and name of new target
+ var targetUuid = this.generateUuid(),
+ targetType = type,
+ targetSubfolder = subfolder || name,
+ targetName = name.trim();
+
+ // Check type against list of allowed target types
+ if (!targetName) {
+ throw new Error("Target name missing.");
+ }
+
+ // Check type against list of allowed target types
+ if (!targetType) {
+ throw new Error("Target type missing.");
+ }
+
+ // Check type against list of allowed target types
+ if (!producttypeForTargettype(targetType)) {
+ throw new Error("Target type invalid: " + targetType);
+ }
+
+ // Build Configuration: Create
+ var buildConfigurationsList = [
+ {
+ name: 'Debug',
+ isa: 'XCBuildConfiguration',
+ buildSettings: {
+ GCC_PREPROCESSOR_DEFINITIONS: ['"DEBUG=1"', '"$(inherited)"'],
+ INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
+ LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
+ PRODUCT_NAME: '"' + targetName + '"',
+ SKIP_INSTALL: 'YES'
+ }
+ },
+ {
+ name: 'Release',
+ isa: 'XCBuildConfiguration',
+ buildSettings: {
+ INFOPLIST_FILE: '"' + path.join(targetSubfolder, targetSubfolder + '-Info.plist' + '"'),
+ LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"',
+ PRODUCT_NAME: '"' + targetName + '"',
+ SKIP_INSTALL: 'YES'
+ }
+ }
+ ];
+
+ // Build Configuration: Add
+ var buildConfigurations = this.addXCConfigurationList(buildConfigurationsList, 'Release', 'Build configuration list for PBXNativeTarget "' + targetName +'"');
+
+ // Product: Create
+ var productName = targetName,
+ productType = producttypeForTargettype(targetType),
+ productFileType = filetypeForProducttype(productType),
+ productFile = this.addProductFile(productName, { group: 'Copy Files', 'target': targetUuid, 'explicitFileType': productFileType}),
+ productFileName = productFile.basename;
+
+
+ // Product: Add to build file list
+ this.addToPbxBuildFileSection(productFile);
+
+ // Target: Create
+ var target = {
+ uuid: targetUuid,
+ pbxNativeTarget: {
+ isa: 'PBXNativeTarget',
+ name: '"' + targetName + '"',
+ productName: '"' + targetName + '"',
+ productReference: productFile.fileRef,
+ productType: '"' + producttypeForTargettype(targetType) + '"',
+ buildConfigurationList: buildConfigurations.uuid,
+ buildPhases: [],
+ buildRules: [],
+ dependencies: []
+ }
+ };
+
+ // Target: Add to PBXNativeTarget section
+ this.addToPbxNativeTargetSection(target)
+
+ // Product: Embed (only for "extension"-type targets)
+ if (targetType === 'app_extension') {
+
+ // Create CopyFiles phase in first target
+ this.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Copy Files', this.getFirstTarget().uuid, targetType)
+
+ // Add product to CopyFiles phase
+ this.addToPbxCopyfilesBuildPhase(productFile)
+
+ // this.addBuildPhaseToTarget(newPhase.buildPhase, this.getFirstTarget().uuid)
+
+ };
+
+ // Target: Add uuid to root project
+ this.addToPbxProjectSection(target);
+
+ // Target: Add dependency for this target to first (main) target
+ this.addTargetDependency(this.getFirstTarget().uuid, [target.uuid]);
+
+
+ // Return target on success
+ return target;
+
+};
+
+// helper recursive prop search+replace
+function propReplace(obj, prop, value) {
+ var o = {};
+ for (var p in obj) {
+ if (o.hasOwnProperty.call(obj, p)) {
+ if (typeof obj[p] == 'object' && !Array.isArray(obj[p])) {
+ propReplace(obj[p], prop, value);
+ } else if (p == prop) {
+ obj[p] = value;
+ }
+ }
+ }
+}
+
+// helper object creation functions
+function pbxBuildFileObj(file) {
+ var obj = Object.create(null);
+
+ obj.isa = 'PBXBuildFile';
+ obj.fileRef = file.fileRef;
+ obj.fileRef_comment = file.basename;
+ if (file.settings) obj.settings = file.settings;
+
+ return obj;
+}
+
+function pbxFileReferenceObj(file) {
+ var fileObject = {
+ isa: "PBXFileReference",
+ name: "\"" + file.basename + "\"",
+ path: "\"" + file.path.replace(/\\/g, '/') + "\"",
+ sourceTree: file.sourceTree,
+ fileEncoding: file.fileEncoding,
+ lastKnownFileType: file.lastKnownFileType,
+ explicitFileType: file.explicitFileType,
+ includeInIndex: file.includeInIndex
+ };
+
+ return fileObject;
+}
+
+function pbxGroupChild(file) {
+ var obj = Object.create(null);
+
+ obj.value = file.fileRef;
+ obj.comment = file.basename;
+
+ return obj;
+}
+
+function pbxBuildPhaseObj(file) {
+ var obj = Object.create(null);
+
+ obj.value = file.uuid;
+ obj.comment = longComment(file);
+
+ return obj;
+}
+
+function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName){
+
+ // Add additional properties for 'CopyFiles' build phase
+ var DESTINATION_BY_TARGETTYPE = {
+ application: 'wrapper',
+ app_extension: 'plugins',
+ bundle: 'wrapper',
+ command_line_tool: 'wrapper',
+ dynamic_library: 'products_directory',
+ framework: 'shared_frameworks',
+ static_library: 'products_directory',
+ unit_test_bundle: 'wrapper',
+ watch_app: 'wrapper',
+ watch_extension: 'plugins'
+ }
+ var SUBFOLDERSPEC_BY_DESTINATION = {
+ absolute_path: 0,
+ executables: 6,
+ frameworks: 10,
+ java_resources: 15,
+ plugins: 13,
+ products_directory: 16,
+ resources: 7,
+ shared_frameworks: 11,
+ shared_support: 12,
+ wrapper: 1,
+ xpc_services: 0
+ }
+
+ obj.name = '"' + phaseName + '"';
+ obj.dstPath = subfolderPath || '""';
+ obj.dstSubfolderSpec = SUBFOLDERSPEC_BY_DESTINATION[DESTINATION_BY_TARGETTYPE[folderType]];
+
+ return obj;
+}
+
+function pbxBuildFileComment(file) {
+ return longComment(file);
+}
+
+function pbxFileReferenceComment(file) {
+ return file.basename || path.basename(file.path);
+}
+
+function pbxNativeTargetComment(target) {
+ return target.name;
+}
+
+function longComment(file) {
+ return f("%s in %s", file.basename, file.group);
+}
+
+// respect <group> path
+function correctForPluginsPath(file, project) {
+ return correctForPath(file, project, 'Plugins');
+}
+
+function correctForResourcesPath(file, project) {
+ return correctForPath(file, project, 'Resources');
+}
+
+function correctForFrameworksPath(file, project) {
+ return correctForPath(file, project, 'Frameworks');
+}
+
+function correctForPath(file, project, group) {
+ var r_group_dir = new RegExp('^' + group + '[\\\\/]');
+
+ if (project.pbxGroupByName(group).path)
+ file.path = file.path.replace(r_group_dir, '');
+
+ return file;
+}
+
+function searchPathForFile(file, proj) {
+ var plugins = proj.pbxGroupByName('Plugins'),
+ pluginsPath = plugins ? plugins.path : null,
+ fileDir = path.dirname(file.path);
+
+ if (fileDir == '.') {
+ fileDir = '';
+ } else {
+ fileDir = '/' + fileDir;
+ }
+
+ if (file.plugin && pluginsPath) {
+ return '"\\"$(SRCROOT)/' + unquote(pluginsPath) + '\\""';
+ } else if (file.customFramework && file.dirname) {
+ return '"\\"' + file.dirname + '\\""';
+ } else {
+ return '"\\"$(SRCROOT)/' + proj.productName + fileDir + '\\""';
+ }
+}
+
+function nonComments(obj) {
+ var keys = Object.keys(obj),
+ newObj = {}, i = 0;
+
+ for (i; i < keys.length; i++) {
+ if (!COMMENT_KEY.test(keys[i])) {
+ newObj[keys[i]] = obj[keys[i]];
+ }
+ }
+
+ return newObj;
+}
+
+function unquote(str) {
+ if (str) return str.replace(/^"(.*)"$/, "$1");
+}
+
+
+function buildPhaseNameForIsa (isa) {
+
+ BUILDPHASENAME_BY_ISA = {
+ PBXCopyFilesBuildPhase: 'Copy Files',
+ PBXResourcesBuildPhase: 'Resources',
+ PBXSourcesBuildPhase: 'Sources',
+ PBXFrameworksBuildPhase: 'Frameworks'
+ }
+
+ return BUILDPHASENAME_BY_ISA[isa]
+}
+
+function producttypeForTargettype (targetType) {
+
+ PRODUCTTYPE_BY_TARGETTYPE = {
+ application: 'com.apple.product-type.application',
+ app_extension: 'com.apple.product-type.app-extension',
+ bundle: 'com.apple.product-type.bundle',
+ command_line_tool: 'com.apple.product-type.tool',
+ dynamic_library: 'com.apple.product-type.library.dynamic',
+ framework: 'com.apple.product-type.framework',
+ static_library: 'com.apple.product-type.library.static',
+ unit_test_bundle: 'com.apple.product-type.bundle.unit-test',
+ watch_app: 'com.apple.product-type.application.watchapp',
+ watch_extension: 'com.apple.product-type.watchkit-extension'
+ };
+
+ return PRODUCTTYPE_BY_TARGETTYPE[targetType]
+}
+
+function filetypeForProducttype (productType) {
+
+ FILETYPE_BY_PRODUCTTYPE = {
+ 'com.apple.product-type.application': '"wrapper.application"',
+ 'com.apple.product-type.app-extension': '"wrapper.app-extension"',
+ 'com.apple.product-type.bundle': '"wrapper.plug-in"',
+ 'com.apple.product-type.tool': '"compiled.mach-o.dylib"',
+ 'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"',
+ 'com.apple.product-type.framework': '"wrapper.framework"',
+ 'com.apple.product-type.library.static': '"archive.ar"',
+ 'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"',
+ 'com.apple.product-type.application.watchapp': '"wrapper.application"',
+ 'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"'
+ };
+
+ return FILETYPE_BY_PRODUCTTYPE[productType]
+}
+
+pbxProject.prototype.getFirstProject = function() {
+
+ // Get pbxProject container
+ var pbxProjectContainer = this.pbxProjectSection();
+
+ // Get first pbxProject UUID
+ var firstProjectUuid = Object.keys(pbxProjectContainer)[0];
+
+ // Get first pbxProject
+ var firstProject = pbxProjectContainer[firstProjectUuid];
+
+ return {
+ uuid: firstProjectUuid,
+ firstProject: firstProject
+ }
+}
+
+pbxProject.prototype.getFirstTarget = function() {
+
+ // Get first targets UUID
+ var firstTargetUuid = this.getFirstProject()['firstProject']['targets'][0].value;
+
+ // Get first pbxNativeTarget
+ var firstTarget = this.pbxNativeTargetSection()[firstTargetUuid];
+
+ return {
+ uuid: firstTargetUuid,
+ firstTarget: firstTarget
+ }
+}
+
+/*** NEW ***/
+
+pbxProject.prototype.addToPbxGroup = function (file, groupKey) {
+ var group = this.getPBXGroupByKey(groupKey);
+ if (group && group.children !== undefined) {
+ if (typeof file === 'string') {
+ //Group Key
+ var childGroup = {
+ value:file,
+ comment: this.getPBXGroupByKey(file).name
+ };
+
+ group.children.push(childGroup);
+ }
+ else {
+ //File Object
+ group.children.push(pbxGroupChild(file));
+ }
+ }
+}
+
+pbxProject.prototype.removeFromPbxGroup = function (file, groupKey) {
+ var group = this.getPBXGroupByKey(groupKey);
+ if (group) {
+ var groupChildren = group.children, i;
+ for(i in groupChildren) {
+ if(pbxGroupChild(file).value == groupChildren[i].value &&
+ pbxGroupChild(file).comment == groupChildren[i].comment) {
+ groupChildren.splice(i, 1);
+ break;
+ }
+ }
+ }
+}
+
+pbxProject.prototype.getPBXGroupByKey = function(key) {
+ return this.hash.project.objects['PBXGroup'][key];
+};
+
+pbxProject.prototype.findPBXGroupKey = function(criteria) {
+ var groups = this.hash.project.objects['PBXGroup'];
+ var target;
+
+ for (var key in groups) {
+ // only look for comments
+ if (COMMENT_KEY.test(key)) continue;
+
+ var group = groups[key];
+ if (criteria && criteria.path && criteria.name) {
+ if (criteria.path === group.path && criteria.name === group.name) {
+ target = key;
+ break
+ }
+ }
+ else if (criteria && criteria.path) {
+ if (criteria.path === group.path) {
+ target = key;
+ break
+ }
+ }
+ else if (criteria && criteria.name) {
+ if (criteria.name === group.name) {
+ target = key;
+ break
+ }
+ }
+ }
+
+ 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.getPBXObject = function(name) {
+ return this.hash.project.objects[name];
+}
+
+
+
+pbxProject.prototype.addFile = function (path, group, opt) {
+ var file = new pbxFile(path, opt);
+
+ // null is better for early errors
+ if (this.hasFile(file.path)) return null;
+
+ file.fileRef = this.generateUuid();
+
+ this.addToPbxFileReferenceSection(file); // PBXFileReference
+ this.addToPbxGroup(file, group); // PBXGroup
+
+ return file;
+}
+
+pbxProject.prototype.removeFile = function (path, group, opt) {
+ var file = new pbxFile(path, opt);
+
+ this.removeFromPbxFileReferenceSection(file); // PBXFileReference
+ this.removeFromPbxGroup(file, group); // PBXGroup
+
+ return file;
+}
+
+
+
+pbxProject.prototype.getBuildProperty = function(prop, build) {
+ var target;
+ var configs = this.pbxXCBuildConfigurationSection();
+ for (var configName in configs) {
+ if (!COMMENT_KEY.test(configName)) {
+ var config = configs[configName];
+ if ( (build && config.name === build) || (build === undefined) ) {
+ if (config.buildSettings[prop] !== undefined) {
+ target = config.buildSettings[prop];
+ }
+ }
+ }
+ }
+ return target;
+}
+
+pbxProject.prototype.getBuildConfigByName = function(name) {
+ var target = {};
+ var configs = this.pbxXCBuildConfigurationSection();
+ for (var configName in configs) {
+ if (!COMMENT_KEY.test(configName)) {
+ var config = configs[configName];
+ if (config.name === name) {
+ target[configName] = config;
+ }
+ }
+ }
+ return target;
+}
+
+pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) {
+ if (!group) {
+ group = 'Resources';
+ }
+ if (!this.getPBXGroupByKey(group)) {
+ group = this.findPBXGroupKey({ name: group });
+ }
+
+ var file = new pbxFile(filePath, opt);
+
+ if (!file || this.hasFile(file.path)) return null;
+
+ file.fileRef = this.generateUuid();
+ this.addToPbxGroup(file, group);
+
+ if (!file) return false;
+
+ file.target = opt ? opt.target : undefined;
+ file.uuid = this.generateUuid();
+
+ this.addToPbxBuildFileSection(file);
+ this.addToPbxSourcesBuildPhase(file);
+
+ file.models = [];
+ var currentVersionName;
+ var modelFiles = fs.readdirSync(file.path);
+ for (var index in modelFiles) {
+ var modelFileName = modelFiles[index];
+ var modelFilePath = path.join(filePath, modelFileName);
+
+ if (modelFileName == '.xccurrentversion') {
+ currentVersionName = plist.readFileSync(modelFilePath)._XCCurrentVersionName;
+ continue;
+ }
+
+ var modelFile = new pbxFile(modelFilePath);
+ modelFile.fileRef = this.generateUuid();
+
+ this.addToPbxFileReferenceSection(modelFile);
+
+ file.models.push(modelFile);
+
+ if (currentVersionName && currentVersionName === modelFileName) {
+ file.currentModel = modelFile;
+ }
+ }
+
+ if (!file.currentModel) {
+ file.currentModel = file.models[0];
+ }
+
+ this.addToXcVersionGroupSection(file);
+
+ return file;
+}
+
+
+module.exports = pbxProject;
diff --git a/package.json b/package.json
index 2b27495..58bcdda 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,8 @@
"author": "Andrew Lunny <alunny@gmail.com>",
"name": "xcode",
"description": "parser for xcodeproj/project.pbxproj files",
- "version": "0.8.0",
- "main":"index.js",
+ "version": "0.8.3",
+ "main": "index.js",
"repository": {
"url": "https://github.com/alunny/node-xcode.git"
},
@@ -11,8 +11,9 @@
"node": ">=0.6.7"
},
"dependencies": {
+ "node-uuid":"1.3.3",
"pegjs":"0.6.2",
- "node-uuid":"1.3.3"
+ "simple-plist": "0.0.4"
},
"devDependencies": {
"nodeunit":"0.9.0"
diff --git a/test/BuildSettings.js b/test/BuildSettings.js
new file mode 100644
index 0000000..0d940a4
--- /dev/null
+++ b/test/BuildSettings.js
@@ -0,0 +1,41 @@
+var fullProject = require('./fixtures/full-project')
+ fullProjectStr = JSON.stringify(fullProject),
+ pbx = require('../lib/pbxProject'),
+ pbxFile = require('../lib/pbxFile'),
+ proj = new pbx('.');
+
+function cleanHash() {
+ return JSON.parse(fullProjectStr);
+}
+
+exports.setUp = function (callback) {
+ proj.hash = cleanHash();
+ callback();
+}
+
+var PRODUCT_NAME = '"KitchenSinktablet"';
+
+exports.addAndRemoveToFromBuildSettings = {
+ 'add should add the build setting to each configuration section':function(test) {
+ var buildSetting = 'some/buildSetting';
+ var value = 'some/buildSetting';
+ proj.addToBuildSettings(buildSetting, value);
+ var config = proj.pbxXCBuildConfigurationSection();
+ for (var ref in config) {
+ if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
+ test.ok(config[ref].buildSettings[buildSetting] === value);
+ }
+ test.done();
+ },
+ 'remove should remove from the build settings in each configuration section':function(test) {
+ var buildSetting = 'some/buildSetting';
+ proj.addToBuildSettings(buildSetting, 'some/buildSetting');
+ proj.removeFromBuildSettings(buildSetting);
+ var config = proj.pbxXCBuildConfigurationSection();
+ for (var ref in config) {
+ if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
+ test.ok(!config[ref].buildSettings.hasOwnProperty(buildSetting));
+ }
+ test.done();
+ }
+}
diff --git a/test/OtherLinkerFlags.js b/test/OtherLinkerFlags.js
new file mode 100644
index 0000000..ad99c8d
--- /dev/null
+++ b/test/OtherLinkerFlags.js
@@ -0,0 +1,43 @@
+var fullProject = require('./fixtures/full-project')
+ fullProjectStr = JSON.stringify(fullProject),
+ pbx = require('../lib/pbxProject'),
+ pbxFile = require('../lib/pbxFile'),
+ proj = new pbx('.');
+
+function cleanHash() {
+ return JSON.parse(fullProjectStr);
+}
+
+exports.setUp = function (callback) {
+ proj.hash = cleanHash();
+ callback();
+}
+
+var PRODUCT_NAME = '"KitchenSinktablet"';
+
+exports.addAndRemoveToFromOtherLinkerFlags = {
+ 'add should add the flag to each configuration section':function(test) {
+ var flag = 'some/flag';
+ proj.addToOtherLinkerFlags(flag);
+ var config = proj.pbxXCBuildConfigurationSection();
+ for (var ref in config) {
+ if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
+ var lib = config[ref].buildSettings.OTHER_LDFLAGS;
+ test.ok(lib[1].indexOf(flag) > -1);
+ }
+ test.done();
+ },
+ 'remove should remove from the path to each configuration section':function(test) {
+ var flag = 'some/flag';
+ proj.addToOtherLinkerFlags(flag);
+ proj.removeFromOtherLinkerFlags(flag);
+ var config = proj.pbxXCBuildConfigurationSection();
+ for (var ref in config) {
+ if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue;
+ var lib = config[ref].buildSettings.OTHER_LDFLAGS;
+ test.ok(lib.length === 1);
+ test.ok(lib[0].indexOf(flag) == -1);
+ }
+ test.done();
+ }
+}
diff --git a/test/addFramework.js b/test/addFramework.js
index 6b36f4b..efae42e 100644
--- a/test/addFramework.js
+++ b/test/addFramework.js
@@ -128,7 +128,19 @@
test.equal(buildFileEntry.fileRef, newFile.fileRef);
test.equal(buildFileEntry.fileRef_comment, 'libsqlite3.dylib');
test.deepEqual(buildFileEntry.settings, { ATTRIBUTES: [ 'Weak' ] });
-
+
+ test.done();
+ },
+ 'should add the PBXBuildFile object correctly /w signable frameworks': function (test) {
+ var newFile = proj.addFramework('libsqlite3.dylib', { sign: true }),
+ buildFileSection = proj.pbxBuildFileSection(),
+ buildFileEntry = buildFileSection[newFile.uuid];
+
+ test.equal(buildFileEntry.isa, 'PBXBuildFile');
+ test.equal(buildFileEntry.fileRef, newFile.fileRef);
+ test.equal(buildFileEntry.fileRef_comment, 'libsqlite3.dylib');
+ test.deepEqual(buildFileEntry.settings, { ATTRIBUTES: [ 'CodeSignOnCopy' ] });
+
test.done();
},
'should add to the Frameworks PBXGroup': function (test) {
@@ -155,6 +167,13 @@
test.equal(frameworks.files.length, 16);
test.done();
},
+ 'should not add to the PBXFrameworksBuildPhase': function (test) {
+ var newFile = proj.addFramework('Private.framework', {link: false}),
+ frameworks = proj.pbxFrameworksBuildPhaseObj();
+
+ test.equal(frameworks.files.length, 15);
+ test.done();
+ },
'should have the right values for the Sources entry': function (test) {
var newFile = proj.addFramework('libsqlite3.dylib'),
frameworks = proj.pbxFrameworksBuildPhaseObj(),
@@ -188,12 +207,26 @@
// should add path to framework search path
var frameworkPaths = frameworkSearchPaths(proj);
expectedPath = '"\\"/path/to\\""';
-
+
for (i = 0; i < frameworkPaths.length; i++) {
var current = frameworkPaths[i];
test.ok(current.indexOf('"$(inherited)"') >= 0);
test.ok(current.indexOf(expectedPath) >= 0);
}
test.done();
- }
+ },
+ 'should add to the Embed Frameworks PBXCopyFilesBuildPhase': function (test) {
+ var newFile = proj.addFramework('/path/to/SomeEmbeddableCustom.framework', {customFramework: true, embed: true}),
+ frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
+
+ test.equal(frameworks.files.length, 1);
+ test.done();
+ },
+ 'should not add to the Embed Frameworks PBXCopyFilesBuildPhase by default': function (test) {
+ var newFile = proj.addFramework('/path/to/Custom.framework', {customFramework: true}),
+ frameworks = proj.pbxEmbedFrameworksBuildPhaseObj();
+
+ test.equal(frameworks.files.length, 0);
+ test.done();
+ },
}
diff --git a/test/addPbxGroup.js b/test/addRemovePbxGroup.js
similarity index 94%
rename from test/addPbxGroup.js
rename to test/addRemovePbxGroup.js
index 433d30e..7c6e978 100644
--- a/test/addPbxGroup.js
+++ b/test/addRemovePbxGroup.js
@@ -12,7 +12,7 @@
callback();
}
-exports.addPbxGroup = {
+exports.addRemovePbxGroup = {
'should return a pbxGroup': function (test) {
var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '"<group>"');
@@ -145,5 +145,16 @@
// for each file added in the file reference section two keyes are added - one for the object and one for the comment
test.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4);
test.done();
+ },
+ 'should remove a pbxGroup': function (test) {
+ var groupName = 'MyGroup';
+ proj.addPbxGroup(['file.m'], groupName, 'Application', 'Application', '"<group>"');
+ proj.removePbxGroup(groupName);
+
+ var pbxGroupInPbx = proj.pbxGroupByName(groupName);
+ console.log(pbxGroupInPbx);
+
+ test.ok(!pbxGroupInPbx);
+ test.done()
}
}
diff --git a/test/dataModelDocument.js b/test/dataModelDocument.js
new file mode 100644
index 0000000..fa0b8a8
--- /dev/null
+++ b/test/dataModelDocument.js
@@ -0,0 +1,162 @@
+var jsonProject = require('./fixtures/full-project')
+ fullProjectStr = JSON.stringify(jsonProject),
+ path = require('path'),
+ pbx = require('../lib/pbxProject'),
+ pbxFile = require('../lib/pbxFile'),
+ proj = new pbx('.'),
+ singleDataModelFilePath = __dirname + '/fixtures/single-data-model.xcdatamodeld',
+ multipleDataModelFilePath = __dirname + '/fixtures/multiple-data-model.xcdatamodeld';
+
+function cleanHash() {
+ return JSON.parse(fullProjectStr);
+}
+
+exports.setUp = function (callback) {
+ proj.hash = cleanHash();
+ callback();
+}
+
+exports.dataModelDocument = {
+ 'should return a pbxFile': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath);
+
+ test.equal(newFile.constructor, pbxFile);
+ test.done()
+ },
+ 'should set a uuid on the pbxFile': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath);
+
+ test.ok(newFile.uuid);
+ test.done()
+ },
+ 'should set a fileRef on the pbxFile': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath);
+
+ test.ok(newFile.fileRef);
+ test.done()
+ },
+ 'should set an optional target on the pbxFile': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath, undefined, { target: target }),
+ target = proj.findTargetKey('TestApp');
+
+ test.equal(newFile.target, target);
+ test.done()
+ },
+ 'should populate the PBXBuildFile section with 2 fields': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ buildFileSection = proj.pbxBuildFileSection(),
+ bfsLength = Object.keys(buildFileSection).length;
+
+ test.equal(59 + 1, bfsLength);
+ test.ok(buildFileSection[newFile.uuid]);
+ test.ok(buildFileSection[newFile.uuid + '_comment']);
+
+ test.done();
+ },
+ 'should populate the PBXFileReference section with 2 fields for single model document': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ fileRefSection = proj.pbxFileReferenceSection(),
+ frsLength = Object.keys(fileRefSection).length;
+
+ test.equal(66 + 2, frsLength);
+ test.ok(fileRefSection[newFile.models[0].fileRef]);
+ test.ok(fileRefSection[newFile.models[0].fileRef + '_comment']);
+
+ test.done();
+ },
+ 'should populate the PBXFileReference section with 2 fields for each model of a model document': function (test) {
+ var newFile = proj.addDataModelDocument(multipleDataModelFilePath),
+ fileRefSection = proj.pbxFileReferenceSection(),
+ frsLength = Object.keys(fileRefSection).length;
+
+ test.equal(66 + 2 * 2, frsLength);
+ test.ok(fileRefSection[newFile.models[0].fileRef]);
+ test.ok(fileRefSection[newFile.models[0].fileRef + '_comment']);
+ test.ok(fileRefSection[newFile.models[1].fileRef]);
+ test.ok(fileRefSection[newFile.models[1].fileRef + '_comment']);
+
+ test.done();
+ },
+ 'should add to resources group by default': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath);
+ groupChildren = proj.pbxGroupByName('Resources').children,
+ found = false;
+
+ for (var index in groupChildren) {
+ if (groupChildren[index].comment === 'single-data-model.xcdatamodeld') {
+ found = true;
+ break;
+ }
+ }
+ test.ok(found);
+ test.done();
+ },
+ 'should add to group specified by key': function (test) {
+ var group = 'Frameworks',
+ newFile = proj.addDataModelDocument(singleDataModelFilePath, proj.findPBXGroupKey({ name: group }));
+ groupChildren = proj.pbxGroupByName(group).children;
+
+ var found = false;
+ for (var index in groupChildren) {
+ if (groupChildren[index].comment === path.basename(singleDataModelFilePath)) {
+ found = true;
+ break;
+ }
+ }
+ test.ok(found);
+ test.done();
+ },
+ 'should add to group specified by name': function (test) {
+ var group = 'Frameworks',
+ newFile = proj.addDataModelDocument(singleDataModelFilePath, group);
+ groupChildren = proj.pbxGroupByName(group).children;
+
+ var found = false;
+ for (var index in groupChildren) {
+ if (groupChildren[index].comment === path.basename(singleDataModelFilePath)) {
+ found = true;
+ break;
+ }
+ }
+ test.ok(found);
+ test.done();
+ },
+ 'should add to the PBXSourcesBuildPhase': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ sources = proj.pbxSourcesBuildPhaseObj();
+
+ test.equal(sources.files.length, 2 + 1);
+ test.done();
+ },
+ 'should create a XCVersionGroup section': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ xcVersionGroupSection = proj.xcVersionGroupSection();
+
+ test.ok(xcVersionGroupSection[newFile.fileRef]);
+ test.done();
+ },
+ 'should populate the XCVersionGroup comment correctly': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ xcVersionGroupSection = proj.xcVersionGroupSection(),
+ commentKey = newFile.fileRef + '_comment';
+
+ test.equal(xcVersionGroupSection[commentKey], path.basename(singleDataModelFilePath));
+ test.done();
+ },
+ 'should add the XCVersionGroup object correctly': function (test) {
+ var newFile = proj.addDataModelDocument(singleDataModelFilePath),
+ xcVersionGroupSection = proj.xcVersionGroupSection(),
+ xcVersionGroupEntry = xcVersionGroupSection[newFile.fileRef];
+
+ test.equal(xcVersionGroupEntry.isa, 'XCVersionGroup');
+ test.equal(xcVersionGroupEntry.children[0], newFile.models[0].fileRef);
+ test.equal(xcVersionGroupEntry.currentVersion, newFile.currentModel.fileRef);
+ test.equal(xcVersionGroupEntry.name, path.basename(singleDataModelFilePath));
+ // Need to validate against normalized path, since paths should contain forward slash on OSX
+ test.equal(xcVersionGroupEntry.path, singleDataModelFilePath.replace(/\\/g, '/'));
+ test.equal(xcVersionGroupEntry.sourceTree, '"<group>"');
+ test.equal(xcVersionGroupEntry.versionGroupType, 'wrapper.xcdatamodel');
+
+ test.done();
+ }
+}
diff --git a/test/fixtures/full-project.json b/test/fixtures/full-project.json
index ae4a5a7..09ec88e 100644
--- a/test/fixtures/full-project.json
+++ b/test/fixtures/full-project.json
@@ -1 +1,1252 @@
-{"project":{"archiveVersion":1,"classes":{},"objectVersion":45,"objects":{"PBXBuildFile":{"1D3623260D0F684500981E51":{"isa":"PBXBuildFile","fileRef":"1D3623250D0F684500981E51","fileRef_comment":"AppDelegate.m"},"1D3623260D0F684500981E51_comment":"AppDelegate.m in Sources","1D60589B0D05DD56006BFB54":{"isa":"PBXBuildFile","fileRef":"29B97316FDCFA39411CA2CEA","fileRef_comment":"main.m"},"1D60589B0D05DD56006BFB54_comment":"main.m in Sources","1D60589F0D05DD5A006BFB54":{"isa":"PBXBuildFile","fileRef":"1D30AB110D05D00D00671497","fileRef_comment":"Foundation.framework"},"1D60589F0D05DD5A006BFB54_comment":"Foundation.framework in Frameworks","1DF5F4E00D08C38300B7A737":{"isa":"PBXBuildFile","fileRef":"1DF5F4DF0D08C38300B7A737","fileRef_comment":"UIKit.framework","settings":{"ATTRIBUTES":["Weak"]}},"1DF5F4E00D08C38300B7A737_comment":"UIKit.framework in Frameworks","1F766FE113BBADB100FB74C0":{"isa":"PBXBuildFile","fileRef":"1F766FDC13BBADB100FB74C0","fileRef_comment":"Localizable.strings"},"1F766FE113BBADB100FB74C0_comment":"Localizable.strings in Resources","1F766FE213BBADB100FB74C0":{"isa":"PBXBuildFile","fileRef":"1F766FDF13BBADB100FB74C0","fileRef_comment":"Localizable.strings"},"1F766FE213BBADB100FB74C0_comment":"Localizable.strings in Resources","288765FD0DF74451002DB57D":{"isa":"PBXBuildFile","fileRef":"288765FC0DF74451002DB57D","fileRef_comment":"CoreGraphics.framework"},"288765FD0DF74451002DB57D_comment":"CoreGraphics.framework in Frameworks","301BF552109A68D80062928A":{"isa":"PBXBuildFile","fileRef":"301BF535109A57CC0062928A","fileRef_comment":"libPhoneGap.a"},"301BF552109A68D80062928A_comment":"libPhoneGap.a in Frameworks","301BF570109A69640062928A":{"isa":"PBXBuildFile","fileRef":"301BF56E109A69640062928A","fileRef_comment":"www"},"301BF570109A69640062928A_comment":"www in Resources","301BF5B5109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5B4109A6A2B0062928A","fileRef_comment":"AddressBook.framework"},"301BF5B5109A6A2B0062928A_comment":"AddressBook.framework in Frameworks","301BF5B7109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5B6109A6A2B0062928A","fileRef_comment":"AddressBookUI.framework"},"301BF5B7109A6A2B0062928A_comment":"AddressBookUI.framework in Frameworks","301BF5B9109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5B8109A6A2B0062928A","fileRef_comment":"AudioToolbox.framework"},"301BF5B9109A6A2B0062928A_comment":"AudioToolbox.framework in Frameworks","301BF5BB109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5BA109A6A2B0062928A","fileRef_comment":"AVFoundation.framework","settings":{"ATTRIBUTES":["Weak"]}},"301BF5BB109A6A2B0062928A_comment":"AVFoundation.framework in Frameworks","301BF5BD109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5BC109A6A2B0062928A","fileRef_comment":"CFNetwork.framework"},"301BF5BD109A6A2B0062928A_comment":"CFNetwork.framework in Frameworks","301BF5BF109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5BE109A6A2B0062928A","fileRef_comment":"CoreLocation.framework"},"301BF5BF109A6A2B0062928A_comment":"CoreLocation.framework in Frameworks","301BF5C1109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5C0109A6A2B0062928A","fileRef_comment":"MediaPlayer.framework"},"301BF5C1109A6A2B0062928A_comment":"MediaPlayer.framework in Frameworks","301BF5C3109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5C2109A6A2B0062928A","fileRef_comment":"QuartzCore.framework"},"301BF5C3109A6A2B0062928A_comment":"QuartzCore.framework in Frameworks","301BF5C5109A6A2B0062928A":{"isa":"PBXBuildFile","fileRef":"301BF5C4109A6A2B0062928A","fileRef_comment":"SystemConfiguration.framework"},"301BF5C5109A6A2B0062928A_comment":"SystemConfiguration.framework in Frameworks","3053AC6F109B7857006FCFE7":{"isa":"PBXBuildFile","fileRef":"3053AC6E109B7857006FCFE7","fileRef_comment":"VERSION"},"3053AC6F109B7857006FCFE7_comment":"VERSION in Resources","305D5FD1115AB8F900A74A75":{"isa":"PBXBuildFile","fileRef":"305D5FD0115AB8F900A74A75","fileRef_comment":"MobileCoreServices.framework"},"305D5FD1115AB8F900A74A75_comment":"MobileCoreServices.framework in Frameworks","3072F99713A8081B00425683":{"isa":"PBXBuildFile","fileRef":"3072F99613A8081B00425683","fileRef_comment":"Capture.bundle"},"3072F99713A8081B00425683_comment":"Capture.bundle in Resources","307D28A2123043360040C0FA":{"isa":"PBXBuildFile","fileRef":"307D28A1123043350040C0FA","fileRef_comment":"PhoneGapBuildSettings.xcconfig"},"307D28A2123043360040C0FA_comment":"PhoneGapBuildSettings.xcconfig in Resources","308D05371370CCF300D202BF":{"isa":"PBXBuildFile","fileRef":"308D052E1370CCF300D202BF","fileRef_comment":"icon-72.png"},"308D05371370CCF300D202BF_comment":"icon-72.png in Resources","308D05381370CCF300D202BF":{"isa":"PBXBuildFile","fileRef":"308D052F1370CCF300D202BF","fileRef_comment":"icon.png"},"308D05381370CCF300D202BF_comment":"icon.png in Resources","308D05391370CCF300D202BF":{"isa":"PBXBuildFile","fileRef":"308D05301370CCF300D202BF","fileRef_comment":"icon@2x.png"},"308D05391370CCF300D202BF_comment":"icon@2x.png in Resources","308D053C1370CCF300D202BF":{"isa":"PBXBuildFile","fileRef":"308D05341370CCF300D202BF","fileRef_comment":"Default.png"},"308D053C1370CCF300D202BF_comment":"Default.png in Resources","308D053D1370CCF300D202BF":{"isa":"PBXBuildFile","fileRef":"308D05351370CCF300D202BF","fileRef_comment":"Default@2x.png"},"308D053D1370CCF300D202BF_comment":"Default@2x.png in Resources","30E1352710E2C1420031B30D":{"isa":"PBXBuildFile","fileRef":"30E1352610E2C1420031B30D","fileRef_comment":"PhoneGap.plist"},"30E1352710E2C1420031B30D_comment":"PhoneGap.plist in Resources","30E5649213A7FCAF007403D8":{"isa":"PBXBuildFile","fileRef":"30E5649113A7FCAF007403D8","fileRef_comment":"CoreMedia.framework","settings":{"ATTRIBUTES":["Weak"]}},"30E5649213A7FCAF007403D8_comment":"CoreMedia.framework in Frameworks"},"PBXContainerItemProxy":{"301BF534109A57CC0062928A":{"isa":"PBXContainerItemProxy","containerPortal":"301BF52D109A57CC0062928A","containerPortal_comment":"PhoneGapLib.xcodeproj","proxyType":2,"remoteGlobalIDString":"D2AAC07E0554694100DB518D","remoteInfo":"PhoneGapLib"},"301BF534109A57CC0062928A_comment":"PBXContainerItemProxy","301BF550109A68C00062928A":{"isa":"PBXContainerItemProxy","containerPortal":"301BF52D109A57CC0062928A","containerPortal_comment":"PhoneGapLib.xcodeproj","proxyType":1,"remoteGlobalIDString":"D2AAC07D0554694100DB518D","remoteInfo":"PhoneGapLib"},"301BF550109A68C00062928A_comment":"PBXContainerItemProxy","30E47BC2136F595F00DBB853":{"isa":"PBXContainerItemProxy","containerPortal":"301BF52D109A57CC0062928A","containerPortal_comment":"PhoneGapLib.xcodeproj","proxyType":2,"remoteGlobalIDString":"303258D8136B2C9400982B63","remoteInfo":"PhoneGap"},"30E47BC2136F595F00DBB853_comment":"PBXContainerItemProxy"},"PBXFileReference":{"1D30AB110D05D00D00671497":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"Foundation.framework","path":"System/Library/Frameworks/Foundation.framework","sourceTree":"SDKROOT"},"1D30AB110D05D00D00671497_comment":"Foundation.framework","1D3623240D0F684500981E51":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"sourcecode.c.h","path":"AppDelegate.h","sourceTree":"\"<group>\""},"1D3623240D0F684500981E51_comment":"AppDelegate.h","1D3623250D0F684500981E51":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"sourcecode.c.objc","path":"AppDelegate.m","sourceTree":"\"<group>\""},"1D3623250D0F684500981E51_comment":"AppDelegate.m","1D6058910D05DD3D006BFB54":{"isa":"PBXFileReference","explicitFileType":"wrapper.application","includeInIndex":0,"path":"\"KitchenSinktablet.app\"","sourceTree":"BUILT_PRODUCTS_DIR"},"1D6058910D05DD3D006BFB54_comment":"KitchenSinktablet.app","1DF5F4DF0D08C38300B7A737":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"UIKit.framework","path":"System/Library/Frameworks/UIKit.framework","sourceTree":"SDKROOT"},"1DF5F4DF0D08C38300B7A737_comment":"UIKit.framework","1F766FDD13BBADB100FB74C0":{"isa":"PBXFileReference","lastKnownFileType":"text.plist.strings","name":"en","path":"Localizable.strings","sourceTree":"\"<group>\""},"1F766FDD13BBADB100FB74C0_comment":"en","1F766FE013BBADB100FB74C0":{"isa":"PBXFileReference","lastKnownFileType":"text.plist.strings","name":"es","path":"Localizable.strings","sourceTree":"\"<group>\""},"1F766FE013BBADB100FB74C0_comment":"es","288765FC0DF74451002DB57D":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"CoreGraphics.framework","path":"System/Library/Frameworks/CoreGraphics.framework","sourceTree":"SDKROOT"},"288765FC0DF74451002DB57D_comment":"CoreGraphics.framework","29B97316FDCFA39411CA2CEA":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"sourcecode.c.objc","path":"main.m","sourceTree":"\"<group>\""},"29B97316FDCFA39411CA2CEA_comment":"main.m","301BF52D109A57CC0062928A":{"isa":"PBXFileReference","lastKnownFileType":"\"wrapper.pb-project\"","path":"PhoneGapLib.xcodeproj","sourceTree":"PHONEGAPLIB"},"301BF52D109A57CC0062928A_comment":"PhoneGapLib.xcodeproj","301BF56E109A69640062928A":{"isa":"PBXFileReference","lastKnownFileType":"folder","path":"www","sourceTree":"SOURCE_ROOT"},"301BF56E109A69640062928A_comment":"www","301BF5B4109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"AddressBook.framework","path":"System/Library/Frameworks/AddressBook.framework","sourceTree":"SDKROOT"},"301BF5B4109A6A2B0062928A_comment":"AddressBook.framework","301BF5B6109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"AddressBookUI.framework","path":"System/Library/Frameworks/AddressBookUI.framework","sourceTree":"SDKROOT"},"301BF5B6109A6A2B0062928A_comment":"AddressBookUI.framework","301BF5B8109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"AudioToolbox.framework","path":"System/Library/Frameworks/AudioToolbox.framework","sourceTree":"SDKROOT"},"301BF5B8109A6A2B0062928A_comment":"AudioToolbox.framework","301BF5BA109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"AVFoundation.framework","path":"System/Library/Frameworks/AVFoundation.framework","sourceTree":"SDKROOT"},"301BF5BA109A6A2B0062928A_comment":"AVFoundation.framework","301BF5BC109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"CFNetwork.framework","path":"System/Library/Frameworks/CFNetwork.framework","sourceTree":"SDKROOT"},"301BF5BC109A6A2B0062928A_comment":"CFNetwork.framework","301BF5BE109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"CoreLocation.framework","path":"System/Library/Frameworks/CoreLocation.framework","sourceTree":"SDKROOT"},"301BF5BE109A6A2B0062928A_comment":"CoreLocation.framework","301BF5C0109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"MediaPlayer.framework","path":"System/Library/Frameworks/MediaPlayer.framework","sourceTree":"SDKROOT"},"301BF5C0109A6A2B0062928A_comment":"MediaPlayer.framework","301BF5C2109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"QuartzCore.framework","path":"System/Library/Frameworks/QuartzCore.framework","sourceTree":"SDKROOT"},"301BF5C2109A6A2B0062928A_comment":"QuartzCore.framework","301BF5C4109A6A2B0062928A":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"SystemConfiguration.framework","path":"System/Library/Frameworks/SystemConfiguration.framework","sourceTree":"SDKROOT"},"301BF5C4109A6A2B0062928A_comment":"SystemConfiguration.framework","3053AC6E109B7857006FCFE7":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"text","path":"VERSION","sourceTree":"PHONEGAPLIB"},"3053AC6E109B7857006FCFE7_comment":"VERSION","305D5FD0115AB8F900A74A75":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"MobileCoreServices.framework","path":"System/Library/Frameworks/MobileCoreServices.framework","sourceTree":"SDKROOT"},"305D5FD0115AB8F900A74A75_comment":"MobileCoreServices.framework","3072F99613A8081B00425683":{"isa":"PBXFileReference","lastKnownFileType":"\"wrapper.plug-in\"","name":"Capture.bundle","path":"Resources/Capture.bundle","sourceTree":"\"<group>\""},"3072F99613A8081B00425683_comment":"Capture.bundle","307D28A1123043350040C0FA":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"text.xcconfig","path":"PhoneGapBuildSettings.xcconfig","sourceTree":"\"<group>\""},"307D28A1123043350040C0FA_comment":"PhoneGapBuildSettings.xcconfig","308D052E1370CCF300D202BF":{"isa":"PBXFileReference","lastKnownFileType":"image.png","path":"\"icon-72.png\"","sourceTree":"\"<group>\""},"308D052E1370CCF300D202BF_comment":"icon-72.png","308D052F1370CCF300D202BF":{"isa":"PBXFileReference","lastKnownFileType":"image.png","path":"icon.png","sourceTree":"\"<group>\""},"308D052F1370CCF300D202BF_comment":"icon.png","308D05301370CCF300D202BF":{"isa":"PBXFileReference","lastKnownFileType":"image.png","path":"\"icon@2x.png\"","sourceTree":"\"<group>\""},"308D05301370CCF300D202BF_comment":"icon@2x.png","308D05341370CCF300D202BF":{"isa":"PBXFileReference","lastKnownFileType":"image.png","path":"Default.png","sourceTree":"\"<group>\""},"308D05341370CCF300D202BF_comment":"Default.png","308D05351370CCF300D202BF":{"isa":"PBXFileReference","lastKnownFileType":"image.png","path":"\"Default@2x.png\"","sourceTree":"\"<group>\""},"308D05351370CCF300D202BF_comment":"Default@2x.png","30E1352610E2C1420031B30D":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"text.plist.xml","path":"PhoneGap.plist","sourceTree":"\"<group>\""},"30E1352610E2C1420031B30D_comment":"PhoneGap.plist","30E5649113A7FCAF007403D8":{"isa":"PBXFileReference","lastKnownFileType":"wrapper.framework","name":"CoreMedia.framework","path":"System/Library/Frameworks/CoreMedia.framework","sourceTree":"SDKROOT"},"30E5649113A7FCAF007403D8_comment":"CoreMedia.framework","32CA4F630368D1EE00C91783":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"sourcecode.c.h","path":"\"KitchenSinktablet-Prefix.pch\"","sourceTree":"\"<group>\""},"32CA4F630368D1EE00C91783_comment":"KitchenSinktablet-Prefix.pch","8D1107310486CEB800E47090":{"isa":"PBXFileReference","fileEncoding":4,"lastKnownFileType":"text.plist.xml","path":"\"KitchenSinktablet-Info.plist\"","plistStructureDefinitionIdentifier":"\"com.apple.xcode.plist.structure-definition.iphone.info-plist\"","sourceTree":"\"<group>\""},"8D1107310486CEB800E47090_comment":"KitchenSinktablet-Info.plist"},"PBXFrameworksBuildPhase":{"1D60588F0D05DD3D006BFB54":{"isa":"PBXFrameworksBuildPhase","buildActionMask":2147483647,"files":[{"value":"301BF552109A68D80062928A","comment":"libPhoneGap.a in Frameworks"},{"value":"1D60589F0D05DD5A006BFB54","comment":"Foundation.framework in Frameworks"},{"value":"1DF5F4E00D08C38300B7A737","comment":"UIKit.framework in Frameworks"},{"value":"288765FD0DF74451002DB57D","comment":"CoreGraphics.framework in Frameworks"},{"value":"301BF5B5109A6A2B0062928A","comment":"AddressBook.framework in Frameworks"},{"value":"301BF5B7109A6A2B0062928A","comment":"AddressBookUI.framework in Frameworks"},{"value":"301BF5B9109A6A2B0062928A","comment":"AudioToolbox.framework in Frameworks"},{"value":"301BF5BB109A6A2B0062928A","comment":"AVFoundation.framework in Frameworks"},{"value":"301BF5BD109A6A2B0062928A","comment":"CFNetwork.framework in Frameworks"},{"value":"301BF5BF109A6A2B0062928A","comment":"CoreLocation.framework in Frameworks"},{"value":"301BF5C1109A6A2B0062928A","comment":"MediaPlayer.framework in Frameworks"},{"value":"301BF5C3109A6A2B0062928A","comment":"QuartzCore.framework in Frameworks"},{"value":"301BF5C5109A6A2B0062928A","comment":"SystemConfiguration.framework in Frameworks"},{"value":"305D5FD1115AB8F900A74A75","comment":"MobileCoreServices.framework in Frameworks"},{"value":"30E5649213A7FCAF007403D8","comment":"CoreMedia.framework in Frameworks"}],"runOnlyForDeploymentPostprocessing":0},"1D60588F0D05DD3D006BFB54_comment":"Frameworks"},"PBXGroup":{"080E96DDFE201D6D7F000001":{"isa":"PBXGroup","children":[{"value":"1D3623240D0F684500981E51","comment":"AppDelegate.h"},{"value":"1D3623250D0F684500981E51","comment":"AppDelegate.m"}],"path":"Classes","sourceTree":"SOURCE_ROOT"},"080E96DDFE201D6D7F000001_comment":"Classes","19C28FACFE9D520D11CA2CBB":{"isa":"PBXGroup","children":[{"value":"1D6058910D05DD3D006BFB54","comment":"KitchenSinktablet.app"}],"name":"Products","sourceTree":"\"<group>\""},"19C28FACFE9D520D11CA2CBB_comment":"Products","1F766FDB13BBADB100FB74C0":{"isa":"PBXGroup","children":[{"value":"1F766FDC13BBADB100FB74C0","comment":"Localizable.strings"}],"name":"en.lproj","path":"Resources/en.lproj","sourceTree":"\"<group>\""},"1F766FDB13BBADB100FB74C0_comment":"en.lproj","1F766FDE13BBADB100FB74C0":{"isa":"PBXGroup","children":[{"value":"1F766FDF13BBADB100FB74C0","comment":"Localizable.strings"}],"name":"es.lproj","path":"Resources/es.lproj","sourceTree":"\"<group>\""},"1F766FDE13BBADB100FB74C0_comment":"es.lproj","29B97314FDCFA39411CA2CEA":{"isa":"PBXGroup","children":[{"value":"301BF56E109A69640062928A","comment":"www"},{"value":"301BF52D109A57CC0062928A","comment":"PhoneGapLib.xcodeproj"},{"value":"080E96DDFE201D6D7F000001","comment":"Classes"},{"value":"307C750510C5A3420062BCA9","comment":"Plugins"},{"value":"29B97315FDCFA39411CA2CEA","comment":"Other Sources"},{"value":"29B97317FDCFA39411CA2CEA","comment":"Resources"},{"value":"29B97323FDCFA39411CA2CEA","comment":"Frameworks"},{"value":"19C28FACFE9D520D11CA2CBB","comment":"Products"}],"name":"CustomTemplate","sourceTree":"\"<group>\""},"29B97314FDCFA39411CA2CEA_comment":"CustomTemplate","29B97315FDCFA39411CA2CEA":{"isa":"PBXGroup","children":[{"value":"32CA4F630368D1EE00C91783","comment":"KitchenSinktablet-Prefix.pch"},{"value":"29B97316FDCFA39411CA2CEA","comment":"main.m"}],"name":"\"Other Sources\"","sourceTree":"\"<group>\""},"29B97315FDCFA39411CA2CEA_comment":"Other Sources","29B97317FDCFA39411CA2CEA":{"isa":"PBXGroup","children":[{"value":"1F766FDB13BBADB100FB74C0","comment":"en.lproj"},{"value":"1F766FDE13BBADB100FB74C0","comment":"es.lproj"},{"value":"3072F99613A8081B00425683","comment":"Capture.bundle"},{"value":"308D052D1370CCF300D202BF","comment":"icons"},{"value":"308D05311370CCF300D202BF","comment":"splash"},{"value":"30E1352610E2C1420031B30D","comment":"PhoneGap.plist"},{"value":"3053AC6E109B7857006FCFE7","comment":"VERSION"},{"value":"8D1107310486CEB800E47090","comment":"KitchenSinktablet-Info.plist"},{"value":"307D28A1123043350040C0FA","comment":"PhoneGapBuildSettings.xcconfig"}],"name":"Resources","sourceTree":"\"<group>\""},"29B97317FDCFA39411CA2CEA_comment":"Resources","29B97323FDCFA39411CA2CEA":{"isa":"PBXGroup","children":[{"value":"1DF5F4DF0D08C38300B7A737","comment":"UIKit.framework"},{"value":"1D30AB110D05D00D00671497","comment":"Foundation.framework"},{"value":"288765FC0DF74451002DB57D","comment":"CoreGraphics.framework"},{"value":"301BF5B4109A6A2B0062928A","comment":"AddressBook.framework"},{"value":"301BF5B6109A6A2B0062928A","comment":"AddressBookUI.framework"},{"value":"301BF5B8109A6A2B0062928A","comment":"AudioToolbox.framework"},{"value":"301BF5BA109A6A2B0062928A","comment":"AVFoundation.framework"},{"value":"301BF5BC109A6A2B0062928A","comment":"CFNetwork.framework"},{"value":"301BF5BE109A6A2B0062928A","comment":"CoreLocation.framework"},{"value":"301BF5C0109A6A2B0062928A","comment":"MediaPlayer.framework"},{"value":"301BF5C2109A6A2B0062928A","comment":"QuartzCore.framework"},{"value":"301BF5C4109A6A2B0062928A","comment":"SystemConfiguration.framework"},{"value":"305D5FD0115AB8F900A74A75","comment":"MobileCoreServices.framework"},{"value":"30E5649113A7FCAF007403D8","comment":"CoreMedia.framework"}],"name":"Frameworks","sourceTree":"\"<group>\""},"29B97323FDCFA39411CA2CEA_comment":"Frameworks","301BF52E109A57CC0062928A":{"isa":"PBXGroup","children":[{"value":"301BF535109A57CC0062928A","comment":"libPhoneGap.a"},{"value":"30E47BC3136F595F00DBB853","comment":"PhoneGap.framework"}],"name":"Products","sourceTree":"\"<group>\""},"301BF52E109A57CC0062928A_comment":"Products","307C750510C5A3420062BCA9":{"isa":"PBXGroup","children":[],"path":"Plugins","sourceTree":"SOURCE_ROOT"},"307C750510C5A3420062BCA9_comment":"Plugins","308D052D1370CCF300D202BF":{"isa":"PBXGroup","children":[{"value":"308D052E1370CCF300D202BF","comment":"icon-72.png"},{"value":"308D052F1370CCF300D202BF","comment":"icon.png"},{"value":"308D05301370CCF300D202BF","comment":"icon@2x.png"}],"name":"icons","path":"Resources/icons","sourceTree":"\"<group>\""},"308D052D1370CCF300D202BF_comment":"icons","308D05311370CCF300D202BF":{"isa":"PBXGroup","children":[{"value":"308D05341370CCF300D202BF","comment":"Default.png"},{"value":"308D05351370CCF300D202BF","comment":"Default@2x.png"}],"name":"splash","path":"Resources/splash","sourceTree":"\"<group>\""},"308D05311370CCF300D202BF_comment":"splash"},"PBXNativeTarget":{"1D6058900D05DD3D006BFB54":{"isa":"PBXNativeTarget","buildConfigurationList":"1D6058960D05DD3E006BFB54","buildConfigurationList_comment":"Build configuration list for PBXNativeTarget \"KitchenSinktablet\"","buildPhases":[{"value":"304B58A110DAC018002A0835","comment":"Touch www folder"},{"value":"1D60588D0D05DD3D006BFB54","comment":"Resources"},{"value":"1D60588E0D05DD3D006BFB54","comment":"Sources"},{"value":"1D60588F0D05DD3D006BFB54","comment":"Frameworks"}],"buildRules":[],"dependencies":[{"value":"301BF551109A68C00062928A","comment":"PBXTargetDependency"}],"name":"\"KitchenSinktablet\"","productName":"\"KitchenSinktablet\"","productReference":"1D6058910D05DD3D006BFB54","productReference_comment":"KitchenSinktablet.app","productType":"\"com.apple.product-type.application\""},"1D6058900D05DD3D006BFB54_comment":"KitchenSinktablet","1D6058900D05DD3D006BFB55":{"isa":"PBXNativeTarget","buildConfigurationList":"1D6058960D05DD3E006BFB54","buildConfigurationList_comment":"Build configuration list for PBXNativeTarget \"TestApp\"","buildPhases":[{"value":"304B58A110DAC018002A0835","comment":"Touch www folder"},{"value":"1D60588D0D05DD3D006BFB54","comment":"Resources"},{"value":"1D60588E0D05DD3D006BFB54","comment":"Sources"},{"value":"1D60588F0D05DD3D006BFB54","comment":"Frameworks"}],"buildRules":[],"dependencies":[],"name":"\"TestApp\"","productName":"\"TestApp\"","productReference":"1D6058910D05DD3D006BFB54","productReference_comment":"TestApp.app","productType":"\"com.apple.product-type.application\""},"1D6058900D05DD3D006BFB55_comment":"TestApp"},"PBXProject":{"29B97313FDCFA39411CA2CEA":{"isa":"PBXProject","buildConfigurationList":"C01FCF4E08A954540054247B","buildConfigurationList_comment":"Build configuration list for PBXProject \"KitchenSinktablet\"","compatibilityVersion":"\"Xcode 3.1\"","developmentRegion":"English","hasScannedForEncodings":1,"knownRegions":["English","Japanese","French","German","en","es"],"mainGroup":"29B97314FDCFA39411CA2CEA","mainGroup_comment":"CustomTemplate","projectDirPath":"\"\"","projectReferences":[{"ProductGroup":"301BF52E109A57CC0062928A","ProductGroup_comment":"Products","ProjectRef":"301BF52D109A57CC0062928A","ProjectRef_comment":"PhoneGapLib.xcodeproj"}],"projectRoot":"\"\"","targets":[{"value":"1D6058900D05DD3D006BFB54","comment":"KitchenSinktablet"},{"value":"1D6058900D05DD3D006BFB55","comment":"TestApp"}]},"29B97313FDCFA39411CA2CEA_comment":"Project object"},"PBXReferenceProxy":{"301BF535109A57CC0062928A":{"isa":"PBXReferenceProxy","fileType":"archive.ar","path":"libPhoneGap.a","remoteRef":"301BF534109A57CC0062928A","remoteRef_comment":"PBXContainerItemProxy","sourceTree":"BUILT_PRODUCTS_DIR"},"301BF535109A57CC0062928A_comment":"libPhoneGap.a","30E47BC3136F595F00DBB853":{"isa":"PBXReferenceProxy","fileType":"wrapper.cfbundle","path":"PhoneGap.framework","remoteRef":"30E47BC2136F595F00DBB853","remoteRef_comment":"PBXContainerItemProxy","sourceTree":"BUILT_PRODUCTS_DIR"},"30E47BC3136F595F00DBB853_comment":"PhoneGap.framework"},"PBXResourcesBuildPhase":{"1D60588D0D05DD3D006BFB54":{"isa":"PBXResourcesBuildPhase","buildActionMask":2147483647,"files":[{"value":"301BF570109A69640062928A","comment":"www in Resources"},{"value":"3053AC6F109B7857006FCFE7","comment":"VERSION in Resources"},{"value":"30E1352710E2C1420031B30D","comment":"PhoneGap.plist in Resources"},{"value":"307D28A2123043360040C0FA","comment":"PhoneGapBuildSettings.xcconfig in Resources"},{"value":"308D05371370CCF300D202BF","comment":"icon-72.png in Resources"},{"value":"308D05381370CCF300D202BF","comment":"icon.png in Resources"},{"value":"308D05391370CCF300D202BF","comment":"icon@2x.png in Resources"},{"value":"308D053C1370CCF300D202BF","comment":"Default.png in Resources"},{"value":"308D053D1370CCF300D202BF","comment":"Default@2x.png in Resources"},{"value":"3072F99713A8081B00425683","comment":"Capture.bundle in Resources"},{"value":"1F766FE113BBADB100FB74C0","comment":"Localizable.strings in Resources"},{"value":"1F766FE213BBADB100FB74C0","comment":"Localizable.strings in Resources"}],"runOnlyForDeploymentPostprocessing":0},"1D60588D0D05DD3D006BFB54_comment":"Resources"},"PBXShellScriptBuildPhase":{"304B58A110DAC018002A0835":{"isa":"PBXShellScriptBuildPhase","buildActionMask":2147483647,"files":[],"inputPaths":[],"name":"\"Touch www folder\"","outputPaths":[],"runOnlyForDeploymentPostprocessing":0,"shellPath":"/bin/sh","shellScript":"\"touch -cm ${PROJECT_DIR}/www\""},"304B58A110DAC018002A0835_comment":"Touch www folder"},"PBXSourcesBuildPhase":{"1D60588E0D05DD3D006BFB54":{"isa":"PBXSourcesBuildPhase","buildActionMask":2147483647,"files":[{"value":"1D60589B0D05DD56006BFB54","comment":"main.m in Sources"},{"value":"1D3623260D0F684500981E51","comment":"AppDelegate.m in Sources"}],"runOnlyForDeploymentPostprocessing":0},"1D60588E0D05DD3D006BFB54_comment":"Sources"},"PBXTargetDependency":{"301BF551109A68C00062928A":{"isa":"PBXTargetDependency","name":"PhoneGapLib","targetProxy":"301BF550109A68C00062928A","targetProxy_comment":"PBXContainerItemProxy"},"301BF551109A68C00062928A_comment":"PBXTargetDependency"},"PBXVariantGroup":{"1F766FDC13BBADB100FB74C0":{"isa":"PBXVariantGroup","children":[{"value":"1F766FDD13BBADB100FB74C0","comment":"en"}],"name":"Localizable.strings","sourceTree":"\"<group>\""},"1F766FDC13BBADB100FB74C0_comment":"Localizable.strings","1F766FDF13BBADB100FB74C0":{"isa":"PBXVariantGroup","children":[{"value":"1F766FE013BBADB100FB74C0","comment":"es"}],"name":"Localizable.strings","sourceTree":"\"<group>\""},"1F766FDF13BBADB100FB74C0_comment":"Localizable.strings"},"XCBuildConfiguration":{"1D6058940D05DD3E006BFB54":{"isa":"XCBuildConfiguration","buildSettings":{"ALWAYS_SEARCH_USER_PATHS":"NO","ARCHS":["armv6","armv7"],"COPY_PHASE_STRIP":"NO","GCC_DYNAMIC_NO_PIC":"NO","GCC_OPTIMIZATION_LEVEL":0,"GCC_PRECOMPILE_PREFIX_HEADER":"YES","GCC_PREFIX_HEADER":"\"KitchenSinktablet-Prefix.pch\"","INFOPLIST_FILE":"\"KitchenSinktablet-Info.plist\"","IPHONEOS_DEPLOYMENT_TARGET":"3.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"\"KitchenSinktablet\"","TARGETED_DEVICE_FAMILY":"\"1,2\""},"name":"Debug"},"1D6058940D05DD3E006BFB54_comment":"Debug","1D6058950D05DD3E006BFB54":{"isa":"XCBuildConfiguration","buildSettings":{"ALWAYS_SEARCH_USER_PATHS":"NO","ARCHS":["armv6","armv7"],"COPY_PHASE_STRIP":"YES","GCC_PRECOMPILE_PREFIX_HEADER":"YES","GCC_PREFIX_HEADER":"\"KitchenSinktablet-Prefix.pch\"","INFOPLIST_FILE":"\"KitchenSinktablet-Info.plist\"","IPHONEOS_DEPLOYMENT_TARGET":"3.0","ONLY_ACTIVE_ARCH":"NO","PRODUCT_NAME":"\"KitchenSinktablet\"","TARGETED_DEVICE_FAMILY":"\"1,2\""},"name":"Release"},"1D6058950D05DD3E006BFB54_comment":"Release","C01FCF4F08A954540054247B":{"isa":"XCBuildConfiguration","baseConfigurationReference":"307D28A1123043350040C0FA","baseConfigurationReference_comment":"PhoneGapBuildSettings.xcconfig","buildSettings":{"ARCHS":"\"$(ARCHS_STANDARD_32_BIT)\"","\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"":"\"iPhone Distribution\"","GCC_C_LANGUAGE_STANDARD":"c99","GCC_VERSION":"com.apple.compilers.llvmgcc42","GCC_WARN_ABOUT_RETURN_TYPE":"YES","GCC_WARN_UNUSED_VARIABLE":"YES","IPHONEOS_DEPLOYMENT_TARGET":"3.0","OTHER_LDFLAGS":["\"-weak_framework\"","UIKit","\"-weak_framework\"","AVFoundation","\"-weak_framework\"","CoreMedia","\"-weak_library\"","/usr/lib/libSystem.B.dylib","\"-all_load\"","\"-Obj-C\""],"PREBINDING":"NO","SDKROOT":"iphoneos","SKIP_INSTALL":"NO","USER_HEADER_SEARCH_PATHS":"\"\"$(PHONEGAPLIB)/Classes/JSON\" \"$(PHONEGAPLIB)/Classes\"\""},"name":"Debug"},"C01FCF4F08A954540054247B_comment":"Debug","C01FCF5008A954540054247B":{"isa":"XCBuildConfiguration","baseConfigurationReference":"307D28A1123043350040C0FA","baseConfigurationReference_comment":"PhoneGapBuildSettings.xcconfig","buildSettings":{"ARCHS":"\"$(ARCHS_STANDARD_32_BIT)\"","\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"":"\"iPhone Distribution\"","GCC_C_LANGUAGE_STANDARD":"c99","GCC_VERSION":"com.apple.compilers.llvmgcc42","GCC_WARN_ABOUT_RETURN_TYPE":"YES","GCC_WARN_UNUSED_VARIABLE":"YES","IPHONEOS_DEPLOYMENT_TARGET":"3.0","OTHER_LDFLAGS":["\"-weak_framework\"","UIKit","\"-weak_framework\"","AVFoundation","\"-weak_framework\"","CoreMedia","\"-weak_library\"","/usr/lib/libSystem.B.dylib","\"-all_load\"","\"-Obj-C\""],"PREBINDING":"NO","SDKROOT":"iphoneos","SKIP_INSTALL":"NO","USER_HEADER_SEARCH_PATHS":"\"\"$(PHONEGAPLIB)/Classes/JSON\" \"$(PHONEGAPLIB)/Classes\"\""},"name":"Release"},"C01FCF5008A954540054247B_comment":"Release"},"XCConfigurationList":{"1D6058960D05DD3E006BFB54":{"isa":"XCConfigurationList","buildConfigurations":[{"value":"1D6058940D05DD3E006BFB54","comment":"Debug"},{"value":"1D6058950D05DD3E006BFB54","comment":"Release"}],"defaultConfigurationIsVisible":0,"defaultConfigurationName":"Release"},"1D6058960D05DD3E006BFB54_comment":"Build configuration list for PBXNativeTarget \"KitchenSinktablet\"","C01FCF4E08A954540054247B":{"isa":"XCConfigurationList","buildConfigurations":[{"value":"C01FCF4F08A954540054247B","comment":"Debug"},{"value":"C01FCF5008A954540054247B","comment":"Release"}],"defaultConfigurationIsVisible":0,"defaultConfigurationName":"Release"},"C01FCF4E08A954540054247B_comment":"Build configuration list for PBXProject \"KitchenSinktablet\""}},"rootObject":"29B97313FDCFA39411CA2CEA","rootObject_comment":"Project object"},"headComment":"!$*UTF8*$!"}
+{
+ "project": {
+ "archiveVersion": 1,
+ "classes": {},
+ "objectVersion": 45,
+ "objects": {
+ "PBXBuildFile": {
+ "1D3623260D0F684500981E51": {
+ "isa": "PBXBuildFile",
+ "fileRef": "1D3623250D0F684500981E51",
+ "fileRef_comment": "AppDelegate.m"
+ },
+ "1D3623260D0F684500981E51_comment": "AppDelegate.m in Sources",
+ "1D60589B0D05DD56006BFB54": {
+ "isa": "PBXBuildFile",
+ "fileRef": "29B97316FDCFA39411CA2CEA",
+ "fileRef_comment": "main.m"
+ },
+ "1D60589B0D05DD56006BFB54_comment": "main.m in Sources",
+ "1D60589F0D05DD5A006BFB54": {
+ "isa": "PBXBuildFile",
+ "fileRef": "1D30AB110D05D00D00671497",
+ "fileRef_comment": "Foundation.framework"
+ },
+ "1D60589F0D05DD5A006BFB54_comment": "Foundation.framework in Frameworks",
+ "1DF5F4E00D08C38300B7A737": {
+ "isa": "PBXBuildFile",
+ "fileRef": "1DF5F4DF0D08C38300B7A737",
+ "fileRef_comment": "UIKit.framework",
+ "settings": {
+ "ATTRIBUTES": [
+ "Weak"
+ ]
+ }
+ },
+ "1DF5F4E00D08C38300B7A737_comment": "UIKit.framework in Frameworks",
+ "1F766FE113BBADB100FB74C0": {
+ "isa": "PBXBuildFile",
+ "fileRef": "1F766FDC13BBADB100FB74C0",
+ "fileRef_comment": "Localizable.strings"
+ },
+ "1F766FE113BBADB100FB74C0_comment": "Localizable.strings in Resources",
+ "1F766FE213BBADB100FB74C0": {
+ "isa": "PBXBuildFile",
+ "fileRef": "1F766FDF13BBADB100FB74C0",
+ "fileRef_comment": "Localizable.strings"
+ },
+ "1F766FE213BBADB100FB74C0_comment": "Localizable.strings in Resources",
+ "288765FD0DF74451002DB57D": {
+ "isa": "PBXBuildFile",
+ "fileRef": "288765FC0DF74451002DB57D",
+ "fileRef_comment": "CoreGraphics.framework"
+ },
+ "288765FD0DF74451002DB57D_comment": "CoreGraphics.framework in Frameworks",
+ "301BF552109A68D80062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF535109A57CC0062928A",
+ "fileRef_comment": "libPhoneGap.a"
+ },
+ "301BF552109A68D80062928A_comment": "libPhoneGap.a in Frameworks",
+ "301BF570109A69640062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF56E109A69640062928A",
+ "fileRef_comment": "www"
+ },
+ "301BF570109A69640062928A_comment": "www in Resources",
+ "301BF5B5109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5B4109A6A2B0062928A",
+ "fileRef_comment": "AddressBook.framework"
+ },
+ "301BF5B5109A6A2B0062928A_comment": "AddressBook.framework in Frameworks",
+ "301BF5B7109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5B6109A6A2B0062928A",
+ "fileRef_comment": "AddressBookUI.framework"
+ },
+ "301BF5B7109A6A2B0062928A_comment": "AddressBookUI.framework in Frameworks",
+ "301BF5B9109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5B8109A6A2B0062928A",
+ "fileRef_comment": "AudioToolbox.framework"
+ },
+ "301BF5B9109A6A2B0062928A_comment": "AudioToolbox.framework in Frameworks",
+ "301BF5BB109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5BA109A6A2B0062928A",
+ "fileRef_comment": "AVFoundation.framework",
+ "settings": {
+ "ATTRIBUTES": [
+ "Weak"
+ ]
+ }
+ },
+ "301BF5BB109A6A2B0062928A_comment": "AVFoundation.framework in Frameworks",
+ "301BF5BD109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5BC109A6A2B0062928A",
+ "fileRef_comment": "CFNetwork.framework"
+ },
+ "301BF5BD109A6A2B0062928A_comment": "CFNetwork.framework in Frameworks",
+ "301BF5BF109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5BE109A6A2B0062928A",
+ "fileRef_comment": "CoreLocation.framework"
+ },
+ "301BF5BF109A6A2B0062928A_comment": "CoreLocation.framework in Frameworks",
+ "301BF5C1109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5C0109A6A2B0062928A",
+ "fileRef_comment": "MediaPlayer.framework"
+ },
+ "301BF5C1109A6A2B0062928A_comment": "MediaPlayer.framework in Frameworks",
+ "301BF5C3109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5C2109A6A2B0062928A",
+ "fileRef_comment": "QuartzCore.framework"
+ },
+ "301BF5C3109A6A2B0062928A_comment": "QuartzCore.framework in Frameworks",
+ "301BF5C5109A6A2B0062928A": {
+ "isa": "PBXBuildFile",
+ "fileRef": "301BF5C4109A6A2B0062928A",
+ "fileRef_comment": "SystemConfiguration.framework"
+ },
+ "301BF5C5109A6A2B0062928A_comment": "SystemConfiguration.framework in Frameworks",
+ "3053AC6F109B7857006FCFE7": {
+ "isa": "PBXBuildFile",
+ "fileRef": "3053AC6E109B7857006FCFE7",
+ "fileRef_comment": "VERSION"
+ },
+ "3053AC6F109B7857006FCFE7_comment": "VERSION in Resources",
+ "305D5FD1115AB8F900A74A75": {
+ "isa": "PBXBuildFile",
+ "fileRef": "305D5FD0115AB8F900A74A75",
+ "fileRef_comment": "MobileCoreServices.framework"
+ },
+ "305D5FD1115AB8F900A74A75_comment": "MobileCoreServices.framework in Frameworks",
+ "3072F99713A8081B00425683": {
+ "isa": "PBXBuildFile",
+ "fileRef": "3072F99613A8081B00425683",
+ "fileRef_comment": "Capture.bundle"
+ },
+ "3072F99713A8081B00425683_comment": "Capture.bundle in Resources",
+ "307D28A2123043360040C0FA": {
+ "isa": "PBXBuildFile",
+ "fileRef": "307D28A1123043350040C0FA",
+ "fileRef_comment": "PhoneGapBuildSettings.xcconfig"
+ },
+ "307D28A2123043360040C0FA_comment": "PhoneGapBuildSettings.xcconfig in Resources",
+ "308D05371370CCF300D202BF": {
+ "isa": "PBXBuildFile",
+ "fileRef": "308D052E1370CCF300D202BF",
+ "fileRef_comment": "icon-72.png"
+ },
+ "308D05371370CCF300D202BF_comment": "icon-72.png in Resources",
+ "308D05381370CCF300D202BF": {
+ "isa": "PBXBuildFile",
+ "fileRef": "308D052F1370CCF300D202BF",
+ "fileRef_comment": "icon.png"
+ },
+ "308D05381370CCF300D202BF_comment": "icon.png in Resources",
+ "308D05391370CCF300D202BF": {
+ "isa": "PBXBuildFile",
+ "fileRef": "308D05301370CCF300D202BF",
+ "fileRef_comment": "icon@2x.png"
+ },
+ "308D05391370CCF300D202BF_comment": "icon@2x.png in Resources",
+ "308D053C1370CCF300D202BF": {
+ "isa": "PBXBuildFile",
+ "fileRef": "308D05341370CCF300D202BF",
+ "fileRef_comment": "Default.png"
+ },
+ "308D053C1370CCF300D202BF_comment": "Default.png in Resources",
+ "308D053D1370CCF300D202BF": {
+ "isa": "PBXBuildFile",
+ "fileRef": "308D05351370CCF300D202BF",
+ "fileRef_comment": "Default@2x.png"
+ },
+ "308D053D1370CCF300D202BF_comment": "Default@2x.png in Resources",
+ "30E1352710E2C1420031B30D": {
+ "isa": "PBXBuildFile",
+ "fileRef": "30E1352610E2C1420031B30D",
+ "fileRef_comment": "PhoneGap.plist"
+ },
+ "30E1352710E2C1420031B30D_comment": "PhoneGap.plist in Resources",
+ "30E5649213A7FCAF007403D8": {
+ "isa": "PBXBuildFile",
+ "fileRef": "30E5649113A7FCAF007403D8",
+ "fileRef_comment": "CoreMedia.framework",
+ "settings": {
+ "ATTRIBUTES": [
+ "Weak"
+ ]
+ }
+ },
+ "30E5649213A7FCAF007403D8_comment": "CoreMedia.framework in Frameworks"
+ },
+ "PBXContainerItemProxy": {
+ "301BF534109A57CC0062928A": {
+ "isa": "PBXContainerItemProxy",
+ "containerPortal": "301BF52D109A57CC0062928A",
+ "containerPortal_comment": "PhoneGapLib.xcodeproj",
+ "proxyType": 2,
+ "remoteGlobalIDString": "D2AAC07E0554694100DB518D",
+ "remoteInfo": "PhoneGapLib"
+ },
+ "301BF534109A57CC0062928A_comment": "PBXContainerItemProxy",
+ "301BF550109A68C00062928A": {
+ "isa": "PBXContainerItemProxy",
+ "containerPortal": "301BF52D109A57CC0062928A",
+ "containerPortal_comment": "PhoneGapLib.xcodeproj",
+ "proxyType": 1,
+ "remoteGlobalIDString": "D2AAC07D0554694100DB518D",
+ "remoteInfo": "PhoneGapLib"
+ },
+ "301BF550109A68C00062928A_comment": "PBXContainerItemProxy",
+ "30E47BC2136F595F00DBB853": {
+ "isa": "PBXContainerItemProxy",
+ "containerPortal": "301BF52D109A57CC0062928A",
+ "containerPortal_comment": "PhoneGapLib.xcodeproj",
+ "proxyType": 2,
+ "remoteGlobalIDString": "303258D8136B2C9400982B63",
+ "remoteInfo": "PhoneGap"
+ },
+ "30E47BC2136F595F00DBB853_comment": "PBXContainerItemProxy"
+ },
+ "PBXCopyFilesBuildPhase": {
+ "73E82FF51BCF133B004E733B": {
+ "isa": "PBXCopyFilesBuildPhase",
+ "buildActionMask": 2147483647,
+ "dstPath": "\"\"",
+ "dstSubfolderSpec": 10,
+ "files": [],
+ "name": "\"Embed Frameworks\"",
+ "runOnlyForDeploymentPostprocessing": 0
+ },
+ "73E82FF51BCF133B004E733B_comment": "Embed Frameworks"
+ },
+ "PBXFileReference": {
+ "1D30AB110D05D00D00671497": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "Foundation.framework",
+ "path": "System/Library/Frameworks/Foundation.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "1D30AB110D05D00D00671497_comment": "Foundation.framework",
+ "1D3623240D0F684500981E51": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "sourcecode.c.h",
+ "path": "AppDelegate.h",
+ "sourceTree": "\"<group>\""
+ },
+ "1D3623240D0F684500981E51_comment": "AppDelegate.h",
+ "1D3623250D0F684500981E51": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "sourcecode.c.objc",
+ "path": "AppDelegate.m",
+ "sourceTree": "\"<group>\""
+ },
+ "1D3623250D0F684500981E51_comment": "AppDelegate.m",
+ "1D6058910D05DD3D006BFB54": {
+ "isa": "PBXFileReference",
+ "explicitFileType": "wrapper.application",
+ "includeInIndex": 0,
+ "path": "\"KitchenSinktablet.app\"",
+ "sourceTree": "BUILT_PRODUCTS_DIR"
+ },
+ "1D6058910D05DD3D006BFB54_comment": "KitchenSinktablet.app",
+ "1DF5F4DF0D08C38300B7A737": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "UIKit.framework",
+ "path": "System/Library/Frameworks/UIKit.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "1DF5F4DF0D08C38300B7A737_comment": "UIKit.framework",
+ "1F766FDD13BBADB100FB74C0": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "text.plist.strings",
+ "name": "en",
+ "path": "Localizable.strings",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FDD13BBADB100FB74C0_comment": "en",
+ "1F766FE013BBADB100FB74C0": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "text.plist.strings",
+ "name": "es",
+ "path": "Localizable.strings",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FE013BBADB100FB74C0_comment": "es",
+ "288765FC0DF74451002DB57D": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "CoreGraphics.framework",
+ "path": "System/Library/Frameworks/CoreGraphics.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "288765FC0DF74451002DB57D_comment": "CoreGraphics.framework",
+ "29B97316FDCFA39411CA2CEA": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "sourcecode.c.objc",
+ "path": "main.m",
+ "sourceTree": "\"<group>\""
+ },
+ "29B97316FDCFA39411CA2CEA_comment": "main.m",
+ "301BF52D109A57CC0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "\"wrapper.pb-project\"",
+ "path": "PhoneGapLib.xcodeproj",
+ "sourceTree": "PHONEGAPLIB"
+ },
+ "301BF52D109A57CC0062928A_comment": "PhoneGapLib.xcodeproj",
+ "301BF56E109A69640062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "folder",
+ "path": "www",
+ "sourceTree": "SOURCE_ROOT"
+ },
+ "301BF56E109A69640062928A_comment": "www",
+ "301BF5B4109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "AddressBook.framework",
+ "path": "System/Library/Frameworks/AddressBook.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5B4109A6A2B0062928A_comment": "AddressBook.framework",
+ "301BF5B6109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "AddressBookUI.framework",
+ "path": "System/Library/Frameworks/AddressBookUI.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5B6109A6A2B0062928A_comment": "AddressBookUI.framework",
+ "301BF5B8109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "AudioToolbox.framework",
+ "path": "System/Library/Frameworks/AudioToolbox.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5B8109A6A2B0062928A_comment": "AudioToolbox.framework",
+ "301BF5BA109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "AVFoundation.framework",
+ "path": "System/Library/Frameworks/AVFoundation.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5BA109A6A2B0062928A_comment": "AVFoundation.framework",
+ "301BF5BC109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "CFNetwork.framework",
+ "path": "System/Library/Frameworks/CFNetwork.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5BC109A6A2B0062928A_comment": "CFNetwork.framework",
+ "301BF5BE109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "CoreLocation.framework",
+ "path": "System/Library/Frameworks/CoreLocation.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5BE109A6A2B0062928A_comment": "CoreLocation.framework",
+ "301BF5C0109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "MediaPlayer.framework",
+ "path": "System/Library/Frameworks/MediaPlayer.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5C0109A6A2B0062928A_comment": "MediaPlayer.framework",
+ "301BF5C2109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "QuartzCore.framework",
+ "path": "System/Library/Frameworks/QuartzCore.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5C2109A6A2B0062928A_comment": "QuartzCore.framework",
+ "301BF5C4109A6A2B0062928A": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "SystemConfiguration.framework",
+ "path": "System/Library/Frameworks/SystemConfiguration.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "301BF5C4109A6A2B0062928A_comment": "SystemConfiguration.framework",
+ "3053AC6E109B7857006FCFE7": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "text",
+ "path": "VERSION",
+ "sourceTree": "PHONEGAPLIB"
+ },
+ "3053AC6E109B7857006FCFE7_comment": "VERSION",
+ "305D5FD0115AB8F900A74A75": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "MobileCoreServices.framework",
+ "path": "System/Library/Frameworks/MobileCoreServices.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "305D5FD0115AB8F900A74A75_comment": "MobileCoreServices.framework",
+ "3072F99613A8081B00425683": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "\"wrapper.plug-in\"",
+ "name": "Capture.bundle",
+ "path": "Resources/Capture.bundle",
+ "sourceTree": "\"<group>\""
+ },
+ "3072F99613A8081B00425683_comment": "Capture.bundle",
+ "307D28A1123043350040C0FA": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "text.xcconfig",
+ "path": "PhoneGapBuildSettings.xcconfig",
+ "sourceTree": "\"<group>\""
+ },
+ "307D28A1123043350040C0FA_comment": "PhoneGapBuildSettings.xcconfig",
+ "308D052E1370CCF300D202BF": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "image.png",
+ "path": "\"icon-72.png\"",
+ "sourceTree": "\"<group>\""
+ },
+ "308D052E1370CCF300D202BF_comment": "icon-72.png",
+ "308D052F1370CCF300D202BF": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "image.png",
+ "path": "icon.png",
+ "sourceTree": "\"<group>\""
+ },
+ "308D052F1370CCF300D202BF_comment": "icon.png",
+ "308D05301370CCF300D202BF": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "image.png",
+ "path": "\"icon@2x.png\"",
+ "sourceTree": "\"<group>\""
+ },
+ "308D05301370CCF300D202BF_comment": "icon@2x.png",
+ "308D05341370CCF300D202BF": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "image.png",
+ "path": "Default.png",
+ "sourceTree": "\"<group>\""
+ },
+ "308D05341370CCF300D202BF_comment": "Default.png",
+ "308D05351370CCF300D202BF": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "image.png",
+ "path": "\"Default@2x.png\"",
+ "sourceTree": "\"<group>\""
+ },
+ "308D05351370CCF300D202BF_comment": "Default@2x.png",
+ "30E1352610E2C1420031B30D": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "text.plist.xml",
+ "path": "PhoneGap.plist",
+ "sourceTree": "\"<group>\""
+ },
+ "30E1352610E2C1420031B30D_comment": "PhoneGap.plist",
+ "30E5649113A7FCAF007403D8": {
+ "isa": "PBXFileReference",
+ "lastKnownFileType": "wrapper.framework",
+ "name": "CoreMedia.framework",
+ "path": "System/Library/Frameworks/CoreMedia.framework",
+ "sourceTree": "SDKROOT"
+ },
+ "30E5649113A7FCAF007403D8_comment": "CoreMedia.framework",
+ "32CA4F630368D1EE00C91783": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "sourcecode.c.h",
+ "path": "\"KitchenSinktablet-Prefix.pch\"",
+ "sourceTree": "\"<group>\""
+ },
+ "32CA4F630368D1EE00C91783_comment": "KitchenSinktablet-Prefix.pch",
+ "8D1107310486CEB800E47090": {
+ "isa": "PBXFileReference",
+ "fileEncoding": 4,
+ "lastKnownFileType": "text.plist.xml",
+ "path": "\"KitchenSinktablet-Info.plist\"",
+ "plistStructureDefinitionIdentifier": "\"com.apple.xcode.plist.structure-definition.iphone.info-plist\"",
+ "sourceTree": "\"<group>\""
+ },
+ "8D1107310486CEB800E47090_comment": "KitchenSinktablet-Info.plist"
+ },
+ "PBXFrameworksBuildPhase": {
+ "1D60588F0D05DD3D006BFB54": {
+ "isa": "PBXFrameworksBuildPhase",
+ "buildActionMask": 2147483647,
+ "files": [
+ {
+ "value": "301BF552109A68D80062928A",
+ "comment": "libPhoneGap.a in Frameworks"
+ },
+ {
+ "value": "1D60589F0D05DD5A006BFB54",
+ "comment": "Foundation.framework in Frameworks"
+ },
+ {
+ "value": "1DF5F4E00D08C38300B7A737",
+ "comment": "UIKit.framework in Frameworks"
+ },
+ {
+ "value": "288765FD0DF74451002DB57D",
+ "comment": "CoreGraphics.framework in Frameworks"
+ },
+ {
+ "value": "301BF5B5109A6A2B0062928A",
+ "comment": "AddressBook.framework in Frameworks"
+ },
+ {
+ "value": "301BF5B7109A6A2B0062928A",
+ "comment": "AddressBookUI.framework in Frameworks"
+ },
+ {
+ "value": "301BF5B9109A6A2B0062928A",
+ "comment": "AudioToolbox.framework in Frameworks"
+ },
+ {
+ "value": "301BF5BB109A6A2B0062928A",
+ "comment": "AVFoundation.framework in Frameworks"
+ },
+ {
+ "value": "301BF5BD109A6A2B0062928A",
+ "comment": "CFNetwork.framework in Frameworks"
+ },
+ {
+ "value": "301BF5BF109A6A2B0062928A",
+ "comment": "CoreLocation.framework in Frameworks"
+ },
+ {
+ "value": "301BF5C1109A6A2B0062928A",
+ "comment": "MediaPlayer.framework in Frameworks"
+ },
+ {
+ "value": "301BF5C3109A6A2B0062928A",
+ "comment": "QuartzCore.framework in Frameworks"
+ },
+ {
+ "value": "301BF5C5109A6A2B0062928A",
+ "comment": "SystemConfiguration.framework in Frameworks"
+ },
+ {
+ "value": "305D5FD1115AB8F900A74A75",
+ "comment": "MobileCoreServices.framework in Frameworks"
+ },
+ {
+ "value": "30E5649213A7FCAF007403D8",
+ "comment": "CoreMedia.framework in Frameworks"
+ }
+ ],
+ "runOnlyForDeploymentPostprocessing": 0
+ },
+ "1D60588F0D05DD3D006BFB54_comment": "Frameworks"
+ },
+ "PBXGroup": {
+ "080E96DDFE201D6D7F000001": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1D3623240D0F684500981E51",
+ "comment": "AppDelegate.h"
+ },
+ {
+ "value": "1D3623250D0F684500981E51",
+ "comment": "AppDelegate.m"
+ }
+ ],
+ "path": "Classes",
+ "sourceTree": "SOURCE_ROOT"
+ },
+ "080E96DDFE201D6D7F000001_comment": "Classes",
+ "19C28FACFE9D520D11CA2CBB": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1D6058910D05DD3D006BFB54",
+ "comment": "KitchenSinktablet.app"
+ }
+ ],
+ "name": "Products",
+ "sourceTree": "\"<group>\""
+ },
+ "19C28FACFE9D520D11CA2CBB_comment": "Products",
+ "1F766FDB13BBADB100FB74C0": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1F766FDC13BBADB100FB74C0",
+ "comment": "Localizable.strings"
+ }
+ ],
+ "name": "en.lproj",
+ "path": "Resources/en.lproj",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FDB13BBADB100FB74C0_comment": "en.lproj",
+ "1F766FDE13BBADB100FB74C0": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1F766FDF13BBADB100FB74C0",
+ "comment": "Localizable.strings"
+ }
+ ],
+ "name": "es.lproj",
+ "path": "Resources/es.lproj",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FDE13BBADB100FB74C0_comment": "es.lproj",
+ "29B97314FDCFA39411CA2CEA": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "301BF56E109A69640062928A",
+ "comment": "www"
+ },
+ {
+ "value": "301BF52D109A57CC0062928A",
+ "comment": "PhoneGapLib.xcodeproj"
+ },
+ {
+ "value": "080E96DDFE201D6D7F000001",
+ "comment": "Classes"
+ },
+ {
+ "value": "307C750510C5A3420062BCA9",
+ "comment": "Plugins"
+ },
+ {
+ "value": "29B97315FDCFA39411CA2CEA",
+ "comment": "Other Sources"
+ },
+ {
+ "value": "29B97317FDCFA39411CA2CEA",
+ "comment": "Resources"
+ },
+ {
+ "value": "29B97323FDCFA39411CA2CEA",
+ "comment": "Frameworks"
+ },
+ {
+ "value": "19C28FACFE9D520D11CA2CBB",
+ "comment": "Products"
+ }
+ ],
+ "name": "CustomTemplate",
+ "sourceTree": "\"<group>\""
+ },
+ "29B97314FDCFA39411CA2CEA_comment": "CustomTemplate",
+ "29B97315FDCFA39411CA2CEA": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "32CA4F630368D1EE00C91783",
+ "comment": "KitchenSinktablet-Prefix.pch"
+ },
+ {
+ "value": "29B97316FDCFA39411CA2CEA",
+ "comment": "main.m"
+ }
+ ],
+ "name": "\"Other Sources\"",
+ "sourceTree": "\"<group>\""
+ },
+ "29B97315FDCFA39411CA2CEA_comment": "Other Sources",
+ "29B97317FDCFA39411CA2CEA": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1F766FDB13BBADB100FB74C0",
+ "comment": "en.lproj"
+ },
+ {
+ "value": "1F766FDE13BBADB100FB74C0",
+ "comment": "es.lproj"
+ },
+ {
+ "value": "3072F99613A8081B00425683",
+ "comment": "Capture.bundle"
+ },
+ {
+ "value": "308D052D1370CCF300D202BF",
+ "comment": "icons"
+ },
+ {
+ "value": "308D05311370CCF300D202BF",
+ "comment": "splash"
+ },
+ {
+ "value": "30E1352610E2C1420031B30D",
+ "comment": "PhoneGap.plist"
+ },
+ {
+ "value": "3053AC6E109B7857006FCFE7",
+ "comment": "VERSION"
+ },
+ {
+ "value": "8D1107310486CEB800E47090",
+ "comment": "KitchenSinktablet-Info.plist"
+ },
+ {
+ "value": "307D28A1123043350040C0FA",
+ "comment": "PhoneGapBuildSettings.xcconfig"
+ }
+ ],
+ "name": "Resources",
+ "sourceTree": "\"<group>\""
+ },
+ "29B97317FDCFA39411CA2CEA_comment": "Resources",
+ "29B97323FDCFA39411CA2CEA": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "1DF5F4DF0D08C38300B7A737",
+ "comment": "UIKit.framework"
+ },
+ {
+ "value": "1D30AB110D05D00D00671497",
+ "comment": "Foundation.framework"
+ },
+ {
+ "value": "288765FC0DF74451002DB57D",
+ "comment": "CoreGraphics.framework"
+ },
+ {
+ "value": "301BF5B4109A6A2B0062928A",
+ "comment": "AddressBook.framework"
+ },
+ {
+ "value": "301BF5B6109A6A2B0062928A",
+ "comment": "AddressBookUI.framework"
+ },
+ {
+ "value": "301BF5B8109A6A2B0062928A",
+ "comment": "AudioToolbox.framework"
+ },
+ {
+ "value": "301BF5BA109A6A2B0062928A",
+ "comment": "AVFoundation.framework"
+ },
+ {
+ "value": "301BF5BC109A6A2B0062928A",
+ "comment": "CFNetwork.framework"
+ },
+ {
+ "value": "301BF5BE109A6A2B0062928A",
+ "comment": "CoreLocation.framework"
+ },
+ {
+ "value": "301BF5C0109A6A2B0062928A",
+ "comment": "MediaPlayer.framework"
+ },
+ {
+ "value": "301BF5C2109A6A2B0062928A",
+ "comment": "QuartzCore.framework"
+ },
+ {
+ "value": "301BF5C4109A6A2B0062928A",
+ "comment": "SystemConfiguration.framework"
+ },
+ {
+ "value": "305D5FD0115AB8F900A74A75",
+ "comment": "MobileCoreServices.framework"
+ },
+ {
+ "value": "30E5649113A7FCAF007403D8",
+ "comment": "CoreMedia.framework"
+ }
+ ],
+ "name": "Frameworks",
+ "sourceTree": "\"<group>\""
+ },
+ "29B97323FDCFA39411CA2CEA_comment": "Frameworks",
+ "301BF52E109A57CC0062928A": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "301BF535109A57CC0062928A",
+ "comment": "libPhoneGap.a"
+ },
+ {
+ "value": "30E47BC3136F595F00DBB853",
+ "comment": "PhoneGap.framework"
+ }
+ ],
+ "name": "Products",
+ "sourceTree": "\"<group>\""
+ },
+ "301BF52E109A57CC0062928A_comment": "Products",
+ "307C750510C5A3420062BCA9": {
+ "isa": "PBXGroup",
+ "children": [],
+ "path": "Plugins",
+ "sourceTree": "SOURCE_ROOT"
+ },
+ "307C750510C5A3420062BCA9_comment": "Plugins",
+ "308D052D1370CCF300D202BF": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "308D052E1370CCF300D202BF",
+ "comment": "icon-72.png"
+ },
+ {
+ "value": "308D052F1370CCF300D202BF",
+ "comment": "icon.png"
+ },
+ {
+ "value": "308D05301370CCF300D202BF",
+ "comment": "icon@2x.png"
+ }
+ ],
+ "name": "icons",
+ "path": "Resources/icons",
+ "sourceTree": "\"<group>\""
+ },
+ "308D052D1370CCF300D202BF_comment": "icons",
+ "308D05311370CCF300D202BF": {
+ "isa": "PBXGroup",
+ "children": [
+ {
+ "value": "308D05341370CCF300D202BF",
+ "comment": "Default.png"
+ },
+ {
+ "value": "308D05351370CCF300D202BF",
+ "comment": "Default@2x.png"
+ }
+ ],
+ "name": "splash",
+ "path": "Resources/splash",
+ "sourceTree": "\"<group>\""
+ },
+ "308D05311370CCF300D202BF_comment": "splash"
+ },
+ "PBXNativeTarget": {
+ "1D6058900D05DD3D006BFB54": {
+ "isa": "PBXNativeTarget",
+ "buildConfigurationList": "1D6058960D05DD3E006BFB54",
+ "buildConfigurationList_comment": "Build configuration list for PBXNativeTarget \"KitchenSinktablet\"",
+ "buildPhases": [
+ {
+ "value": "304B58A110DAC018002A0835",
+ "comment": "Touch www folder"
+ },
+ {
+ "value": "1D60588D0D05DD3D006BFB54",
+ "comment": "Resources"
+ },
+ {
+ "value": "1D60588E0D05DD3D006BFB54",
+ "comment": "Sources"
+ },
+ {
+ "value": "1D60588F0D05DD3D006BFB54",
+ "comment": "Frameworks"
+ }
+ ],
+ "buildRules": [],
+ "dependencies": [
+ {
+ "value": "301BF551109A68C00062928A",
+ "comment": "PBXTargetDependency"
+ }
+ ],
+ "name": "\"KitchenSinktablet\"",
+ "productName": "\"KitchenSinktablet\"",
+ "productReference": "1D6058910D05DD3D006BFB54",
+ "productReference_comment": "KitchenSinktablet.app",
+ "productType": "\"com.apple.product-type.application\""
+ },
+ "1D6058900D05DD3D006BFB54_comment": "KitchenSinktablet",
+ "1D6058900D05DD3D006BFB55": {
+ "isa": "PBXNativeTarget",
+ "buildConfigurationList": "1D6058960D05DD3E006BFB54",
+ "buildConfigurationList_comment": "Build configuration list for PBXNativeTarget \"TestApp\"",
+ "buildPhases": [
+ {
+ "value": "304B58A110DAC018002A0835",
+ "comment": "Touch www folder"
+ },
+ {
+ "value": "1D60588D0D05DD3D006BFB54",
+ "comment": "Resources"
+ },
+ {
+ "value": "1D60588E0D05DD3D006BFB54",
+ "comment": "Sources"
+ },
+ {
+ "value": "1D60588F0D05DD3D006BFB54",
+ "comment": "Frameworks"
+ }
+ ],
+ "buildRules": [],
+ "dependencies": [],
+ "name": "\"TestApp\"",
+ "productName": "\"TestApp\"",
+ "productReference": "1D6058910D05DD3D006BFB54",
+ "productReference_comment": "TestApp.app",
+ "productType": "\"com.apple.product-type.application\""
+ },
+ "1D6058900D05DD3D006BFB55_comment": "TestApp"
+ },
+ "PBXProject": {
+ "29B97313FDCFA39411CA2CEA": {
+ "isa": "PBXProject",
+ "buildConfigurationList": "C01FCF4E08A954540054247B",
+ "buildConfigurationList_comment": "Build configuration list for PBXProject \"KitchenSinktablet\"",
+ "compatibilityVersion": "\"Xcode 3.1\"",
+ "developmentRegion": "English",
+ "hasScannedForEncodings": 1,
+ "knownRegions": [
+ "English",
+ "Japanese",
+ "French",
+ "German",
+ "en",
+ "es"
+ ],
+ "mainGroup": "29B97314FDCFA39411CA2CEA",
+ "mainGroup_comment": "CustomTemplate",
+ "projectDirPath": "\"\"",
+ "projectReferences": [
+ {
+ "ProductGroup": "301BF52E109A57CC0062928A",
+ "ProductGroup_comment": "Products",
+ "ProjectRef": "301BF52D109A57CC0062928A",
+ "ProjectRef_comment": "PhoneGapLib.xcodeproj"
+ }
+ ],
+ "projectRoot": "\"\"",
+ "targets": [
+ {
+ "value": "1D6058900D05DD3D006BFB54",
+ "comment": "KitchenSinktablet"
+ },
+ {
+ "value": "1D6058900D05DD3D006BFB55",
+ "comment": "TestApp"
+ }
+ ]
+ },
+ "29B97313FDCFA39411CA2CEA_comment": "Project object"
+ },
+ "PBXReferenceProxy": {
+ "301BF535109A57CC0062928A": {
+ "isa": "PBXReferenceProxy",
+ "fileType": "archive.ar",
+ "path": "libPhoneGap.a",
+ "remoteRef": "301BF534109A57CC0062928A",
+ "remoteRef_comment": "PBXContainerItemProxy",
+ "sourceTree": "BUILT_PRODUCTS_DIR"
+ },
+ "301BF535109A57CC0062928A_comment": "libPhoneGap.a",
+ "30E47BC3136F595F00DBB853": {
+ "isa": "PBXReferenceProxy",
+ "fileType": "wrapper.cfbundle",
+ "path": "PhoneGap.framework",
+ "remoteRef": "30E47BC2136F595F00DBB853",
+ "remoteRef_comment": "PBXContainerItemProxy",
+ "sourceTree": "BUILT_PRODUCTS_DIR"
+ },
+ "30E47BC3136F595F00DBB853_comment": "PhoneGap.framework"
+ },
+ "PBXResourcesBuildPhase": {
+ "1D60588D0D05DD3D006BFB54": {
+ "isa": "PBXResourcesBuildPhase",
+ "buildActionMask": 2147483647,
+ "files": [
+ {
+ "value": "301BF570109A69640062928A",
+ "comment": "www in Resources"
+ },
+ {
+ "value": "3053AC6F109B7857006FCFE7",
+ "comment": "VERSION in Resources"
+ },
+ {
+ "value": "30E1352710E2C1420031B30D",
+ "comment": "PhoneGap.plist in Resources"
+ },
+ {
+ "value": "307D28A2123043360040C0FA",
+ "comment": "PhoneGapBuildSettings.xcconfig in Resources"
+ },
+ {
+ "value": "308D05371370CCF300D202BF",
+ "comment": "icon-72.png in Resources"
+ },
+ {
+ "value": "308D05381370CCF300D202BF",
+ "comment": "icon.png in Resources"
+ },
+ {
+ "value": "308D05391370CCF300D202BF",
+ "comment": "icon@2x.png in Resources"
+ },
+ {
+ "value": "308D053C1370CCF300D202BF",
+ "comment": "Default.png in Resources"
+ },
+ {
+ "value": "308D053D1370CCF300D202BF",
+ "comment": "Default@2x.png in Resources"
+ },
+ {
+ "value": "3072F99713A8081B00425683",
+ "comment": "Capture.bundle in Resources"
+ },
+ {
+ "value": "1F766FE113BBADB100FB74C0",
+ "comment": "Localizable.strings in Resources"
+ },
+ {
+ "value": "1F766FE213BBADB100FB74C0",
+ "comment": "Localizable.strings in Resources"
+ }
+ ],
+ "runOnlyForDeploymentPostprocessing": 0
+ },
+ "1D60588D0D05DD3D006BFB54_comment": "Resources"
+ },
+ "PBXShellScriptBuildPhase": {
+ "304B58A110DAC018002A0835": {
+ "isa": "PBXShellScriptBuildPhase",
+ "buildActionMask": 2147483647,
+ "files": [],
+ "inputPaths": [],
+ "name": "\"Touch www folder\"",
+ "outputPaths": [],
+ "runOnlyForDeploymentPostprocessing": 0,
+ "shellPath": "/bin/sh",
+ "shellScript": "\"touch -cm ${PROJECT_DIR}/www\""
+ },
+ "304B58A110DAC018002A0835_comment": "Touch www folder"
+ },
+ "PBXSourcesBuildPhase": {
+ "1D60588E0D05DD3D006BFB54": {
+ "isa": "PBXSourcesBuildPhase",
+ "buildActionMask": 2147483647,
+ "files": [
+ {
+ "value": "1D60589B0D05DD56006BFB54",
+ "comment": "main.m in Sources"
+ },
+ {
+ "value": "1D3623260D0F684500981E51",
+ "comment": "AppDelegate.m in Sources"
+ }
+ ],
+ "runOnlyForDeploymentPostprocessing": 0
+ },
+ "1D60588E0D05DD3D006BFB54_comment": "Sources"
+ },
+ "PBXTargetDependency": {
+ "301BF551109A68C00062928A": {
+ "isa": "PBXTargetDependency",
+ "name": "PhoneGapLib",
+ "targetProxy": "301BF550109A68C00062928A",
+ "targetProxy_comment": "PBXContainerItemProxy"
+ },
+ "301BF551109A68C00062928A_comment": "PBXTargetDependency"
+ },
+ "PBXVariantGroup": {
+ "1F766FDC13BBADB100FB74C0": {
+ "isa": "PBXVariantGroup",
+ "children": [
+ {
+ "value": "1F766FDD13BBADB100FB74C0",
+ "comment": "en"
+ }
+ ],
+ "name": "Localizable.strings",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FDC13BBADB100FB74C0_comment": "Localizable.strings",
+ "1F766FDF13BBADB100FB74C0": {
+ "isa": "PBXVariantGroup",
+ "children": [
+ {
+ "value": "1F766FE013BBADB100FB74C0",
+ "comment": "es"
+ }
+ ],
+ "name": "Localizable.strings",
+ "sourceTree": "\"<group>\""
+ },
+ "1F766FDF13BBADB100FB74C0_comment": "Localizable.strings"
+ },
+ "XCBuildConfiguration": {
+ "1D6058940D05DD3E006BFB54": {
+ "isa": "XCBuildConfiguration",
+ "buildSettings": {
+ "ALWAYS_SEARCH_USER_PATHS": "NO",
+ "ARCHS": [
+ "armv6",
+ "armv7"
+ ],
+ "COPY_PHASE_STRIP": "NO",
+ "GCC_DYNAMIC_NO_PIC": "NO",
+ "GCC_OPTIMIZATION_LEVEL": 0,
+ "GCC_PRECOMPILE_PREFIX_HEADER": "YES",
+ "GCC_PREFIX_HEADER": "\"KitchenSinktablet-Prefix.pch\"",
+ "INFOPLIST_FILE": "\"KitchenSinktablet-Info.plist\"",
+ "IPHONEOS_DEPLOYMENT_TARGET": "3.0",
+ "ONLY_ACTIVE_ARCH": "NO",
+ "PRODUCT_NAME": "\"KitchenSinktablet\"",
+ "TARGETED_DEVICE_FAMILY": "\"1,2\""
+ },
+ "name": "Debug"
+ },
+ "1D6058940D05DD3E006BFB54_comment": "Debug",
+ "1D6058950D05DD3E006BFB54": {
+ "isa": "XCBuildConfiguration",
+ "buildSettings": {
+ "ALWAYS_SEARCH_USER_PATHS": "NO",
+ "ARCHS": [
+ "armv6",
+ "armv7"
+ ],
+ "COPY_PHASE_STRIP": "YES",
+ "GCC_PRECOMPILE_PREFIX_HEADER": "YES",
+ "GCC_PREFIX_HEADER": "\"KitchenSinktablet-Prefix.pch\"",
+ "INFOPLIST_FILE": "\"KitchenSinktablet-Info.plist\"",
+ "IPHONEOS_DEPLOYMENT_TARGET": "3.0",
+ "ONLY_ACTIVE_ARCH": "NO",
+ "PRODUCT_NAME": "\"KitchenSinktablet\"",
+ "TARGETED_DEVICE_FAMILY": "\"1,2\""
+ },
+ "name": "Release"
+ },
+ "1D6058950D05DD3E006BFB54_comment": "Release",
+ "C01FCF4F08A954540054247B": {
+ "isa": "XCBuildConfiguration",
+ "baseConfigurationReference": "307D28A1123043350040C0FA",
+ "baseConfigurationReference_comment": "PhoneGapBuildSettings.xcconfig",
+ "buildSettings": {
+ "ARCHS": "\"$(ARCHS_STANDARD_32_BIT)\"",
+ "\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"": "\"iPhone Distribution\"",
+ "GCC_C_LANGUAGE_STANDARD": "c99",
+ "GCC_VERSION": "com.apple.compilers.llvmgcc42",
+ "GCC_WARN_ABOUT_RETURN_TYPE": "YES",
+ "GCC_WARN_UNUSED_VARIABLE": "YES",
+ "IPHONEOS_DEPLOYMENT_TARGET": "3.0",
+ "OTHER_LDFLAGS": [
+ "\"-weak_framework\"",
+ "UIKit",
+ "\"-weak_framework\"",
+ "AVFoundation",
+ "\"-weak_framework\"",
+ "CoreMedia",
+ "\"-weak_library\"",
+ "/usr/lib/libSystem.B.dylib",
+ "\"-all_load\"",
+ "\"-Obj-C\""
+ ],
+ "PREBINDING": "NO",
+ "SDKROOT": "iphoneos",
+ "SKIP_INSTALL": "NO",
+ "USER_HEADER_SEARCH_PATHS": "\"\"$(PHONEGAPLIB)/Classes/JSON\" \"$(PHONEGAPLIB)/Classes\"\""
+ },
+ "name": "Debug"
+ },
+ "C01FCF4F08A954540054247B_comment": "Debug",
+ "C01FCF5008A954540054247B": {
+ "isa": "XCBuildConfiguration",
+ "baseConfigurationReference": "307D28A1123043350040C0FA",
+ "baseConfigurationReference_comment": "PhoneGapBuildSettings.xcconfig",
+ "buildSettings": {
+ "ARCHS": "\"$(ARCHS_STANDARD_32_BIT)\"",
+ "\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"": "\"iPhone Distribution\"",
+ "GCC_C_LANGUAGE_STANDARD": "c99",
+ "GCC_VERSION": "com.apple.compilers.llvmgcc42",
+ "GCC_WARN_ABOUT_RETURN_TYPE": "YES",
+ "GCC_WARN_UNUSED_VARIABLE": "YES",
+ "IPHONEOS_DEPLOYMENT_TARGET": "3.0",
+ "OTHER_LDFLAGS": [
+ "\"-weak_framework\"",
+ "UIKit",
+ "\"-weak_framework\"",
+ "AVFoundation",
+ "\"-weak_framework\"",
+ "CoreMedia",
+ "\"-weak_library\"",
+ "/usr/lib/libSystem.B.dylib",
+ "\"-all_load\"",
+ "\"-Obj-C\""
+ ],
+ "PREBINDING": "NO",
+ "SDKROOT": "iphoneos",
+ "SKIP_INSTALL": "NO",
+ "USER_HEADER_SEARCH_PATHS": "\"\"$(PHONEGAPLIB)/Classes/JSON\" \"$(PHONEGAPLIB)/Classes\"\""
+ },
+ "name": "Release"
+ },
+ "C01FCF5008A954540054247B_comment": "Release"
+ },
+ "XCConfigurationList": {
+ "1D6058960D05DD3E006BFB54": {
+ "isa": "XCConfigurationList",
+ "buildConfigurations": [
+ {
+ "value": "1D6058940D05DD3E006BFB54",
+ "comment": "Debug"
+ },
+ {
+ "value": "1D6058950D05DD3E006BFB54",
+ "comment": "Release"
+ }
+ ],
+ "defaultConfigurationIsVisible": 0,
+ "defaultConfigurationName": "Release"
+ },
+ "1D6058960D05DD3E006BFB54_comment": "Build configuration list for PBXNativeTarget \"KitchenSinktablet\"",
+ "C01FCF4E08A954540054247B": {
+ "isa": "XCConfigurationList",
+ "buildConfigurations": [
+ {
+ "value": "C01FCF4F08A954540054247B",
+ "comment": "Debug"
+ },
+ {
+ "value": "C01FCF5008A954540054247B",
+ "comment": "Release"
+ }
+ ],
+ "defaultConfigurationIsVisible": 0,
+ "defaultConfigurationName": "Release"
+ },
+ "C01FCF4E08A954540054247B_comment": "Build configuration list for PBXProject \"KitchenSinktablet\""
+ }
+ },
+ "rootObject": "29B97313FDCFA39411CA2CEA",
+ "rootObject_comment": "Project object"
+ },
+ "headComment": "!$*UTF8*$!"
+}
diff --git a/test/fixtures/multiple-data-model.xcdatamodeld/.xccurrentversion b/test/fixtures/multiple-data-model.xcdatamodeld/.xccurrentversion
new file mode 100644
index 0000000..cb72aba
--- /dev/null
+++ b/test/fixtures/multiple-data-model.xcdatamodeld/.xccurrentversion
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>_XCCurrentVersionName</key>
+ <string>2.xcdatamodel</string>
+</dict>
+</plist>
diff --git a/test/fixtures/multiple-data-model.xcdatamodeld/1.xcdatamodel/contents b/test/fixtures/multiple-data-model.xcdatamodeld/1.xcdatamodel/contents
new file mode 100644
index 0000000..6bd3dcd
--- /dev/null
+++ b/test/fixtures/multiple-data-model.xcdatamodeld/1.xcdatamodel/contents
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9057" systemVersion="15B42" minimumToolsVersion="Xcode 7.0">
+ <elements/>
+</model>
\ No newline at end of file
diff --git a/test/fixtures/multiple-data-model.xcdatamodeld/2.xcdatamodel/contents b/test/fixtures/multiple-data-model.xcdatamodeld/2.xcdatamodel/contents
new file mode 100644
index 0000000..6bd3dcd
--- /dev/null
+++ b/test/fixtures/multiple-data-model.xcdatamodeld/2.xcdatamodel/contents
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9057" systemVersion="15B42" minimumToolsVersion="Xcode 7.0">
+ <elements/>
+</model>
\ No newline at end of file
diff --git a/test/fixtures/single-data-model.xcdatamodeld/SingleDataModel.xcdatamodel/contents b/test/fixtures/single-data-model.xcdatamodeld/SingleDataModel.xcdatamodel/contents
new file mode 100644
index 0000000..6bd3dcd
--- /dev/null
+++ b/test/fixtures/single-data-model.xcdatamodeld/SingleDataModel.xcdatamodel/contents
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9057" systemVersion="15B42" minimumToolsVersion="Xcode 7.0">
+ <elements/>
+</model>
\ No newline at end of file
diff --git a/test/pbxFile.js b/test/pbxFile.js
index 9a55b0a..90e0851 100644
--- a/test/pbxFile.js
+++ b/test/pbxFile.js
@@ -50,6 +50,13 @@
test.done();
},
+ 'should detect that a .xcdatamodel path means wrapper.xcdatamodel': function (test) {
+ var sourceFile = new pbxFile('dataModel.xcdatamodel');
+
+ test.equal('wrapper.xcdatamodel', sourceFile.lastKnownFileType);
+ test.done();
+ },
+
'should allow lastKnownFileType to be overridden': function (test) {
var sourceFile = new pbxFile('Plugins/ChildBrowser.m',
{ lastKnownFileType: 'somestupidtype' });
@@ -73,6 +80,12 @@
test.equal('Sources', sourceFile.group);
test.done();
},
+ 'should be Sources for data model document files': function (test) {
+ var dataModelFile = new pbxFile('dataModel.xcdatamodeld');
+
+ test.equal('Sources', dataModelFile.group);
+ test.done();
+ },
'should be Frameworks for frameworks': function (test) {
var framework = new pbxFile('libsqlite3.dylib');
@@ -173,7 +186,7 @@
test.equal(undefined, sourceFile.settings);
test.done();
},
-
+
'should be undefined if weak is false or non-boolean': function (test) {
var sourceFile1 = new pbxFile('social.framework',
{ weak: false });
@@ -193,6 +206,22 @@
test.done();
},
+ 'should be {ATTRIBUTES:["CodeSignOnCopy"]} if sign specified': function (test) {
+ var sourceFile = new pbxFile('signable.framework',
+ { sign: true });
+
+ test.deepEqual({ATTRIBUTES:["CodeSignOnCopy"]}, sourceFile.settings);
+ test.done();
+ },
+
+ 'should be {ATTRIBUTES:["Weak","CodeSignOnCopy"]} if both weak linking and sign specified': function (test) {
+ var sourceFile = new pbxFile('signableWeak.framework',
+ { weak: true, sign: true });
+
+ test.deepEqual({ATTRIBUTES:["Weak", "CodeSignOnCopy"]}, sourceFile.settings);
+ test.done();
+ },
+
'should be {COMPILER_FLAGS:"blah"} if compiler flags specified': function (test) {
var sourceFile = new pbxFile('Plugins/BarcodeScanner.m',
{ compilerFlags: "-std=c++11 -fno-objc-arc" });
diff --git a/test/pbxProject.js b/test/pbxProject.js
index 77786b7..eacb61b 100644
--- a/test/pbxProject.js
+++ b/test/pbxProject.js
@@ -177,6 +177,90 @@
}
}
+exports['addBuildProperty function'] = {
+ setUp:function(callback) {
+ callback();
+ },
+ tearDown:function(callback) {
+ fs.writeFileSync(bcpbx, original_pbx, 'utf-8');
+ callback();
+ },
+ 'should add 4 build properties in the .pbxproj file': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.addBuildProperty('ENABLE_BITCODE', 'NO');
+ var newContents = myProj.writeSync();
+ test.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 4);
+ test.done();
+ });
+ },
+ 'should add 2 build properties in the .pbxproj file for specific build': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.addBuildProperty('ENABLE_BITCODE', 'NO', 'Release');
+ var newContents = myProj.writeSync();
+ test.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 2);
+ test.done();
+ });
+ },
+ 'should not add build properties in the .pbxproj file for nonexist build': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.addBuildProperty('ENABLE_BITCODE', 'NO', 'nonexist');
+ var newContents = myProj.writeSync();
+ test.ok(!newContents.match(/ENABLE_BITCODE\s*=\s*NO/g));
+ test.done();
+ });
+ }
+}
+
+exports['removeBuildProperty function'] = {
+ setUp:function(callback) {
+ callback();
+ },
+ tearDown:function(callback) {
+ fs.writeFileSync(bcpbx, original_pbx, 'utf-8');
+ callback();
+ },
+ 'should remove all build properties in the .pbxproj file': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET');
+ var newContents = myProj.writeSync();
+ test.ok(!newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/));
+ test.done();
+ });
+ },
+ 'should remove specific build properties in the .pbxproj file': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', 'Debug');
+ var newContents = myProj.writeSync();
+ test.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 2);
+ test.done();
+ });
+ },
+ 'should not remove any build properties in the .pbxproj file': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', 'notexist');
+ var newContents = myProj.writeSync();
+ test.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 4);
+ test.done();
+ });
+ },
+ 'should fine with remove inexist build properties in the .pbxproj file': function (test) {
+ var myProj = new pbx('test/parser/projects/build-config.pbxproj');
+ myProj.parse(function(err, hash) {
+ myProj.removeBuildProperty('ENABLE_BITCODE');
+ var newContents = myProj.writeSync();
+ test.ok(!newContents.match(/ENABLE_BITCODE/));
+ test.done();
+ });
+ }
+
+}
+
exports['productName field'] = {
'should return the product name': function (test) {
var newProj = new pbx('.');