var mappings = require("./mappings"), platformName = "ios", platformDir = 'platforms/ios/', xcodeprojRegex = /\.xcodeproj$/i; module.exports = function (Q, fs, path, plist, xcode) { function mapConfig(config) { var element = {}; if (!config.type) { throw "no type defined for "+JSON.stringify (config, null, "\t"); } var mapping = mappings[config.type]; if (!mapping) throw "no mapping for "+ config.type; element.Type = mapping[platformName]; if (mapping.required) { mapping.required.forEach (function (k) { if (!(k in config)) { throw 'ERROR: attribute "'+ k + '" not found for ' + config.title + ' (type: ' + config.type + ')'; } }); } if (mapping.attrs) { for (var attrName in mapping.attrs) { if (!config.hasOwnProperty(attrName)) continue; var attrConfig = mapping.attrs[attrName]; var elementKey = attrConfig[platformName]; if (attrConfig.value) { if (!attrConfig.value[config[attrName]] || !attrConfig.value[config[attrName]][platformName]) throw "no mapping for type: "+ config.type + ", attr: " + attrName + ", value: " + config[attrName]; element[elementKey] = attrConfig.value[config[attrName]][platformName]; } else { element[elementKey] = config[attrName]; } } } if (mapping.fixup && mapping.fixup[platformName]) { mapping.fixup[platformName] (element, config, mapping); } return element; } // build iOS settings bundle function buildItems(data) { var items = []; for (var i=0, l=data.length; i