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,WACtB,EAEA,OAAO,QAAU","file":"/npm/cordova-ios-dev@4.5.0-dev/bin/templates/scripts/cordova/Api.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/cordova-ios-dev@4.5.0-dev/bin/templates/scripts/cordova/Api.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n*/\n\n/*jslint node: true */\n\nvar fs = require('fs');\nvar path = require('path');\nvar unorm = require('unorm');\nvar projectFile = require('./lib/projectFile');\nvar check_reqs = require('./lib/check_reqs');\nvar CordovaError = require('cordova-common').CordovaError;\nvar CordovaLogger = require('cordova-common').CordovaLogger;\nvar events = require('cordova-common').events;\nvar PluginManager = require('cordova-common').PluginManager;\nvar Q = require('q');\nvar util = require('util');\n\nfunction setupEvents(externalEventEmitter) {\n    if (externalEventEmitter) {\n        // This will make the platform internal events visible outside\n        events.forwardEventsTo(externalEventEmitter);\n    } else {\n        // There is no logger if external emitter is not present,\n        // so attach a console logger\n        CordovaLogger.get().subscribe(events);\n    }\n}\n\n/**\n * Creates a new PlatformApi instance.\n *\n * @param  {String}  [platform] Platform name, used for backward compatibility\n *   w/ PlatformPoly (CordovaLib).\n * @param  {String}  [platformRootDir] Platform root location, used for backward\n *   compatibility w/ PlatformPoly (CordovaLib).\n * @param {EventEmitter} [events] An EventEmitter instance that will be used for\n *   logging purposes. If no EventEmitter provided, all events will be logged to\n *   console\n */\nfunction Api(platform, platformRootDir, events) {\n    // 'platform' property is required as per PlatformApi spec\n    this.platform = platform || 'ios';\n    this.root = platformRootDir || path.resolve(__dirname, '..');\n\n    setupEvents(events);\n\n    var xcodeProjDir;\n    var xcodeCordovaProj;\n\n    try {\n        xcodeProjDir = fs.readdirSync(this.root).filter( function(e) { return e.match(/\\.xcodeproj$/i); })[0];\n        if (!xcodeProjDir) {\n            throw new CordovaError('The provided path \"' + this.root + '\" is not a Cordova iOS project.');\n        }\n\n        var cordovaProjName = xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep)+1, xcodeProjDir.indexOf('.xcodeproj'));\n        xcodeCordovaProj = path.join(this.root, cordovaProjName);\n    } catch(e) {\n        throw new CordovaError('The provided path \"'+this.root+'\" is not a Cordova iOS project.');\n    }\n\n    this.locations = {\n        root: this.root,\n        www: path.join(this.root, 'www'),\n        platformWww: path.join(this.root, 'platform_www'),\n        configXml: path.join(xcodeCordovaProj, 'config.xml'),\n        defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),\n        pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'),\n        xcodeProjDir: path.join(this.root, xcodeProjDir),\n        xcodeCordovaProj: xcodeCordovaProj,\n        // NOTE: this is required by browserify logic.\n        // As per platformApi spec we return relative to template root paths here\n        cordovaJs: 'bin/CordovaLib/cordova.js',\n        cordovaJsSrc: 'bin/cordova-js-src'\n    };\n}\n\n/**\n * Creates platform in a specified directory.\n *\n * @param  {String}  destination Destination directory, where install platform to\n * @param  {ConfigParser}  [config] ConfgiParser instance, used to retrieve\n *   project creation options, such as package id and project name.\n * @param  {Object}  [options]  An options object. The most common options are:\n * @param  {String}  [options.customTemplate]  A path to custom template, that\n *   should override the default one from platform.\n * @param  {Boolean}  [options.link]  Flag that indicates that platform's\n *   sources will be linked to installed platform instead of copying.\n * @param {EventEmitter} [events] An EventEmitter instance that will be used for\n *   logging purposes. If no EventEmitter provided, all events will be logged to\n *   console\n *\n * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi\n *   instance or rejected with CordovaError.\n */\nApi.createPlatform = function (destination, config, options, events) {\n    setupEvents(events);\n\n    // CB-6992 it is necessary to normalize characters\n    // because node and shell scripts handles unicode symbols differently\n    // We need to normalize the name to NFD form since iOS uses NFD unicode form\n    var name = unorm.nfd(config.name());\n    var result;\n    try {\n        result = require('../../../lib/create')\n        .createProject(destination, config.packageName(), name, options)\n        .then(function () {\n            // after platform is created we return Api instance based on new Api.js location\n            // This is required to correctly resolve paths in the future api calls\n            var PlatformApi = require(path.resolve(destination, 'cordova/Api'));\n            return new PlatformApi('ios', destination, events);\n        });\n    }\n    catch(e) {\n        events.emit('error','createPlatform is not callable from the iOS project API.');\n        throw(e);\n    }\n    return result;\n};\n\n/**\n * Updates already installed platform.\n *\n * @param  {String}  destination Destination directory, where platform installed\n * @param  {Object}  [options]  An options object. The most common options are:\n * @param  {String}  [options.customTemplate]  A path to custom template, that\n *   should override the default one from platform.\n * @param  {Boolean}  [options.link]  Flag that indicates that platform's\n *   sources will be linked to installed platform instead of copying.\n * @param {EventEmitter} [events] An EventEmitter instance that will be used for\n *   logging purposes. If no EventEmitter provided, all events will be logged to\n *   console\n *\n * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi\n *   instance or rejected with CordovaError.\n */\nApi.updatePlatform = function (destination, options, events) {\n    setupEvents(events);\n\n    var result;\n    try {\n        result = require('../../../lib/create')\n        .updateProject(destination, options)\n        .then(function () {\n            var PlatformApi = require(path.resolve(destination, 'cordova/Api'));\n            return new PlatformApi('ios', destination, events);\n        });\n    }\n    catch (e) {\n        events.emit('error','updatePlatform is not callable from the iOS project API, you will need to do this manually.');\n        throw(e);\n    }\n    return result;\n};\n\n/**\n * Gets a CordovaPlatform object, that represents the platform structure.\n *\n * @return  {CordovaPlatform}  A structure that contains the description of\n *   platform's file structure and other properties of platform.\n */\nApi.prototype.getPlatformInfo = function () {\n    var result = {};\n    result.locations = this.locations;\n    result.root = this.root;\n    result.name = this.platform;\n    result.version = require('./version');\n    result.projectConfig = this._config;\n\n    return result;\n};\n\n/**\n * Updates installed platform with provided www assets and new app\n *   configuration. This method is required for CLI workflow and will be called\n *   each time before build, so the changes, made to app configuration and www\n *   code, will be applied to platform.\n *\n * @param {CordovaProject} cordovaProject A CordovaProject instance, that defines a\n *   project structure and configuration, that should be applied to platform\n *   (contains project's www location and ConfigParser instance for project's\n *   config).\n *\n * @return  {Promise}  Return a promise either fulfilled, or rejected with\n *   CordovaError instance.\n */\nApi.prototype.prepare = function (cordovaProject) {\n    return require('./lib/prepare').prepare.call(this, cordovaProject);\n};\n\n/**\n * Installs a new plugin into platform. It doesn't resolves plugin dependencies.\n *\n * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin\n *   that will be installed.\n * @param  {Object}  installOptions  An options object. Possible options below:\n * @param  {Boolean}  installOptions.link: Flag that specifies that plugin\n *   sources will be symlinked to app's directory instead of copying (if\n *   possible).\n * @param  {Object}  installOptions.variables  An object that represents\n *   variables that will be used to install plugin. See more details on plugin\n *   variables in documentation:\n *   https://cordova.apache.org/docs/en/4.0.0/plugin_ref_spec.md.html\n *\n * @return  {Promise}  Return a promise either fulfilled, or rejected with\n *   CordovaError instance.\n */\nApi.prototype.addPlugin = function (plugin, installOptions) {\n    var xcodeproj = projectFile.parse(this.locations);\n    var self = this;\n\n    installOptions = installOptions || {};\n    installOptions.variables = installOptions.variables || {};\n    // Add PACKAGE_NAME variable into vars\n    if (!installOptions.variables.PACKAGE_NAME) {\n        installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();\n    }\n\n    return PluginManager.get(self.platform, self.locations, xcodeproj)\n        .addPlugin(plugin, installOptions)\n        .then(function(){\n            var frameworkTags = plugin.getFrameworks(self.platform);\n            var frameworkPods = frameworkTags.filter(function(obj){\n                return (obj.type == 'podspec'); \n            });\n\n            return Q.resolve(frameworkPods);\n        })\n        .then(function(frameworkPods) {\n            if (!(frameworkPods.length)) {\n                return Q.resolve();\n            }\n\n            var project_dir = self.locations.root;\n            var project_name = self.locations.xcodeCordovaProj.split('/').pop();\n\n            var Podfile = require('./lib/Podfile').Podfile;\n            var PodsJson = require('./lib/PodsJson').PodsJson;\n\n            events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type=\"podspec\"');\n\n            var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));\n            var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name); \n\n            frameworkPods.forEach(function(obj) {\n                var podJson = {\n                    name: obj.src,\n                    type: obj.type,\n                    spec: obj.spec\n                };\n\n                var val = podsjsonFile.get(podJson.name);\n                if (val) { // found \n                    if (podJson.spec !== val.spec) { // exists, different spec, print warning\n                        events.emit('warn', plugin.id + ' depends on ' + podJson.name + '@' + podJson.spec + ', which conflicts with another plugin. ' + podJson.name + '@' + val.spec + ' is already installed and was not overwritten.'); \n                    }\n                    // increment count, but don't add in Podfile because it already exists\n                    podsjsonFile.increment(podJson.name);\n                } else { // not found, write new\n                    podJson.count = 1;\n                    podsjsonFile.setJson(podJson.name, podJson);\n                    // add to Podfile\n                    podfileFile.addSpec(podJson.name, podJson.spec);\n                }\n            });\n\n            // now that all the pods have been processed, write to pods.json\n            podsjsonFile.write();\n\n            // only write and pod install if the Podfile changed\n            if (podfileFile.isDirty()) {\n                podfileFile.write();\n                events.emit('verbose', 'Running `pod install` (to install plugins)');\n\n                return podfileFile.install(check_reqs.check_cocoapods);\n            } else {\n                events.emit('verbose', 'Podfile unchanged, skipping `pod install`');\n            }\n        })\n        // CB-11022 return non-falsy value to indicate\n        // that there is no need to run prepare after\n        .thenResolve(true);\n};\n\n/**\n * Removes an installed plugin from platform.\n *\n * Since method accepts PluginInfo instance as input parameter instead of plugin\n *   id, caller shoud take care of managing/storing PluginInfo instances for\n *   future uninstalls.\n *\n * @param  {PluginInfo}  plugin  A PluginInfo instance that represents plugin\n *   that will be installed.\n *\n * @return  {Promise}  Return a promise either fulfilled, or rejected with\n *   CordovaError instance.\n */\nApi.prototype.removePlugin = function (plugin, uninstallOptions) {\n    var xcodeproj = projectFile.parse(this.locations);\n    var self = this;\n\n    return PluginManager.get(self.platform, self.locations, xcodeproj)\n        .removePlugin(plugin, uninstallOptions)\n        .then(function(){\n            var frameworkTags = plugin.getFrameworks(self.platform);\n            var frameworkPods = frameworkTags.filter(function(obj){\n                return (obj.type == 'podspec'); \n            });\n\n            return Q.resolve(frameworkPods);\n        })\n        .then(function(frameworkPods) {\n            if (!(frameworkPods.length)) {\n                return Q.resolve();\n            }\n\n            var project_dir = self.locations.root;\n            var project_name = self.locations.xcodeCordovaProj.split('/').pop();\n\n            var Podfile = require('./lib/Podfile').Podfile;\n            var PodsJson = require('./lib/PodsJson').PodsJson;\n\n            events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type=\\\"podspec\\\"');\n\n            var podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));\n            var podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name); \n                \n            frameworkPods.forEach(function(obj) {\n                var podJson = {\n                    name: obj.src,\n                    type: obj.type,\n                    spec: obj.spec\n                };\n\n                var val = podsjsonFile.get(podJson.name);\n                if (val) { // found, decrement count\n                    podsjsonFile.decrement(podJson.name);\n                } else { // not found (perhaps a sync error)\n                    var message = util.format('plugin \\\"%s\\\" podspec \\\"%s\\\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name);\n                    events.emit('verbose', message);\n                }\n\n                // always remove from the Podfile\n                podfileFile.removeSpec(podJson.name);\n            });\n\n            // now that all the pods have been processed, write to pods.json\n            podsjsonFile.write();\n\n            if (podfileFile.isDirty()) {\n                podfileFile.write();\n                events.emit('verbose', 'Running `pod install` (to uninstall pods)');\n\n                return podfileFile.install(check_reqs.check_cocoapods);\n            } else {\n                events.emit('verbose', 'Podfile unchanged, skipping `pod install`');\n            }\n        })\n        // CB-11022 return non-falsy value to indicate\n        // that there is no need to run prepare after\n        .thenResolve(true);\n};\n\n/**\n * Builds an application package for current platform.\n *\n * @param  {Object}  buildOptions  A build options. This object's structure is\n *   highly depends on platform's specific. The most common options are:\n * @param  {Boolean}  buildOptions.debug  Indicates that packages should be\n *   built with debug configuration. This is set to true by default unless the\n *   'release' option is not specified.\n * @param  {Boolean}  buildOptions.release  Indicates that packages should be\n *   built with release configuration. If not set to true, debug configuration\n *   will be used.\n * @param   {Boolean}  buildOptions.device  Specifies that built app is intended\n *   to run on device\n * @param   {Boolean}  buildOptions.emulator: Specifies that built app is\n *   intended to run on emulator\n * @param   {String}  buildOptions.target  Specifies the device id that will be\n *   used to run built application.\n * @param   {Boolean}  buildOptions.nobuild  Indicates that this should be a\n *   dry-run call, so no build artifacts will be produced.\n * @param   {String[]}  buildOptions.archs  Specifies chip architectures which\n *   app packages should be built for. List of valid architectures is depends on\n *   platform.\n * @param   {String}  buildOptions.buildConfig  The path to build configuration\n *   file. The format of this file is depends on platform.\n * @param   {String[]} buildOptions.argv Raw array of command-line arguments,\n *   passed to `build` command. The purpose of this property is to pass a\n *   platform-specific arguments, and eventually let platform define own\n *   arguments processing logic.\n *\n * @return  {Promise}  Return a promise either fulfilled, or rejected with\n *   CordovaError instance.\n */\nApi.prototype.build = function (buildOptions) {\n    var self = this;\n    return check_reqs.run()\n    .then(function () {\n        return require('./lib/build').run.call(self, buildOptions);\n    });\n};\n\n/**\n * Builds an application package for current platform and runs it on\n *   specified/default device. If no 'device'/'emulator'/'target' options are\n *   specified, then tries to run app on default device if connected, otherwise\n *   runs the app on emulator.\n *\n * @param   {Object}  runOptions  An options object. The structure is the same\n *   as for build options.\n *\n * @return {Promise} A promise either fulfilled if package was built and ran\n *   successfully, or rejected with CordovaError.\n */\nApi.prototype.run = function(runOptions) {\n    var self = this;\n    return check_reqs.run()\n    .then(function () {\n        return require('./lib/run').run.call(self, runOptions);\n    });\n};\n\n/**\n * Cleans out the build artifacts from platform's directory.\n *\n * @return  {Promise}  Return a promise either fulfilled, or rejected with\n *   CordovaError.\n */\nApi.prototype.clean = function(cleanOptions) {\n    var self = this;\n    return check_reqs.run()\n    .then(function () {\n        return require('./lib/clean').run.call(self, cleanOptions);\n    })\n    .then(function () {\n        return require('./lib/prepare').clean.call(self, cleanOptions);\n    });\n};\n\n/**\n * Performs a requirements check for current platform. Each platform defines its\n *   own set of requirements, which should be resolved before platform can be\n *   built successfully.\n *\n * @return  {Promise<Requirement[]>}  Promise, resolved with set of Requirement\n *   objects for current platform.\n */\nApi.prototype.requirements = function() {\n    return check_reqs.check_all();\n};\n\nmodule.exports = Api;\n"]}