You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/05/04 09:20:27 UTC
[1/3] ios commit: CB-11161 Bump cordova-common to 1.2.0
Repository: cordova-ios
Updated Branches:
refs/heads/master e51eda0f3 -> f41737d01
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/minimatch/package.json
----------------------------------------------------------------------
diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json
index 3dd4683..cd9b44b 100644
--- a/node_modules/minimatch/package.json
+++ b/node_modules/minimatch/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"minimatch@2 || 3",
- "/Users/omefire/Projects/cordova-ios/node_modules/glob"
+ "d:\\cordova\\cordova-ios\\node_modules\\glob"
]
],
"_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0",
@@ -32,7 +32,7 @@
"_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83",
"_shrinkwrap": null,
"_spec": "minimatch@2 || 3",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/glob",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\glob",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -52,7 +52,7 @@
"directories": {},
"dist": {
"shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83",
- "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz"
+ "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz"
},
"engines": {
"node": "*"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/once/package.json
----------------------------------------------------------------------
diff --git a/node_modules/once/package.json b/node_modules/once/package.json
index 28b0cf9..8834d11 100644
--- a/node_modules/once/package.json
+++ b/node_modules/once/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"once@^1.3.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/glob"
+ "d:\\cordova\\cordova-ios\\node_modules\\glob"
]
],
"_from": "once@>=1.3.0 <2.0.0",
@@ -33,7 +33,7 @@
"_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
"_shrinkwrap": null,
"_spec": "once@^1.3.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/glob",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\glob",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -54,7 +54,7 @@
},
"dist": {
"shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
- "tarball": "http://registry.npmjs.org/once/-/once-1.3.3.tgz"
+ "tarball": "https://registry.npmjs.org/once/-/once-1.3.3.tgz"
},
"files": [
"once.js"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/os-homedir/package.json
----------------------------------------------------------------------
diff --git a/node_modules/os-homedir/package.json b/node_modules/os-homedir/package.json
index 768cf7f..9730a5e 100644
--- a/node_modules/os-homedir/package.json
+++ b/node_modules/os-homedir/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"os-homedir@^1.0.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/osenv"
+ "d:\\cordova\\cordova-ios\\node_modules\\osenv"
]
],
"_from": "os-homedir@>=1.0.0 <2.0.0",
@@ -32,7 +32,7 @@
"_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007",
"_shrinkwrap": null,
"_spec": "os-homedir@^1.0.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/osenv",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\osenv",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
@@ -50,7 +50,7 @@
"directories": {},
"dist": {
"shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007",
- "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz"
+ "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz"
},
"engines": {
"node": ">=0.10.0"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/os-tmpdir/package.json
----------------------------------------------------------------------
diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json
index 64db5a7..369a8dc 100644
--- a/node_modules/os-tmpdir/package.json
+++ b/node_modules/os-tmpdir/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"os-tmpdir@^1.0.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/osenv"
+ "d:\\cordova\\cordova-ios\\node_modules\\osenv"
]
],
"_from": "os-tmpdir@>=1.0.0 <2.0.0",
@@ -32,7 +32,7 @@
"_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
"_shrinkwrap": null,
"_spec": "os-tmpdir@^1.0.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/osenv",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\osenv",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
@@ -49,7 +49,7 @@
"directories": {},
"dist": {
"shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
- "tarball": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz"
+ "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz"
},
"engines": {
"node": ">=0.10.0"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/osenv/package.json
----------------------------------------------------------------------
diff --git a/node_modules/osenv/package.json b/node_modules/osenv/package.json
index 93fe257..d3104eb 100644
--- a/node_modules/osenv/package.json
+++ b/node_modules/osenv/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"osenv@^0.1.3",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "osenv@>=0.1.3 <0.2.0",
@@ -32,7 +32,7 @@
"_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
"_shrinkwrap": null,
"_spec": "osenv@^0.1.3",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -54,7 +54,7 @@
},
"dist": {
"shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
- "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz"
+ "tarball": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz"
},
"gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4",
"homepage": "https://github.com/npm/osenv#readme",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/path-is-absolute/package.json
----------------------------------------------------------------------
diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json
index c53c8ae..e36c1dd 100644
--- a/node_modules/path-is-absolute/package.json
+++ b/node_modules/path-is-absolute/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"path-is-absolute@^1.0.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/glob"
+ "d:\\cordova\\cordova-ios\\node_modules\\glob"
]
],
"_from": "path-is-absolute@>=1.0.0 <2.0.0",
@@ -32,7 +32,7 @@
"_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
"_shrinkwrap": null,
"_spec": "path-is-absolute@^1.0.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/glob",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\glob",
"author": {
"email": "sindresorhus@gmail.com",
"name": "Sindre Sorhus",
@@ -47,7 +47,7 @@
"directories": {},
"dist": {
"shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
- "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
},
"engines": {
"node": ">=0.10.0"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/sax/package.json
----------------------------------------------------------------------
diff --git a/node_modules/sax/package.json b/node_modules/sax/package.json
index 1a892b1..b7a1155 100644
--- a/node_modules/sax/package.json
+++ b/node_modules/sax/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"sax@0.3.5",
- "/Users/omefire/Projects/cordova-ios/node_modules/elementtree"
+ "d:\\cordova\\cordova-ios\\node_modules\\elementtree"
]
],
"_defaultsLoaded": true,
@@ -34,7 +34,7 @@
"_shasum": "88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d",
"_shrinkwrap": null,
"_spec": "sax@0.3.5",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/elementtree",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\elementtree",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -83,7 +83,7 @@
"directories": {},
"dist": {
"shasum": "88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d",
- "tarball": "http://registry.npmjs.org/sax/-/sax-0.3.5.tgz"
+ "tarball": "https://registry.npmjs.org/sax/-/sax-0.3.5.tgz"
},
"engines": {
"node": "*"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/semver/package.json
----------------------------------------------------------------------
diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json
index d0f28f4..5f46a7b 100644
--- a/node_modules/semver/package.json
+++ b/node_modules/semver/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"semver@^5.0.1",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "semver@>=5.0.1 <6.0.0",
@@ -32,7 +32,7 @@
"_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5",
"_shrinkwrap": null,
"_spec": "semver@^5.0.1",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"bin": {
"semver": "./bin/semver"
},
@@ -47,7 +47,7 @@
"directories": {},
"dist": {
"shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5",
- "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz"
+ "tarball": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz"
},
"gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc",
"homepage": "https://github.com/npm/node-semver#readme",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/underscore/package.json
----------------------------------------------------------------------
diff --git a/node_modules/underscore/package.json b/node_modules/underscore/package.json
index ed6d114..6ee344b 100644
--- a/node_modules/underscore/package.json
+++ b/node_modules/underscore/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"underscore@^1.8.3",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "underscore@>=1.8.3 <2.0.0",
@@ -31,7 +31,7 @@
"_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",
"_shrinkwrap": null,
"_spec": "underscore@^1.8.3",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "jeremy@documentcloud.org",
"name": "Jeremy Ashkenas"
@@ -52,7 +52,7 @@
"directories": {},
"dist": {
"shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",
- "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz"
+ "tarball": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz"
},
"files": [
"underscore.js",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/unorm/package.json
----------------------------------------------------------------------
diff --git a/node_modules/unorm/package.json b/node_modules/unorm/package.json
index 88545fb..2dd5ba2 100644
--- a/node_modules/unorm/package.json
+++ b/node_modules/unorm/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"unorm@^1.3.3",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "unorm@>=1.3.3 <2.0.0",
@@ -31,7 +31,7 @@
"_shasum": "364200d5f13646ca8bcd44490271335614792300",
"_shrinkwrap": null,
"_spec": "unorm@^1.3.3",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "bwp@bwp.dk",
"name": "Bjarke Walling"
@@ -66,7 +66,7 @@
"directories": {},
"dist": {
"shasum": "364200d5f13646ca8bcd44490271335614792300",
- "tarball": "http://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz"
+ "tarball": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz"
},
"engines": {
"node": ">= 0.4.0"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/wrappy/package.json
----------------------------------------------------------------------
diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json
index ed8a390..bdde15d 100644
--- a/node_modules/wrappy/package.json
+++ b/node_modules/wrappy/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"wrappy@1",
- "/Users/omefire/Projects/cordova-ios/node_modules/inflight"
+ "d:\\cordova\\cordova-ios\\node_modules\\inflight"
]
],
"_from": "wrappy@>=1.0.0 <2.0.0",
@@ -33,7 +33,7 @@
"_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739",
"_shrinkwrap": null,
"_spec": "wrappy@1",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/inflight",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\inflight",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -52,7 +52,7 @@
},
"dist": {
"shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739",
- "tarball": "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
+ "tarball": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz"
},
"gitHead": "006a8cbac6b99988315834c207896eed71fd069a",
"homepage": "https://github.com/npm/wrappy",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 62b6b5f..80c4083 100644
--- a/package.json
+++ b/package.json
@@ -1,55 +1,55 @@
{
- "name": "cordova-ios",
- "version": "4.2.0-dev",
- "description": "cordova-ios release",
- "main": "bin/templates/scripts/cordova/Api.js",
- "repository": {
- "type": "git",
- "url": "https://git-wip-us.apache.org/repos/asf/cordova-ios.git"
- },
- "keywords": [
- "ios",
- "cordova",
- "apache",
- "ecosystem:cordova",
- "cordova:platform"
- ],
- "scripts": {
- "test": "npm run jshint && npm run e2e-tests && npm run objc-tests && npm run unit-tests",
- "cover": "istanbul cover node_modules/jasmine-node/bin/jasmine-node -- tests/spec/unit",
- "e2e-tests": "jasmine-node --captureExceptions --color tests/spec/create.spec.js",
- "objc-tests": "jasmine-node --captureExceptions --color tests/spec/cordovalib.spec.js",
- "unit-tests": "jasmine-node --captureExceptions --color tests/spec/unit",
- "jshint": "jshint bin tests"
- },
- "author": "Apache Software Foundation",
- "license": "Apache Version 2.0",
- "devDependencies": {
- "coffee-script": "^1.7.1",
- "istanbul": "^0.4.2",
- "jasmine-node": "~1",
- "jshint": "^2.6.0",
- "nodeunit": "^0.8.7",
- "rewire": "^2.5.1",
- "tmp": "^0.0.26",
- "uncrustify": "^0.6.1"
- },
- "dependencies": {
- "cordova-common": "^1.1.0",
- "ios-sim": "^5.0.7",
- "nopt": "^3.0.6",
- "plist": "^1.2.0",
- "q": "^1.4.1",
- "shelljs": "^0.5.3",
- "xcode": "^0.8.3"
- },
- "bundledDependencies": [
- "cordova-common",
- "ios-sim",
- "nopt",
- "plist",
- "q",
- "shelljs",
- "xcode"
- ]
-}
\ No newline at end of file
+ "name": "cordova-ios",
+ "version": "4.2.0-dev",
+ "description": "cordova-ios release",
+ "main": "bin/templates/scripts/cordova/Api.js",
+ "repository": {
+ "type": "git",
+ "url": "https://git-wip-us.apache.org/repos/asf/cordova-ios.git"
+ },
+ "keywords": [
+ "ios",
+ "cordova",
+ "apache",
+ "ecosystem:cordova",
+ "cordova:platform"
+ ],
+ "scripts": {
+ "test": "npm run jshint && npm run e2e-tests && npm run objc-tests && npm run unit-tests",
+ "cover": "istanbul cover node_modules/jasmine-node/bin/jasmine-node -- tests/spec/unit",
+ "e2e-tests": "jasmine-node --captureExceptions --color tests/spec/create.spec.js",
+ "objc-tests": "jasmine-node --captureExceptions --color tests/spec/cordovalib.spec.js",
+ "unit-tests": "jasmine-node --captureExceptions --color tests/spec/unit",
+ "jshint": "jshint bin tests"
+ },
+ "author": "Apache Software Foundation",
+ "license": "Apache Version 2.0",
+ "devDependencies": {
+ "coffee-script": "^1.7.1",
+ "istanbul": "^0.4.2",
+ "jasmine-node": "~1",
+ "jshint": "^2.6.0",
+ "nodeunit": "^0.8.7",
+ "rewire": "^2.5.1",
+ "tmp": "^0.0.26",
+ "uncrustify": "^0.6.1"
+ },
+ "dependencies": {
+ "cordova-common": "^1.2.0",
+ "ios-sim": "^5.0.7",
+ "nopt": "^3.0.6",
+ "plist": "^1.2.0",
+ "q": "^1.4.1",
+ "shelljs": "^0.5.3",
+ "xcode": "^0.8.3"
+ },
+ "bundledDependencies": [
+ "cordova-common",
+ "ios-sim",
+ "nopt",
+ "plist",
+ "q",
+ "shelljs",
+ "xcode"
+ ]
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/3] ios commit: CB-11161 Reuse PluginManager from common to add/rm
plugins
Posted by an...@apache.org.
CB-11161 Reuse PluginManager from common to add/rm plugins
This closes #219
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/f41737d0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/f41737d0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/f41737d0
Branch: refs/heads/master
Commit: f41737d014b3621247d6d5283ebd81f0c6720c31
Parents: 77c848a
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Apr 27 17:10:39 2016 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed May 4 10:19:18 2016 +0300
----------------------------------------------------------------------
bin/templates/scripts/cordova/Api.js | 29 ++-
.../scripts/cordova/lib/plugman/Plugman.js | 247 -------------------
.../scripts/cordova/lib/projectFile.js | 7 +
3 files changed, 31 insertions(+), 252 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f41737d0/bin/templates/scripts/cordova/Api.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/Api.js b/bin/templates/scripts/cordova/Api.js
index f926b57..ad67f8a 100644
--- a/bin/templates/scripts/cordova/Api.js
+++ b/bin/templates/scripts/cordova/Api.js
@@ -22,17 +22,19 @@
var fs = require('fs');
var path = require('path');
var unorm = require('unorm');
+var projectFile = require('./lib/projectFile');
var CordovaError = require('cordova-common').CordovaError;
var CordovaLogger = require('cordova-common').CordovaLogger;
var events = require('cordova-common').events;
+var PluginManager = require('cordova-common').PluginManager;
function setupEvents(externalEventEmitter) {
if (externalEventEmitter) {
// This will make the platform internal events visible outside
events.forwardEventsTo(externalEventEmitter);
} else {
- // There is no logger if external emitter is not present,
+ // There is no logger if external emitter is not present,
// so attach a console logger
CordovaLogger.get().subscribe(events);
}
@@ -204,8 +206,20 @@ Api.prototype.prepare = function (cordovaProject) {
* CordovaError instance.
*/
Api.prototype.addPlugin = function (plugin, installOptions) {
- var Plugman = require('./lib/plugman/Plugman');
- return Plugman.get(this.locations).addPlugin(plugin, installOptions);
+ var xcodeproj = projectFile.parse(this.locations);
+
+ installOptions = installOptions || {};
+ installOptions.variables = installOptions.variables || {};
+ // Add PACKAGE_NAME variable into vars
+ if (!installOptions.variables.PACKAGE_NAME) {
+ installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();
+ }
+
+ return PluginManager.get(this.platform, this.locations, xcodeproj)
+ .addPlugin(plugin, installOptions)
+ // CB-11022 return non-falsy value to indicate
+ // that there is no need to run prepare after
+ .thenResolve(true);
};
/**
@@ -222,8 +236,13 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
* CordovaError instance.
*/
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
- var Plugman = require('./lib/plugman/Plugman');
- return Plugman.get(this.locations).removePlugin(plugin, uninstallOptions);
+
+ var xcodeproj = projectFile.parse(this.locations);
+ return PluginManager.get(this.platform, this.locations, xcodeproj)
+ .removePlugin(plugin, uninstallOptions)
+ // CB-11022 return non-falsy value to indicate
+ // that there is no need to run prepare after
+ .thenResolve(true);
};
/**
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f41737d0/bin/templates/scripts/cordova/lib/plugman/Plugman.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/plugman/Plugman.js b/bin/templates/scripts/cordova/lib/plugman/Plugman.js
deleted file mode 100644
index 4414413..0000000
--- a/bin/templates/scripts/cordova/lib/plugman/Plugman.js
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-/*jshint node: true*/
-
-var Q = require('q');
-var path = require('path');
-var fs = require('fs');
-var shell = require('shelljs');
-
-var CordovaError = require('cordova-common').CordovaError;
-var ActionStack = require('cordova-common').ActionStack;
-
-var configMunger = require('../configMunger');
-var projectFile = require('../projectFile');
-var pluginHandlers = require('./pluginHandlers');
-
-function Plugman(locations) {
- this.locations = locations;
-
- this._munger = configMunger.get(this.locations.root);
- this._platformJson = this._munger.platformJson;
- this.platform = 'ios';
-}
-
-// shared Plugman instance
-var _instance = null;
-
-Plugman.get = function(locations) {
-
- if (!_instance) {
- _instance = new Plugman(locations);
- }
- // we use singleton Plugman instance so we don't inistantiate all helper classes
- // for each plugin add or rm
- return _instance;
-};
-
-module.exports = Plugman;
-
-Plugman.prototype.addPlugin = function (plugin, installOptions) {
-
- if (!plugin || plugin.constructor.name !== 'PluginInfo')
- return Q.reject(new CordovaError('The parameter is incorrect. The first parameter to addPlugin should be a PluginInfo instance'));
-
- installOptions = installOptions || {};
- installOptions.variables = installOptions.variables || {};
-
- var self = this;
- var actions = new ActionStack();
-
- var project = projectFile.parse(this.locations);
-
- // gather all files needs to be handled during install
- plugin.getFilesAndFrameworks(this.platform)
- .concat(plugin.getAssets(this.platform))
- .concat(plugin.getJsModules(this.platform))
- .forEach(function(item) {
- actions.push(actions.createAction(
- pluginHandlers.getInstaller(item.itemType), [item, plugin, project, installOptions],
- pluginHandlers.getUninstaller(item.itemType), [item, plugin, project, installOptions]));
- });
-
- // run through the action stack
- return actions.process(this.platform)
- .then(function () {
- if (project) {
- project.write();
- }
-
- // Add PACKAGE_NAME variable into vars
- if (!installOptions.variables.PACKAGE_NAME) {
- installOptions.variables.PACKAGE_NAME = project.getPackageName();
- }
-
- self._munger
- // Ignore passed `is_top_level` option since platform itself doesn't know
- // anything about managing dependencies - it's responsibility of caller.
- .add_plugin_changes(plugin, installOptions.variables, /*is_top_level=*/true, /*should_increment=*/true)
- .save_all();
-
- var targetDirs = [self.locations.www];
- if (installOptions.usePlatformWww) targetDirs.push(self.locations.platformWww);
- self._addModulesInfo(plugin, targetDirs);
-
- // CB-11022 Return true to indicate that prepare is not necessary
- return true;
- });
-};
-
-Plugman.prototype.removePlugin = function (plugin, uninstallOptions) {
- if (!plugin || plugin.constructor.name !== 'PluginInfo')
- return Q.reject(new CordovaError('The parameter is incorrect. The first parameter to addPlugin should be a PluginInfo instance'));
-
- var self = this;
- var actions = new ActionStack();
- var project = projectFile.parse(this.locations);
-
- // queue up plugin files
- plugin.getFilesAndFrameworks(this.platform)
- .concat(plugin.getAssets(this.platform))
- .concat(plugin.getJsModules(this.platform))
- .forEach(function(item) {
- actions.push(actions.createAction(
- pluginHandlers.getUninstaller(item.itemType), [item, plugin, project, uninstallOptions],
- pluginHandlers.getInstaller(item.itemType), [item, plugin, project, uninstallOptions]));
- });
-
- // run through the action stack
- return actions.process(this.platform)
- .then(function() {
- if (project) {
- project.write();
- }
-
- self._munger
- // Ignore passed `is_top_level` option since platform itself doesn't know
- // anything about managing dependencies - it's responsibility of caller.
- .remove_plugin_changes(plugin, /*is_top_level=*/true)
- .save_all();
-
- var targetDirs = [self.locations.www];
- if (uninstallOptions.usePlatformWww) targetDirs.push(self.locations.platformWww);
- self._removeModulesInfo(plugin, targetDirs);
-
- // CB-11022 Return true to indicate that prepare is not necessary
- return true;
- });
-};
-
-/**
- * Removes the specified modules from list of installed modules and updates
- * platform_json and cordova_plugins.js on disk.
- *
- * @param {PluginInfo} plugin PluginInfo instance for plugin, which modules
- * needs to be added.
- * @param {String[]} targetDirs The directories, where updated cordova_plugins.js
- * should be written to.
- */
-Plugman.prototype._addModulesInfo = function(plugin, targetDirs) {
- var installedModules = this._platformJson.root.modules || [];
-
- var installedPaths = installedModules.map(function (installedModule) {
- return installedModule.file;
- });
-
- var modulesToInstall = plugin.getJsModules(this.platform)
- .filter(function (moduleToInstall) {
- return installedPaths.indexOf(moduleToInstall.file) === -1;
- }).map(function (moduleToInstall) {
- var moduleName = plugin.id + '.' + ( moduleToInstall.name || moduleToInstall.src.match(/([^\/]+)\.js/)[1] );
- var obj = {
- file: ['plugins', plugin.id, moduleToInstall.src].join('/'),
- id: moduleName,
- pluginId: plugin.id
- };
- if (moduleToInstall.clobbers.length > 0) {
- obj.clobbers = moduleToInstall.clobbers.map(function(o) { return o.target; });
- }
- if (moduleToInstall.merges.length > 0) {
- obj.merges = moduleToInstall.merges.map(function(o) { return o.target; });
- }
- if (moduleToInstall.runs) {
- obj.runs = true;
- }
-
- return obj;
- });
-
- this._platformJson.root.modules = installedModules.concat(modulesToInstall);
- if (!this._platformJson.root.plugin_metadata) {
- this._platformJson.root.plugin_metadata = {};
- }
- this._platformJson.root.plugin_metadata[plugin.id] = plugin.version;
- this._writePluginModules(targetDirs);
- this._platformJson.save();
-};
-
-/**
- * Fetches all installed modules, generates cordova_plugins contents and writes
- * it to file.
- *
- * @param {String[]} targetDirs Directories, where write cordova_plugins.js to.
- * Ususally it is either <platform>/www or <platform>/platform_www
- * directories.
- */
-Plugman.prototype._writePluginModules = function (targetDirs) {
- // Write out moduleObjects as JSON wrapped in a cordova module to cordova_plugins.js
- var final_contents = 'cordova.define(\'cordova/plugin_list\', function(require, exports, module) {\n';
- final_contents += 'module.exports = ' + JSON.stringify(this._platformJson.root.modules, null, ' ') + ';\n';
- final_contents += 'module.exports.metadata = \n';
- final_contents += '// TOP OF METADATA\n';
-
- final_contents += JSON.stringify(this._platformJson.root.plugin_metadata, null, 4) + '\n';
- final_contents += '// BOTTOM OF METADATA\n';
- final_contents += '});'; // Close cordova.define.
-
- targetDirs.forEach(function (targetDir) {
- shell.mkdir('-p', targetDir);
- fs.writeFileSync(path.join(targetDir, 'cordova_plugins.js'), final_contents, 'utf-8');
- });
-};
-
-/**
- * Removes the specified modules from list of installed modules and updates
- * platform_json and cordova_plugins.js on disk.
- *
- * @param {PluginInfo} plugin PluginInfo instance for plugin, which modules
- * needs to be removed.
- * @param {String[]} targetDirs The directories, where updated cordova_plugins.js
- * should be written to.
- */
-Plugman.prototype._removeModulesInfo = function(plugin, targetDirs) {
- var installedModules = this._platformJson.root.modules || [];
- var modulesToRemove = plugin.getJsModules(this.platform)
- .map(function (jsModule) {
- return ['plugins', plugin.id, jsModule.src].join('/');
- });
-
- var updatedModules = installedModules
- .filter(function (installedModule) {
- return (modulesToRemove.indexOf(installedModule.file) === -1);
- });
-
- this._platformJson.root.modules = updatedModules;
- if (this._platformJson.root.plugin_metadata) {
- delete this._platformJson.root.plugin_metadata[plugin.id];
- }
- this._writePluginModules(targetDirs);
- this._platformJson.save();
-};
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f41737d0/bin/templates/scripts/cordova/lib/projectFile.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/projectFile.js b/bin/templates/scripts/cordova/lib/projectFile.js
index 16b3822..faa4fd3 100644
--- a/bin/templates/scripts/cordova/lib/projectFile.js
+++ b/bin/templates/scripts/cordova/lib/projectFile.js
@@ -26,6 +26,7 @@ var path = require('path');
var fs = require('fs');
var shell = require('shelljs');
+var pluginHandlers = require('./plugman/pluginHandlers');
var CordovaError = require('cordova-common').CordovaError;
var cachedProjectFiles = {};
@@ -81,6 +82,12 @@ function parseProjectFile(locations) {
getPackageName: function() {
return plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier;
},
+ getInstaller: function (name) {
+ return pluginHandlers.getInstaller(name);
+ },
+ getUninstaller: function (name) {
+ return pluginHandlers.getUninstaller(name);
+ },
frameworks: frameworks
};
return cachedProjectFiles[project_dir];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/3] ios commit: CB-11161 Bump cordova-common to 1.2.0
Posted by an...@apache.org.
CB-11161 Bump cordova-common to 1.2.0
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/77c848ad
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/77c848ad
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/77c848ad
Branch: refs/heads/master
Commit: 77c848ad9db1a9a5e1336f110f1099f0f5140646
Parents: e51eda0
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Apr 27 16:42:31 2016 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Apr 28 14:47:16 2016 +0300
----------------------------------------------------------------------
node_modules/.bin/semver | 16 +-
node_modules/.bin/semver.cmd | 7 +
node_modules/ansi/package.json | 6 +-
node_modules/balanced-match/package.json | 6 +-
node_modules/big-integer/BigInteger.js | 92 +++++------
node_modules/big-integer/BigInteger.min.js | 34 ++++-
node_modules/big-integer/LICENSE | 24 +++
node_modules/big-integer/package.json | 22 +--
node_modules/bplist-parser/package.json | 6 +-
node_modules/brace-expansion/package.json | 6 +-
node_modules/concat-map/package.json | 6 +-
node_modules/cordova-common/RELEASENOTES.md | 7 +
node_modules/cordova-common/cordova-common.js | 5 +-
node_modules/cordova-common/package.json | 133 +++++++++-------
node_modules/cordova-common/src/PlatformJson.js | 124 +++++++++++++++
.../cordova-common/src/PluginManager.js | 152 +++++++++++++++++++
node_modules/cordova-common/src/events.js | 9 +-
.../cordova-common/src/util/xml-helpers.js | 2 +-
.../cordova-registry-mapper/package.json | 6 +-
node_modules/elementtree/package.json | 6 +-
node_modules/glob/package.json | 6 +-
node_modules/inflight/package.json | 6 +-
node_modules/inherits/package.json | 6 +-
node_modules/minimatch/package.json | 6 +-
node_modules/once/package.json | 6 +-
node_modules/os-homedir/package.json | 6 +-
node_modules/os-tmpdir/package.json | 6 +-
node_modules/osenv/package.json | 6 +-
node_modules/path-is-absolute/package.json | 6 +-
node_modules/sax/package.json | 6 +-
node_modules/semver/package.json | 6 +-
node_modules/underscore/package.json | 6 +-
node_modules/unorm/package.json | 6 +-
node_modules/wrappy/package.json | 6 +-
package.json | 108 ++++++-------
35 files changed, 630 insertions(+), 231 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/.bin/semver
----------------------------------------------------------------------
diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver
index 317eb29..d592e69 120000
--- a/node_modules/.bin/semver
+++ b/node_modules/.bin/semver
@@ -1 +1,15 @@
-../semver/bin/semver
\ No newline at end of file
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../semver/bin/semver" "$@"
+ ret=$?
+else
+ node "$basedir/../semver/bin/semver" "$@"
+ ret=$?
+fi
+exit $ret
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/.bin/semver.cmd
----------------------------------------------------------------------
diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd
new file mode 100644
index 0000000..37c00a4
--- /dev/null
+++ b/node_modules/.bin/semver.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\semver\bin\semver" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\semver\bin\semver" %*
+)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/ansi/package.json
----------------------------------------------------------------------
diff --git a/node_modules/ansi/package.json b/node_modules/ansi/package.json
index b77fced..c018813 100644
--- a/node_modules/ansi/package.json
+++ b/node_modules/ansi/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"ansi@^0.3.1",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "ansi@>=0.3.1 <0.4.0",
@@ -32,7 +32,7 @@
"_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"_shrinkwrap": null,
"_spec": "ansi@^0.3.1",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "nathan@tootallnate.net",
"name": "Nathan Rajlich",
@@ -47,7 +47,7 @@
"directories": {},
"dist": {
"shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
- "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz"
+ "tarball": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz"
},
"gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246",
"homepage": "https://github.com/TooTallNate/ansi.js#readme",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/balanced-match/package.json
----------------------------------------------------------------------
diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json
index e0af851..f761b40 100644
--- a/node_modules/balanced-match/package.json
+++ b/node_modules/balanced-match/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"balanced-match@^0.3.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/brace-expansion"
+ "d:\\cordova\\cordova-ios\\node_modules\\brace-expansion"
]
],
"_from": "balanced-match@>=0.3.0 <0.4.0",
@@ -32,7 +32,7 @@
"_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756",
"_shrinkwrap": null,
"_spec": "balanced-match@^0.3.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/brace-expansion",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\brace-expansion",
"author": {
"email": "mail@juliangruber.com",
"name": "Julian Gruber",
@@ -49,7 +49,7 @@
"directories": {},
"dist": {
"shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756",
- "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz"
+ "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz"
},
"gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5",
"homepage": "https://github.com/juliangruber/balanced-match",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/big-integer/BigInteger.js
----------------------------------------------------------------------
diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js
index 8c06143..ec9b6d1 100644
--- a/node_modules/big-integer/BigInteger.js
+++ b/node_modules/big-integer/BigInteger.js
@@ -7,17 +7,25 @@ var bigInt = (function (undefined) {
MAX_INT_ARR = smallToArray(MAX_INT),
LOG_MAX_INT = Math.log(MAX_INT);
+ function Integer(v, radix) {
+ if (typeof v === "undefined") return Integer[0];
+ if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix);
+ return parseValue(v);
+ }
+
function BigInteger(value, sign) {
this.value = value;
this.sign = sign;
this.isSmall = false;
}
+ BigInteger.prototype = Object.create(Integer.prototype);
function SmallInteger(value) {
this.value = value;
this.sign = value < 0;
this.isSmall = true;
}
+ SmallInteger.prototype = Object.create(Integer.prototype);
function isPrecise(n) {
return -MAX_INT < n && n < MAX_INT;
@@ -323,7 +331,7 @@ var bigInt = (function (undefined) {
sign = this.sign !== n.sign,
abs;
if (n.isSmall) {
- if (b === 0) return CACHE[0];
+ if (b === 0) return Integer[0];
if (b === 1) return this;
if (b === -1) return this.negate();
abs = Math.abs(b);
@@ -345,20 +353,20 @@ var bigInt = (function (undefined) {
}
return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
}
- SmallInteger.prototype["_multiplyBySmall"] = function (a) {
+ SmallInteger.prototype._multiplyBySmall = function (a) {
if (isPrecise(a.value * this.value)) {
return new SmallInteger(a.value * this.value);
}
return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
};
- BigInteger.prototype["_multiplyBySmall"] = function (a) {
- if (a.value === 0) return CACHE[0];
+ BigInteger.prototype._multiplyBySmall = function (a) {
+ if (a.value === 0) return Integer[0];
if (a.value === 1) return this;
if (a.value === -1) return this.negate();
return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
};
SmallInteger.prototype.multiply = function (v) {
- return parseValue(v)["_multiplyBySmall"](this);
+ return parseValue(v)._multiplyBySmall(this);
};
SmallInteger.prototype.times = SmallInteger.prototype.multiply;
@@ -506,11 +514,11 @@ var bigInt = (function (undefined) {
if (n.isSmall) {
return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
}
- return [CACHE[0], self];
+ return [Integer[0], self];
}
if (n.isSmall) {
- if (b === 1) return [self, CACHE[0]];
- if (b == -1) return [self.negate(), CACHE[0]];
+ if (b === 1) return [self, Integer[0]];
+ if (b == -1) return [self.negate(), Integer[0]];
var abs = Math.abs(b);
if (abs < BASE) {
value = divModSmall(a, abs);
@@ -526,8 +534,8 @@ var bigInt = (function (undefined) {
b = smallToArray(abs);
}
var comparison = compareAbs(a, b);
- if (comparison === -1) return [CACHE[0], self];
- if (comparison === 0) return [CACHE[self.sign === n.sign ? 1 : -1], CACHE[0]];
+ if (comparison === -1) return [Integer[0], self];
+ if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
// divMod1 is faster on smaller input sizes
if (a.length + b.length <= 200)
@@ -573,12 +581,12 @@ var bigInt = (function (undefined) {
a = this.value,
b = n.value,
value, x, y;
- if (b === 0) return CACHE[1];
- if (a === 0) return CACHE[0];
- if (a === 1) return CACHE[1];
- if (a === -1) return n.isEven() ? CACHE[1] : CACHE[-1];
+ if (b === 0) return Integer[1];
+ if (a === 0) return Integer[0];
+ if (a === 1) return Integer[1];
+ if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
if (n.sign) {
- return CACHE[0];
+ return Integer[0];
}
if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
if (this.isSmall) {
@@ -586,7 +594,7 @@ var bigInt = (function (undefined) {
return new SmallInteger(truncate(value));
}
x = this;
- y = CACHE[1];
+ y = Integer[1];
while (true) {
if (b & 1 === 1) {
y = y.times(x);
@@ -604,10 +612,10 @@ var bigInt = (function (undefined) {
exp = parseValue(exp);
mod = parseValue(mod);
if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
- var r = CACHE[1],
+ var r = Integer[1],
base = this.mod(mod);
while (exp.isPositive()) {
- if (base.isZero()) return CACHE[0];
+ if (base.isZero()) return Integer[0];
if (exp.isOdd()) r = r.multiply(base).mod(mod);
exp = exp.divide(2);
base = base.square().mod(mod);
@@ -765,7 +773,7 @@ var bigInt = (function (undefined) {
if (value === 0) return false;
if (value === 1) return true;
if (value === 2) return this.isEven();
- return this.mod(n).equals(CACHE[0]);
+ return this.mod(n).equals(Integer[0]);
};
SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
@@ -776,7 +784,7 @@ var bigInt = (function (undefined) {
if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
if (n.lesser(25)) return true;
// we don't know if it's prime: let the other functions figure it out
- };
+ }
BigInteger.prototype.isPrime = function () {
var isPrime = isBasicPrime(this);
@@ -789,7 +797,7 @@ var bigInt = (function (undefined) {
while (b.isEven()) b = b.divide(2);
for (i = 0; i < a.length; i++) {
x = bigInt(a[i]).modPow(b, n);
- if (x.equals(CACHE[1]) || x.equals(nPrev)) continue;
+ if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
for (t = true, d = b; t && d.lesser(nPrev) ; d = d.multiply(2)) {
x = x.square().mod(n);
if (x.equals(nPrev)) t = false;
@@ -961,7 +969,7 @@ var bigInt = (function (undefined) {
if (a.equals(b)) return a;
if (a.isZero()) return b;
if (b.isZero()) return a;
- var c = CACHE[1], d, t;
+ var c = Integer[1], d, t;
while (a.isEven() && b.isEven()) {
d = Math.min(roughLOB(a), roughLOB(b));
a = a.divide(d);
@@ -1005,7 +1013,7 @@ var bigInt = (function (undefined) {
return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
}
var parseBase = function (text, base) {
- var val = CACHE[0], pow = CACHE[1],
+ var val = Integer[0], pow = Integer[1],
length = text.length;
if (2 <= base && base <= 36) {
if (length <= LOG_MAX_INT / Math.log(base)) {
@@ -1117,7 +1125,7 @@ var bigInt = (function (undefined) {
var sign = v[0] === "-";
if (sign) v = v.slice(1);
var split = v.split(/e/i);
- if (split.length > 2) throw new Error("Invalid integer: " + text.join("e"));
+ if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
if (split.length === 2) {
var exp = split[1];
if (exp[0] === "+") exp = exp.slice(1);
@@ -1147,8 +1155,11 @@ var bigInt = (function (undefined) {
}
function parseNumberValue(v) {
- if (isPrecise(v)) return new SmallInteger(v);
- return parseStringValue(v.toString());
+ if (isPrecise(v)) {
+ if (v !== truncate(v)) throw new Error(v + " is not an integer.");
+ return new SmallInteger(v);
+ }
+ return parseStringValue(v.toString());
}
function parseValue(v) {
@@ -1161,26 +1172,21 @@ var bigInt = (function (undefined) {
return v;
}
// Pre-define numbers in range [-999,999]
- var CACHE = function (v, radix) {
- if (typeof v === "undefined") return CACHE[0];
- if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix);
- return parseValue(v);
- };
for (var i = 0; i < 1000; i++) {
- CACHE[i] = new SmallInteger(i);
- if (i > 0) CACHE[-i] = new SmallInteger(-i);
+ Integer[i] = new SmallInteger(i);
+ if (i > 0) Integer[-i] = new SmallInteger(-i);
}
// Backwards compatibility
- CACHE.one = CACHE[1];
- CACHE.zero = CACHE[0];
- CACHE.minusOne = CACHE[-1];
- CACHE.max = max;
- CACHE.min = min;
- CACHE.gcd = gcd;
- CACHE.lcm = lcm;
- CACHE.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
- CACHE.randBetween = randBetween;
- return CACHE;
+ Integer.one = Integer[1];
+ Integer.zero = Integer[0];
+ Integer.minusOne = Integer[-1];
+ Integer.max = max;
+ Integer.min = min;
+ Integer.gcd = gcd;
+ Integer.lcm = lcm;
+ Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
+ Integer.randBetween = randBetween;
+ return Integer;
})();
// Node.js check
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/big-integer/BigInteger.min.js
----------------------------------------------------------------------
diff --git a/node_modules/big-integer/BigInteger.min.js b/node_modules/big-integer/BigInteger.min.js
index 53480ea..a9d12de 100644
--- a/node_modules/big-integer/BigInteger.min.js
+++ b/node_modules/big-integer/BigInteger.min.js
@@ -1 +1,33 @@
-var bigInt=function(e){"use strict";function o(e,t){this.value=e,this.sign=t,this.isSmall=!1}function u(e){this.value=e,this.sign=e<0,this.isSmall=!0}function a(e){return-r<e&&e<r}function f(e){return e<1e7?[e]:e<1e14?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/1e14)]}function l(e){c(e);var n=e.length;if(n<4&&M(e,i)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function c(e){var t=e.length;while(e[--t]===0);e.length=t+1}function h(e){var t=new Array(e),n=-1;while(++n<e)t[n]=0;return t}function p(e){return e>0?Math.floor(e):Math.ceil(e)}function d(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(f=0;f<i;f++)a=e[f]+n[f]+o,o=a>=u?1:0,s[f]=a-o*u;while(f<r)a=e[f]+o,o=a===u?1:0,s[f++]=a-o*u;return o>0&&s.push(o),s}function v(e,t){return e.length>=t.length?d(e,t):d(t,e)}function m(e,n){var r=e.length,i=new Array(r),s=t,o,u;for(u=0;u<r;u++)o=e[u]-s+n,n=Math.floor(o/s),i[u]=o-n*s,n+=1
;while(n>0)i[u++]=n%s,n=Math.floor(n/s);return i}function g(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(a=0;a<i;a++)f=e[a]-o-n[a],f<0?(f+=u,o=1):o=0,s[a]=f;for(a=i;a<r;a++){f=e[a]-o;if(!(f<0)){s[a++]=f;break}f+=u,s[a]=f}for(;a<r;a++)s[a]=e[a];return c(s),s}function y(e,t,n){var r,i;return M(e,t)>=0?r=g(e,t):(r=g(t,e),n=!n),r=l(r),typeof r=="number"?(n&&(r=-r),new u(r)):new o(r,n)}function b(e,n,r){var i=e.length,s=new Array(i),a=-n,f=t,c,h;for(c=0;c<i;c++)h=e[c]+a,a=Math.floor(h/f),h%=f,s[c]=h<0?h+f:h;return s=l(s),typeof s=="number"?(r&&(s=-s),new u(s)):new o(s,r)}function w(e,n){var r=e.length,i=n.length,s=r+i,o=h(s),u=t,a,f,l,p,d;for(l=0;l<r;++l){p=e[l];for(var v=0;v<i;++v)d=n[v],a=p*d+o[l+v],f=Math.floor(a/u),o[l+v]=a-f*u,o[l+v+1]+=f}return c(o),o}function E(e,n){var r=e.length,i=new Array(r),s=t,o=0,u,a;for(a=0;a<r;a++)u=e[a]*n+o,o=Math.floor(u/s),i[a]=u-o*s;while(o>0)i[a++]=o%s,o=Math.floor(o/s);return i}function S(e,t){var n=[];while(t-->0)n.push(0);return n
.concat(e)}function x(e,t){var n=Math.max(e.length,t.length);if(n<=30)return w(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),s=t.slice(n),o=t.slice(0,n),u=x(i,o),a=x(r,s),f=x(v(i,r),v(o,s)),l=v(v(u,S(g(g(f,u),a),n)),S(a,2*n));return c(l),l}function T(e,t){return-0.012*e-.012*t+15e-6*e*t>0}function N(e,n,r){return e<t?new o(E(n,e),r):new o(w(n,f(e)),r)}function C(e){var n=e.length,r=h(n+n),i=t,s,o,u,a,f;for(u=0;u<n;u++){a=e[u];for(var l=0;l<n;l++)f=e[l],s=a*f+r[u+l],o=Math.floor(s/i),r[u+l]=s-o*i,r[u+l+1]+=o}return c(r),r}function k(e,n){var r=e.length,i=n.length,s=t,o=h(n.length),u=n[i-1],a=Math.ceil(s/(2*u)),f=E(e,a),c=E(n,a),p,d,v,m,g,y,b;f.length<=r&&f.push(0),c.push(0),u=c[i-1];for(d=r-i;d>=0;d--){p=s-1,f[d+i]!==u&&(p=Math.floor((f[d+i]*s+f[d+i-1])/u)),v=0,m=0,y=c.length;for(g=0;g<y;g++)v+=p*c[g],b=Math.floor(v/s),m+=f[d+g]-(v-b*s),v=b,m<0?(f[d+g]=m+s,m=-1):(f[d+g]=m,m=0);while(m!==0){p-=1,v=0;for(g=0;g<y;g++)v+=f[d+g]-s+c[g],v<0?(f[d+g]=v+s,v=0):(f[d+g]=v,v=1);m+=v}o[d]
=p}return f=A(f,a)[0],[l(o),l(f)]}function L(e,n){var r=e.length,i=n.length,s=[],o=[],u=t,a,f,c,h,p;while(r){o.unshift(e[--r]);if(M(o,n)<0){s.push(0);continue}f=o.length,c=o[f-1]*u+o[f-2],h=n[i-1]*u+n[i-2],f>i&&(c=(c+1)*u),a=Math.ceil(c/h);do{p=E(n,a);if(M(p,o)<=0)break;a--}while(a);s.push(a),o=g(o,p)}return s.reverse(),[l(s),l(o)]}function A(e,n){var r=e.length,i=h(r),s=t,o,u,a,f;a=0;for(o=r-1;o>=0;--o)f=a*s+e[o],u=p(f/n),a=f-u*n,i[o]=u|0;return[i,a|0]}function O(e,n){var r,i=G(n),s=e.value,a=i.value,c;if(a===0)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new u(p(s/a)),new u(s%a)]:[Y[0],e];if(i.isSmall){if(a===1)return[e,Y[0]];if(a==-1)return[e.negate(),Y[0]];var h=Math.abs(a);if(h<t){r=A(s,h),c=l(r[0]);var d=r[1];return e.sign&&(d=-d),typeof c=="number"?(e.sign!==i.sign&&(c=-c),[new u(c),new u(d)]):[new o(c,e.sign!==i.sign),new u(d)]}a=f(h)}var v=M(s,a);if(v===-1)return[Y[0],e];if(v===0)return[Y[e.sign===i.sign?1:-1],Y[0]];s.length+a.length<=200?r=k(s,a)
:r=L(s,a),c=r[0];var m=e.sign!==i.sign,g=r[1],y=e.sign;return typeof c=="number"?(m&&(c=-c),c=new u(c)):c=new o(c,m),typeof g=="number"?(y&&(g=-g),g=new u(g)):g=new o(g,y),[c,g]}function M(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}function _(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(25))return!0}function B(e){return(typeof e=="number"||typeof e=="string")&&+Math.abs(e)<=t||e instanceof o&&e.value.length<=1}function j(e,t,n){t=G(t);var r=e.isNegative(),i=t.isNegative(),s=r?e.not():e,o=i?t.not():t,u=[],a=[],f=!1,l=!1;while(!f||!l)s.isZero()?(f=!0,u.push(r?1:0)):r?u.push(s.isEven()?1:0):u.push(s.isEven()?0:1),o.isZero()?(l=!0,a.push(i?1:0)):i?a.push(o.isEven()?1:0):a.push(o.isEven()?0:1),s=s.over(2),o=o.over(2);var c=[];for(var h=0;h<u.length;h++)c.push(n(u[h],a[h]));var p=b
igInt(c.pop()).negate().times(bigInt(2).pow(c.length));while(c.length)p=p.add(bigInt(c.pop()).times(bigInt(2).pow(c.length)));return p}function q(e){var n=e.value,r=typeof n=="number"?n|F:n[0]+n[1]*t|I;return r&-r}function R(e,t){return e=G(e),t=G(t),e.greater(t)?e:t}function U(e,t){return e=G(e),t=G(t),e.lesser(t)?e:t}function z(e,t){e=G(e).abs(),t=G(t).abs();if(e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;var n=Y[1],r,i;while(e.isEven()&&t.isEven())r=Math.min(q(e),q(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);while(e.isEven())e=e.divide(q(e));do{while(t.isEven())t=t.divide(q(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function W(e,t){return e=G(e).abs(),t=G(t).abs(),e.divide(z(e,t)).multiply(t)}function X(e,n){e=G(e),n=G(n);var r=U(e,n),i=R(e,n),s=i.subtract(r);if(s.isSmall)return r.add(Math.round(Math.random()*s));var a=s.value.length-1,f=[],c=!0;for(var h=a;h>=0;h--){var d=c?s.value[h]:t,v=p(Math.
random()*d);f.unshift(v),v<d&&(c=!1)}return f=l(f),r.add(typeof f=="number"?new u(f):new o(f,!1))}function $(e){var t=e.value;return typeof t=="number"&&(t=[t]),t.length===1&&t[0]<=35?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t[0]):"<"+t+">"}function J(e,t){t=bigInt(t);if(t.isZero()){if(e.isZero())return"0";throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1))return e.isZero()?"0":e.isNegative()?(new Array(1-e)).join("10"):"1"+(new Array(+e)).join("01");var n="";e.isNegative()&&t.isPositive()&&(n="-",e=e.abs());if(t.equals(1))return e.isZero()?"0":n+(new Array(+e+1)).join(1);var r=[],i=e,s;while(i.isNegative()||i.compareAbs(t)>=0){s=i.divmod(t),i=s.quotient;var o=s.remainder;o.isNegative()&&(o=t.minus(o).abs(),i=i.next()),r.push($(o))}return r.push($(i)),n+r.reverse().join("")}function K(e){if(a(+e)){var t=+e;if(t===p(t))return new u(t);throw"Invalid integer: "+e}var r=e[0]==="-";r&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid
integer: "+f.join("e"));if(i.length===2){var s=i[1];s[0]==="+"&&(s=s.slice(1)),s=+s;if(s!==p(s)||!a(s))throw new Error("Invalid integer: "+s+" is not a valid exponent.");var f=i[0],l=f.indexOf(".");l>=0&&(s-=f.length-l-1,f=f.slice(0,l)+f.slice(l+1));if(s<0)throw new Error("Cannot include negative exponent part for integers");f+=(new Array(s+1)).join("0"),e=f}var h=/^([0-9][0-9]*)$/.test(e);if(!h)throw new Error("Invalid integer: "+e);var d=[],v=e.length,m=n,g=v-m;while(v>0)d.push(+e.slice(g,v)),g-=m,g<0&&(g=0),v-=m;return c(d),new o(d,r)}function Q(e){return a(e)?new u(e):K(e.toString())}function G(e){return typeof e=="number"?Q(e):typeof e=="string"?K(e):e}var t=1e7,n=7,r=9007199254740992,i=f(r),s=Math.log(r);o.prototype.add=function(e){var t,n=G(e);if(this.sign!==n.sign)return this.subtract(n.negate());var r=this.value,i=n.value;return n.isSmall?new o(m(r,Math.abs(i)),this.sign):new o(v(r,i),this.sign)},o.prototype.plus=o.prototype.add,u.prototype.add=function(e){var t=G(e),n=thi
s.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(a(n+r))return new u(n+r);r=f(Math.abs(r))}return new o(m(r,Math.abs(n)),n<0)},u.prototype.plus=u.prototype.add,o.prototype.subtract=function(e){var t=G(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?b(n,Math.abs(r),this.sign):y(n,r,this.sign)},o.prototype.minus=o.prototype.subtract,u.prototype.subtract=function(e){var t=G(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new u(n-r):b(r,Math.abs(n),n>=0)},u.prototype.minus=u.prototype.subtract,o.prototype.negate=function(){return new o(this.value,!this.sign)},u.prototype.negate=function(){var e=this.sign,t=new u(-this.value);return t.sign=!e,t},o.prototype.abs=function(){return new o(this.value,!1)},u.prototype.abs=function(){return new u(Math.abs(this.value))},o.prototype.multiply=function(e){var n,r=G(e),i=this.value,s=r.value,u=this.sign!==r.sign,a;if(r.i
sSmall){if(s===0)return Y[0];if(s===1)return this;if(s===-1)return this.negate();a=Math.abs(s);if(a<t)return new o(E(i,a),u);s=f(a)}return T(i.length,s.length)?new o(x(i,s),u):new o(w(i,s),u)},o.prototype.times=o.prototype.multiply,u.prototype._multiplyBySmall=function(e){return a(e.value*this.value)?new u(e.value*this.value):N(Math.abs(e.value),f(Math.abs(this.value)),this.sign!==e.sign)},o.prototype._multiplyBySmall=function(e){return e.value===0?Y[0]:e.value===1?this:e.value===-1?this.negate():N(Math.abs(e.value),this.value,this.sign!==e.sign)},u.prototype.multiply=function(e){return G(e)._multiplyBySmall(this)},u.prototype.times=u.prototype.multiply,o.prototype.square=function(){return new o(C(this.value),!1)},u.prototype.square=function(){var e=this.value*this.value;return a(e)?new u(e):new o(C(f(Math.abs(this.value))),!1)},o.prototype.divmod=function(e){var t=O(this,e);return{quotient:t[0],remainder:t[1]}},u.prototype.divmod=o.prototype.divmod,o.prototype.divide=function(e){re
turn O(this,e)[0]},u.prototype.over=u.prototype.divide=o.prototype.over=o.prototype.divide,o.prototype.mod=function(e){return O(this,e)[1]},u.prototype.remainder=u.prototype.mod=o.prototype.remainder=o.prototype.mod,o.prototype.pow=function(e){var t=G(e),n=this.value,r=t.value,i,s,o;if(r===0)return Y[1];if(n===0)return Y[0];if(n===1)return Y[1];if(n===-1)return t.isEven()?Y[1]:Y[-1];if(t.sign)return Y[0];if(!t.isSmall)throw new Error("The exponent "+t.toString()+" is too large.");if(this.isSmall&&a(i=Math.pow(n,r)))return new u(p(i));s=this,o=Y[1];for(;;){r&!0&&(o=o.times(s),--r);if(r===0)break;r/=2,s=s.square()}return o},u.prototype.pow=o.prototype.pow,o.prototype.modPow=function(e,t){e=G(e),t=G(t);if(t.isZero())throw new Error("Cannot take modPow with modulus 0");var n=Y[1],r=this.mod(t);while(e.isPositive()){if(r.isZero())return Y[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},u.prototype.modPow=o.prototype.modPow,o.prototype.compareAbs=functio
n(e){var t=G(e),n=this.value,r=t.value;return t.isSmall?1:M(n,r)},u.prototype.compareAbs=function(e){var t=G(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},o.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=G(e),n=this.value,r=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:M(n,r)*(this.sign?-1:1)},o.prototype.compareTo=o.prototype.compare,u.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=G(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0!==t.sign?n<0?-1:1:n<0?1:-1},u.prototype.compareTo=u.prototype.compare,o.prototype.equals=function(e){return this.compare(e)===0},u.prototype.eq=u.prototype.equals=o.prototype.eq=o.prototype.equals,o.prototype.notEquals=function(e){return this.compare(e)!==0},u.prototype.neq=u.prototype.notEquals=o.prototype.neq=o.prototype.notEquals,o.prototype.greater=function(e){return this.compare(e)>0},u.pr
ototype.gt=u.prototype.greater=o.prototype.gt=o.prototype.greater,o.prototype.lesser=function(e){return this.compare(e)<0},u.prototype.lt=u.prototype.lesser=o.prototype.lt=o.prototype.lesser,o.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},u.prototype.geq=u.prototype.greaterOrEquals=o.prototype.geq=o.prototype.greaterOrEquals,o.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},u.prototype.leq=u.prototype.lesserOrEquals=o.prototype.leq=o.prototype.lesserOrEquals,o.prototype.isEven=function(){return(this.value[0]&1)===0},u.prototype.isEven=function(){return(this.value&1)===0},o.prototype.isOdd=function(){return(this.value[0]&1)===1},u.prototype.isOdd=function(){return(this.value&1)===1},o.prototype.isPositive=function(){return!this.sign},u.prototype.isPositive=function(){return this.value>0},o.prototype.isNegative=function(){return this.sign},u.prototype.isNegative=function(){return this.value<0},o.prototype.isUnit=function(){return!1},u.prototype.isUni
t=function(){return Math.abs(this.value)===1},o.prototype.isZero=function(){return!1},u.prototype.isZero=function(){return this.value===0},o.prototype.isDivisibleBy=function(e){var t=G(e),n=t.value;return n===0?!1:n===1?!0:n===2?this.isEven():this.mod(t).equals(Y[0])},u.prototype.isDivisibleBy=o.prototype.isDivisibleBy,o.prototype.isPrime=function(){var t=_(this);if(t!==e)return t;var n=this.abs(),r=n.prev(),i=[2,3,5,7,11,13,17,19],s=r,o,u,a,f;while(s.isEven())s=s.divide(2);for(a=0;a<i.length;a++){f=bigInt(i[a]).modPow(s,n);if(f.equals(Y[1])||f.equals(r))continue;for(u=!0,o=s;u&&o.lesser(r);o=o.multiply(2))f=f.square().mod(n),f.equals(r)&&(u=!1);if(u)return!1}return!0},u.prototype.isPrime=o.prototype.isPrime,o.prototype.isProbablePrime=function(t){var n=_(this);if(n!==e)return n;var r=this.abs(),i=t===e?5:t;for(var s=0;s<i;s++){var o=bigInt.randBetween(2,r.minus(2));if(!o.modPow(r.prev(),r).isUnit())return!1}return!0},u.prototype.isProbablePrime=o.prototype.isProbablePrime,o.prototy
pe.next=function(){var e=this.value;return this.sign?b(e,1,this.sign):new o(m(e,1),this.sign)},u.prototype.next=function(){var e=this.value;return e+1<r?new u(e+1):new o(i,!1)},o.prototype.prev=function(){var e=this.value;return this.sign?new o(m(e,1),!0):b(e,1,this.sign)},u.prototype.prev=function(){var e=this.value;return e-1>-r?new u(e-1):new o(i,!0)};var D=[1];while(D[D.length-1]<=t)D.push(2*D[D.length-1]);var P=D.length,H=D[P-1];o.prototype.shiftLeft=function(e){if(!B(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftRight(-e);var t=this;while(e>=P)t=t.multiply(H),e-=P-1;return t.multiply(D[e])},u.prototype.shiftLeft=o.prototype.shiftLeft,o.prototype.shiftRight=function(e){var t;if(!B(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftLeft(-e);var n=this;while(e>=P){if(n.isZero())return n;t=O(n,H),n=t[1].isNegative()?t[0].prev():t[0],e-=P-1}return t=O(n,D[e]),t[1].isNegative()?t[0].prev():t[0]},u.proto
type.shiftRight=o.prototype.shiftRight,o.prototype.not=function(){return this.negate().prev()},u.prototype.not=o.prototype.not,o.prototype.and=function(e){return j(this,e,function(e,t){return e&t})},u.prototype.and=o.prototype.and,o.prototype.or=function(e){return j(this,e,function(e,t){return e|t})},u.prototype.or=o.prototype.or,o.prototype.xor=function(e){return j(this,e,function(e,t){return e^t})},u.prototype.xor=o.prototype.xor;var F=1<<30,I=(t&-t)*(t&-t)|F,V=function(e,t){var n=Y[0],r=Y[1],i=e.length;if(2<=t&&t<=36&&i<=s/Math.log(t))return new u(parseInt(e,t));t=G(t);var o=[],a,f=e[0]==="-";for(a=f?1:0;a<e.length;a++){var l=e[a].toLowerCase(),c=l.charCodeAt(0);if(48<=c&&c<=57)o.push(G(l));else if(97<=c&&c<=122)o.push(G(l.charCodeAt(0)-87));else{if(l!=="<")throw new Error(l+" is not a valid character");var h=a;do a++;while(e[a]!==">");o.push(G(e.slice(h+1,a)))}}o.reverse();for(a=0;a<o.length;a++)n=n.add(o[a].times(r)),r=r.times(t);return f?n.negate():n};o.prototype.toString=func
tion(t){t===e&&(t=10);if(t!==10)return J(this,t);var n=this.value,r=n.length,i=String(n[--r]),s="0000000",o;while(--r>=0)o=String(n[r]),i+=s.slice(o.length)+o;var u=this.sign?"-":"";return u+i},u.prototype.toString=function(t){return t===e&&(t=10),t!=10?J(this,t):String(this.value)},o.prototype.valueOf=function(){return+this.toString()},o.prototype.toJSNumber=o.prototype.valueOf,u.prototype.valueOf=function(){return this.value},u.prototype.toJSNumber=u.prototype.valueOf;var Y=function(e,t){return typeof e=="undefined"?Y[0]:typeof t!="undefined"?+t===10?G(e):V(e,t):G(e)};for(var Z=0;Z<1e3;Z++)Y[Z]=new u(Z),Z>0&&(Y[-Z]=new u(-Z));return Y.one=Y[1],Y.zero=Y[0],Y.minusOne=Y[-1],Y.max=R,Y.min=U,Y.gcd=z,Y.lcm=W,Y.isInstance=function(e){return e instanceof o||e instanceof u},Y.randBetween=X,Y}();typeof module!="undefined"&&module.hasOwnProperty("exports")&&(module.exports=bigInt);
\ No newline at end of file
+var bigInt=function(E){function k(a,b){if("undefined"===typeof a)return k[0];if("undefined"!==typeof b){var c;if(10===+b)c=l(a);else{c=b;var n=k[0],f=k[1],d=a.length;if(2<=c&&36>=c&&d<=ga/Math.log(c))c=new e(parseInt(a,c));else{c=l(c);var d=[],g,h="-"===a[0];for(g=h?1:0;g<a.length;g++){var q=a[g].toLowerCase(),u=q.charCodeAt(0);if(48<=u&&57>=u)d.push(l(q));else if(97<=u&&122>=u)d.push(l(q.charCodeAt(0)-87));else if("<"===q){q=g;do g++;while(">"!==a[g]);d.push(l(a.slice(q+1,g)))}else throw Error(q+
+" is not a valid character");}d.reverse();for(g=0;g<d.length;g++)n=n.add(d[g].times(f)),f=f.times(c);c=h?n.negate():n}}return c}return l(a)}function d(a,b){this.value=a;this.sign=b;this.isSmall=!1}function e(a){this.value=a;this.sign=0>a;this.isSmall=!0}function w(a){return-9007199254740992<a&&9007199254740992>a}function z(a){return 1E7>a?[a]:1E14>a?[a%1E7,Math.floor(a/1E7)]:[a%1E7,Math.floor(a/1E7)%1E7,Math.floor(a/1E14)]}function y(a){D(a);var b=a.length;if(4>b&&0>A(a,P))switch(b){case 0:return 0;
+case 1:return a[0];case 2:return a[0]+1E7*a[1];default:return a[0]+1E7*(a[1]+1E7*a[2])}return a}function D(a){for(var b=a.length;0===a[--b];);a.length=b+1}function K(a){for(var b=Array(a),c=-1;++c<a;)b[c]=0;return b}function B(a){return 0<a?Math.floor(a):Math.ceil(a)}function S(a,b){var c=a.length,d=b.length,f=Array(c),m=0,g,e;for(e=0;e<d;e++)g=a[e]+b[e]+m,m=1E7<=g?1:0,f[e]=g-1E7*m;for(;e<c;)g=a[e]+m,m=1E7===g?1:0,f[e++]=g-1E7*m;0<m&&f.push(m);return f}function F(a,b){return a.length>=b.length?S(a,
+b):S(b,a)}function L(a,b){var c=a.length,d=Array(c),f,e;for(e=0;e<c;e++)f=a[e]-1E7+b,b=Math.floor(f/1E7),d[e]=f-1E7*b,b+=1;for(;0<b;)d[e++]=b%1E7,b=Math.floor(b/1E7);return d}function G(a,b){var c=a.length,d=b.length,f=Array(c),e=0,g,h;for(g=0;g<d;g++)h=a[g]-e-b[g],0>h?(h+=1E7,e=1):e=0,f[g]=h;for(g=d;g<c;g++){h=a[g]-e;if(0>h)h+=1E7;else{f[g++]=h;break}f[g]=h}for(;g<c;g++)f[g]=a[g];D(f);return f}function M(a,b,c){var n=a.length,f=Array(n);b=-b;var m,g;for(m=0;m<n;m++)g=a[m]+b,b=Math.floor(g/1E7),g%=
+1E7,f[m]=0>g?g+1E7:g;f=y(f);return"number"===typeof f?(c&&(f=-f),new e(f)):new d(f,c)}function Q(a,b){var c=a.length,d=b.length,f=K(c+d),e,g,h,k;for(h=0;h<c;++h){k=a[h];for(var l=0;l<d;++l)e=b[l],e=k*e+f[h+l],g=Math.floor(e/1E7),f[h+l]=e-1E7*g,f[h+l+1]+=g}D(f);return f}function H(a,b){var c=a.length,d=Array(c),f=0,e,g;for(g=0;g<c;g++)e=a[g]*b+f,f=Math.floor(e/1E7),d[g]=e-1E7*f;for(;0<f;)d[g++]=f%1E7,f=Math.floor(f/1E7);return d}function T(a,b){for(var c=[];0<b--;)c.push(0);return c.concat(a)}function N(a,
+b){var c=Math.max(a.length,b.length);if(30>=c)return Q(a,b);var c=Math.ceil(c/2),d=a.slice(c),f=a.slice(0,c),e=b.slice(c),g=b.slice(0,c),h=N(f,g),k=N(d,e),d=N(F(f,d),F(g,e)),c=F(F(h,T(G(G(d,h),k),c)),T(k,2*c));D(c);return c}function U(a,b,c){return 1E7>a?new d(H(b,a),c):new d(Q(b,z(a)),c)}function V(a){var b=a.length,c=K(b+b),d,f,e,g;for(e=0;e<b;e++){g=a[e];for(var h=0;h<b;h++)d=a[h],d=g*d+c[e+h],f=Math.floor(d/1E7),c[e+h]=d-1E7*f,c[e+h+1]+=f}D(c);return c}function W(a,b){var c=a.length,d=K(c),f,
+e;e=0;for(--c;0<=c;--c)e=1E7*e+a[c],f=B(e/b),e-=f*b,d[c]=f|0;return[d,e|0]}function I(a,b){var c,n=l(b),f=a.value;c=n.value;if(0===c)throw Error("Cannot divide by zero");if(a.isSmall)return n.isSmall?[new e(B(f/c)),new e(f%c)]:[k[0],a];if(n.isSmall){if(1===c)return[a,k[0]];if(-1==c)return[a.negate(),k[0]];c=Math.abs(c);if(1E7>c)return c=W(f,c),f=y(c[0]),c=c[1],a.sign&&(c=-c),"number"===typeof f?(a.sign!==n.sign&&(f=-f),[new e(f),new e(c)]):[new d(f,a.sign!==n.sign),new e(c)];c=z(c)}var m=A(f,c);if(-1===
+m)return[k[0],a];if(0===m)return[k[a.sign===n.sign?1:-1],k[0]];if(200>=f.length+c.length){var g=c,h=f.length;c=g.length;var m=K(g.length),q=g[c-1],u=Math.ceil(1E7/(2*q)),f=H(f,u),g=H(g,u),p,r,x,t,v,w;f.length<=h&&f.push(0);g.push(0);q=g[c-1];for(p=h-c;0<=p;p--){h=9999999;f[p+c]!==q&&(h=Math.floor((1E7*f[p+c]+f[p+c-1])/q));x=r=0;v=g.length;for(t=0;t<v;t++)r+=h*g[t],w=Math.floor(r/1E7),x+=f[p+t]-(r-1E7*w),r=w,0>x?(f[p+t]=x+1E7,x=-1):(f[p+t]=x,x=0);for(;0!==x;){--h;for(t=r=0;t<v;t++)r+=f[p+t]-1E7+g[t],
+0>r?(f[p+t]=r+1E7,r=0):(f[p+t]=r,r=1);x+=r}m[p]=h}f=W(f,u)[0];c=[y(m),y(f)]}else{m=f.length;q=c.length;u=[];for(g=[];m;)if(g.unshift(f[--m]),0>A(g,c))u.push(0);else{h=g.length;p=1E7*g[h-1]+g[h-2];r=1E7*c[q-1]+c[q-2];h>q&&(p=1E7*(p+1));h=Math.ceil(p/r);do{p=H(c,h);if(0>=A(p,g))break;h--}while(h);u.push(h);g=G(g,p)}u.reverse();c=[y(u),y(g)]}f=c[0];n=a.sign!==n.sign;c=c[1];m=a.sign;"number"===typeof f?(n&&(f=-f),f=new e(f)):f=new d(f,n);"number"===typeof c?(m&&(c=-c),c=new e(c)):c=new d(c,m);return[f,
+c]}function A(a,b){if(a.length!==b.length)return a.length>b.length?1:-1;for(var c=a.length-1;0<=c;c--)if(a[c]!==b[c])return a[c]>b[c]?1:-1;return 0}function X(a){a=a.abs();if(a.isUnit())return!1;if(a.equals(2)||a.equals(3)||a.equals(5))return!0;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return!1;if(a.lesser(25))return!0}function Y(a){return("number"===typeof a||"string"===typeof a)&&1E7>=+Math.abs(a)||a instanceof d&&1>=a.value.length}function R(a,b,c){b=l(b);var d=a.isNegative(),e=b.isNegative(),
+m=d?a.not():a,g=e?b.not():b;b=[];a=[];for(var h=!1,k=!1;!h||!k;)m.isZero()?(h=!0,b.push(d?1:0)):d?b.push(m.isEven()?1:0):b.push(m.isEven()?0:1),g.isZero()?(k=!0,a.push(e?1:0)):e?a.push(g.isEven()?1:0):a.push(g.isEven()?0:1),m=m.over(2),g=g.over(2);d=[];for(e=0;e<b.length;e++)d.push(c(b[e],a[e]));for(c=bigInt(d.pop()).negate().times(bigInt(2).pow(d.length));d.length;)c=c.add(bigInt(d.pop()).times(bigInt(2).pow(d.length)));return c}function O(a){a=a.value;a="number"===typeof a?a|1073741824:a[0]+1E7*
+a[1]|1073758208;return a&-a}function Z(a,b){a=l(a);b=l(b);return a.greater(b)?a:b}function aa(a,b){a=l(a);b=l(b);return a.lesser(b)?a:b}function ba(a,b){a=l(a).abs();b=l(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;for(var c=k[1],d;a.isEven()&&b.isEven();)d=Math.min(O(a),O(b)),a=a.divide(d),b=b.divide(d),c=c.multiply(d);for(;a.isEven();)a=a.divide(O(a));do{for(;b.isEven();)b=b.divide(O(b));a.greater(b)&&(d=b,b=a,a=d);b=b.subtract(a)}while(!b.isZero());return c.isUnit()?
+a:a.multiply(c)}function ca(a){a=a.value;"number"===typeof a&&(a=[a]);return 1===a.length&&35>=a[0]?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(a[0]):"<"+a+">"}function da(a,b){b=bigInt(b);if(b.isZero()){if(a.isZero())return"0";throw Error("Cannot convert nonzero numbers to base 0.");}if(b.equals(-1))return a.isZero()?"0":a.isNegative()?Array(1-a).join("10"):"1"+Array(+a).join("01");var c="";a.isNegative()&&b.isPositive()&&(c="-",a=a.abs());if(b.equals(1))return a.isZero()?"0":c+Array(+a+1).join(1);
+for(var d=[],e=a,k;e.isNegative()||0<=e.compareAbs(b);)k=e.divmod(b),e=k.quotient,k=k.remainder,k.isNegative()&&(k=b.minus(k).abs(),e=e.next()),d.push(ca(k));d.push(ca(e));return c+d.reverse().join("")}function ea(a){if(w(+a)){var b=+a;if(b===B(b))return new e(b);throw"Invalid integer: "+a;}(b="-"===a[0])&&(a=a.slice(1));var c=a.split(/e/i);if(2<c.length)throw Error("Invalid integer: "+c.join("e"));if(2===c.length){a=c[1];"+"===a[0]&&(a=a.slice(1));a=+a;if(a!==B(a)||!w(a))throw Error("Invalid integer: "+
+a+" is not a valid exponent.");var c=c[0],n=c.indexOf(".");0<=n&&(a-=c.length-n-1,c=c.slice(0,n)+c.slice(n+1));if(0>a)throw Error("Cannot include negative exponent part for integers");a=c+=Array(a+1).join("0")}if(!/^([0-9][0-9]*)$/.test(a))throw Error("Invalid integer: "+a);for(var c=[],n=a.length,f=n-7;0<n;)c.push(+a.slice(f,n)),f-=7,0>f&&(f=0),n-=7;D(c);return new d(c,b)}function l(a){if("number"===typeof a){if(w(a)){if(a!==B(a))throw Error(a+" is not an integer.");a=new e(a)}else a=ea(a.toString());
+return a}return"string"===typeof a?ea(a):a}var P=z(9007199254740992),ga=Math.log(9007199254740992);d.prototype=Object.create(k.prototype);e.prototype=Object.create(k.prototype);d.prototype.add=function(a){a=l(a);if(this.sign!==a.sign)return this.subtract(a.negate());var b=this.value,c=a.value;return a.isSmall?new d(L(b,Math.abs(c)),this.sign):new d(F(b,c),this.sign)};d.prototype.plus=d.prototype.add;e.prototype.add=function(a){a=l(a);var b=this.value;if(0>b!==a.sign)return this.subtract(a.negate());
+var c=a.value;if(a.isSmall){if(w(b+c))return new e(b+c);c=z(Math.abs(c))}return new d(L(c,Math.abs(b)),0>b)};e.prototype.plus=e.prototype.add;d.prototype.subtract=function(a){var b=l(a);if(this.sign!==b.sign)return this.add(b.negate());a=this.value;var c=b.value;if(b.isSmall)return M(a,Math.abs(c),this.sign);b=this.sign;0<=A(a,c)?a=G(a,c):(a=G(c,a),b=!b);a=y(a);"number"===typeof a?(b&&(a=-a),a=new e(a)):a=new d(a,b);return a};d.prototype.minus=d.prototype.subtract;e.prototype.subtract=function(a){a=
+l(a);var b=this.value;if(0>b!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new e(b-c):M(c,Math.abs(b),0<=b)};e.prototype.minus=e.prototype.subtract;d.prototype.negate=function(){return new d(this.value,!this.sign)};e.prototype.negate=function(){var a=this.sign,b=new e(-this.value);b.sign=!a;return b};d.prototype.abs=function(){return new d(this.value,!1)};e.prototype.abs=function(){return new e(Math.abs(this.value))};d.prototype.multiply=function(a){var b=l(a);a=this.value;var c=
+b.value,e=this.sign!==b.sign;if(b.isSmall){if(0===c)return k[0];if(1===c)return this;if(-1===c)return this.negate();c=Math.abs(c);if(1E7>c)return new d(H(a,c),e);c=z(c)}var b=a.length,f=c.length;return 0<-.012*b-.012*f+1.5E-5*b*f?new d(N(a,c),e):new d(Q(a,c),e)};d.prototype.times=d.prototype.multiply;e.prototype._multiplyBySmall=function(a){return w(a.value*this.value)?new e(a.value*this.value):U(Math.abs(a.value),z(Math.abs(this.value)),this.sign!==a.sign)};d.prototype._multiplyBySmall=function(a){return 0===
+a.value?k[0]:1===a.value?this:-1===a.value?this.negate():U(Math.abs(a.value),this.value,this.sign!==a.sign)};e.prototype.multiply=function(a){return l(a)._multiplyBySmall(this)};e.prototype.times=e.prototype.multiply;d.prototype.square=function(){return new d(V(this.value),!1)};e.prototype.square=function(){var a=this.value*this.value;return w(a)?new e(a):new d(V(z(Math.abs(this.value))),!1)};d.prototype.divmod=function(a){a=I(this,a);return{quotient:a[0],remainder:a[1]}};e.prototype.divmod=d.prototype.divmod;
+d.prototype.divide=function(a){return I(this,a)[0]};e.prototype.over=e.prototype.divide=d.prototype.over=d.prototype.divide;d.prototype.mod=function(a){return I(this,a)[1]};e.prototype.remainder=e.prototype.mod=d.prototype.remainder=d.prototype.mod;d.prototype.pow=function(a){var b=l(a),c=this.value;a=b.value;var d;if(0===a)return k[1];if(0===c)return k[0];if(1===c)return k[1];if(-1===c)return b.isEven()?k[1]:k[-1];if(b.sign)return k[0];if(!b.isSmall)throw Error("The exponent "+b.toString()+" is too large.");
+if(this.isSmall&&w(d=Math.pow(c,a)))return new e(B(d));d=this;for(b=k[1];;){a&1&&(b=b.times(d),--a);if(0===a)break;a/=2;d=d.square()}return b};e.prototype.pow=d.prototype.pow;d.prototype.modPow=function(a,b){a=l(a);b=l(b);if(b.isZero())throw Error("Cannot take modPow with modulus 0");for(var c=k[1],d=this.mod(b);a.isPositive();){if(d.isZero())return k[0];a.isOdd()&&(c=c.multiply(d).mod(b));a=a.divide(2);d=d.square().mod(b)}return c};e.prototype.modPow=d.prototype.modPow;d.prototype.compareAbs=function(a){a=
+l(a);return a.isSmall?1:A(this.value,a.value)};e.prototype.compareAbs=function(a){a=l(a);var b=Math.abs(this.value),c=a.value;return a.isSmall?(c=Math.abs(c),b===c?0:b>c?1:-1):-1};d.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a);return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:A(this.value,a.value)*(this.sign?-1:1)};d.prototype.compareTo=d.prototype.compare;e.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a);
+var b=this.value,c=a.value;return a.isSmall?b==c?0:b>c?1:-1:0>b!==a.sign?0>b?-1:1:0>b?1:-1};e.prototype.compareTo=e.prototype.compare;d.prototype.equals=function(a){return 0===this.compare(a)};e.prototype.eq=e.prototype.equals=d.prototype.eq=d.prototype.equals;d.prototype.notEquals=function(a){return 0!==this.compare(a)};e.prototype.neq=e.prototype.notEquals=d.prototype.neq=d.prototype.notEquals;d.prototype.greater=function(a){return 0<this.compare(a)};e.prototype.gt=e.prototype.greater=d.prototype.gt=
+d.prototype.greater;d.prototype.lesser=function(a){return 0>this.compare(a)};e.prototype.lt=e.prototype.lesser=d.prototype.lt=d.prototype.lesser;d.prototype.greaterOrEquals=function(a){return 0<=this.compare(a)};e.prototype.geq=e.prototype.greaterOrEquals=d.prototype.geq=d.prototype.greaterOrEquals;d.prototype.lesserOrEquals=function(a){return 0>=this.compare(a)};e.prototype.leq=e.prototype.lesserOrEquals=d.prototype.leq=d.prototype.lesserOrEquals;d.prototype.isEven=function(){return 0===(this.value[0]&
+1)};e.prototype.isEven=function(){return 0===(this.value&1)};d.prototype.isOdd=function(){return 1===(this.value[0]&1)};e.prototype.isOdd=function(){return 1===(this.value&1)};d.prototype.isPositive=function(){return!this.sign};e.prototype.isPositive=function(){return 0<this.value};d.prototype.isNegative=function(){return this.sign};e.prototype.isNegative=function(){return 0>this.value};d.prototype.isUnit=function(){return!1};e.prototype.isUnit=function(){return 1===Math.abs(this.value)};d.prototype.isZero=
+function(){return!1};e.prototype.isZero=function(){return 0===this.value};d.prototype.isDivisibleBy=function(a){a=l(a);var b=a.value;return 0===b?!1:1===b?!0:2===b?this.isEven():this.mod(a).equals(k[0])};e.prototype.isDivisibleBy=d.prototype.isDivisibleBy;d.prototype.isPrime=function(){var a=X(this);if(a!==E)return a;for(var a=this.abs(),b=a.prev(),c=[2,3,5,7,11,13,17,19],d=b,e,l,g,h;d.isEven();)d=d.divide(2);for(g=0;g<c.length;g++)if(h=bigInt(c[g]).modPow(d,a),!h.equals(k[1])&&!h.equals(b)){l=!0;
+for(e=d;l&&e.lesser(b);e=e.multiply(2))h=h.square().mod(a),h.equals(b)&&(l=!1);if(l)return!1}return!0};e.prototype.isPrime=d.prototype.isPrime;d.prototype.isProbablePrime=function(a){var b=X(this);if(b!==E)return b;b=this.abs();a=a===E?5:a;for(var c=0;c<a;c++)if(!bigInt.randBetween(2,b.minus(2)).modPow(b.prev(),b).isUnit())return!1;return!0};e.prototype.isProbablePrime=d.prototype.isProbablePrime;d.prototype.next=function(){var a=this.value;return this.sign?M(a,1,this.sign):new d(L(a,1),this.sign)};
+e.prototype.next=function(){var a=this.value;return 9007199254740992>a+1?new e(a+1):new d(P,!1)};d.prototype.prev=function(){var a=this.value;return this.sign?new d(L(a,1),!0):M(a,1,this.sign)};e.prototype.prev=function(){var a=this.value;return-9007199254740992<a-1?new e(a-1):new d(P,!0)};for(var v=[1];1E7>=v[v.length-1];)v.push(2*v[v.length-1]);var J=v.length,fa=v[J-1];d.prototype.shiftLeft=function(a){if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftRight(-a);
+for(var b=this;a>=J;)b=b.multiply(fa),a-=J-1;return b.multiply(v[a])};e.prototype.shiftLeft=d.prototype.shiftLeft;d.prototype.shiftRight=function(a){var b;if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftLeft(-a);for(b=this;a>=J;){if(b.isZero())return b;b=I(b,fa);b=b[1].isNegative()?b[0].prev():b[0];a-=J-1}b=I(b,v[a]);return b[1].isNegative()?b[0].prev():b[0]};e.prototype.shiftRight=d.prototype.shiftRight;d.prototype.not=function(){return this.negate().prev()};
+e.prototype.not=d.prototype.not;d.prototype.and=function(a){return R(this,a,function(a,c){return a&c})};e.prototype.and=d.prototype.and;d.prototype.or=function(a){return R(this,a,function(a,c){return a|c})};e.prototype.or=d.prototype.or;d.prototype.xor=function(a){return R(this,a,function(a,c){return a^c})};e.prototype.xor=d.prototype.xor;d.prototype.toString=function(a){a===E&&(a=10);if(10!==a)return da(this,a);a=this.value;for(var b=a.length,c=String(a[--b]),d;0<=--b;)d=String(a[b]),c+="0000000".slice(d.length)+
+d;return(this.sign?"-":"")+c};e.prototype.toString=function(a){a===E&&(a=10);return 10!=a?da(this,a):String(this.value)};d.prototype.valueOf=function(){return+this.toString()};d.prototype.toJSNumber=d.prototype.valueOf;e.prototype.valueOf=function(){return this.value};e.prototype.toJSNumber=e.prototype.valueOf;for(var C=0;1E3>C;C++)k[C]=new e(C),0<C&&(k[-C]=new e(-C));k.one=k[1];k.zero=k[0];k.minusOne=k[-1];k.max=Z;k.min=aa;k.gcd=ba;k.lcm=function(a,b){a=l(a).abs();b=l(b).abs();return a.divide(ba(a,
+b)).multiply(b)};k.isInstance=function(a){return a instanceof d||a instanceof e};k.randBetween=function(a,b){a=l(a);b=l(b);var c=aa(a,b),k=Z(a,b).subtract(c);if(k.isSmall)return c.add(Math.round(Math.random()*k));for(var f=[],m=!0,g=k.value.length-1;0<=g;g--){var h=m?k.value[g]:1E7,q=B(Math.random()*h);f.unshift(q);q<h&&(m=!1)}f=y(f);return c.add("number"===typeof f?new e(f):new d(f,!1))};return k}();"undefined"!==typeof module&&module.hasOwnProperty("exports")&&(module.exports=bigInt);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/big-integer/LICENSE
----------------------------------------------------------------------
diff --git a/node_modules/big-integer/LICENSE b/node_modules/big-integer/LICENSE
new file mode 100644
index 0000000..cf1ab25
--- /dev/null
+++ b/node_modules/big-integer/LICENSE
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to <http://unlicense.org>
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/big-integer/package.json
----------------------------------------------------------------------
diff --git a/node_modules/big-integer/package.json b/node_modules/big-integer/package.json
index 86f35b6..0429247 100644
--- a/node_modules/big-integer/package.json
+++ b/node_modules/big-integer/package.json
@@ -2,18 +2,18 @@
"_args": [
[
"big-integer@^1.6.7",
- "/Users/omefire/Projects/cordova-ios/node_modules/bplist-parser"
+ "d:\\cordova\\cordova-ios\\node_modules\\bplist-parser"
]
],
"_from": "big-integer@>=1.6.7 <2.0.0",
- "_id": "big-integer@1.6.12",
+ "_id": "big-integer@1.6.15",
"_inCache": true,
"_installable": true,
"_location": "/big-integer",
"_nodeVersion": "0.12.3",
"_npmOperationalInternal": {
- "host": "packages-6-west.internal.npmjs.com",
- "tmp": "tmp/big-integer-1.6.12.tgz_1455702804335_0.11810904298909009"
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/big-integer-1.6.15.tgz_1460079231162_0.7087579960934818"
},
"_npmUser": {
"email": "peter.e.c.olson+npm@gmail.com",
@@ -32,11 +32,11 @@
"_requiredBy": [
"/bplist-parser"
],
- "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.12.tgz",
- "_shasum": "39afcddafcd5c4480864efb757337d508938bb26",
+ "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz",
+ "_shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e",
"_shrinkwrap": null,
"_spec": "big-integer@^1.6.7",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/bplist-parser",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\bplist-parser",
"author": {
"email": "peter.e.c.olson+npm@gmail.com",
"name": "Peter Olson"
@@ -59,13 +59,13 @@
},
"directories": {},
"dist": {
- "shasum": "39afcddafcd5c4480864efb757337d508938bb26",
- "tarball": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.12.tgz"
+ "shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e",
+ "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz"
},
"engines": {
"node": ">=0.6"
},
- "gitHead": "56f449108e31542f939e701f1fe562a46e6c1fab",
+ "gitHead": "cda5bcce74c3a4eb34951201d50c1b8776a56eca",
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
"keywords": [
"math",
@@ -96,5 +96,5 @@
"scripts": {
"test": "karma start my.conf.js"
},
- "version": "1.6.12"
+ "version": "1.6.15"
}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/bplist-parser/package.json
----------------------------------------------------------------------
diff --git a/node_modules/bplist-parser/package.json b/node_modules/bplist-parser/package.json
index 628fa16..f57f8ca 100644
--- a/node_modules/bplist-parser/package.json
+++ b/node_modules/bplist-parser/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"bplist-parser@^0.1.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "bplist-parser@>=0.1.0 <0.2.0",
@@ -32,7 +32,7 @@
"_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
"_shrinkwrap": null,
"_spec": "bplist-parser@^0.1.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "joe.ferner@nearinfinity.com",
"name": "Joe Ferner"
@@ -50,7 +50,7 @@
"directories": {},
"dist": {
"shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
- "tarball": "http://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz"
+ "tarball": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz"
},
"gitHead": "c4f22650de2cc95edd21a6e609ff0654a2b951bd",
"homepage": "https://github.com/nearinfinity/node-bplist-parser#readme",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/brace-expansion/package.json
----------------------------------------------------------------------
diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json
index da35625..3f935cc 100644
--- a/node_modules/brace-expansion/package.json
+++ b/node_modules/brace-expansion/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"brace-expansion@^1.0.0",
- "/Users/omefire/Projects/cordova-ios/node_modules/minimatch"
+ "d:\\cordova\\cordova-ios\\node_modules\\minimatch"
]
],
"_from": "brace-expansion@>=1.0.0 <2.0.0",
@@ -36,7 +36,7 @@
"_shasum": "46bff50115d47fc9ab89854abb87d98078a10991",
"_shrinkwrap": null,
"_spec": "brace-expansion@^1.0.0",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/minimatch",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\minimatch",
"author": {
"email": "mail@juliangruber.com",
"name": "Julian Gruber",
@@ -56,7 +56,7 @@
"directories": {},
"dist": {
"shasum": "46bff50115d47fc9ab89854abb87d98078a10991",
- "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz"
+ "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz"
},
"gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231",
"homepage": "https://github.com/juliangruber/brace-expansion",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/concat-map/package.json
----------------------------------------------------------------------
diff --git a/node_modules/concat-map/package.json b/node_modules/concat-map/package.json
index 590bcc9..16ebabf 100644
--- a/node_modules/concat-map/package.json
+++ b/node_modules/concat-map/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"concat-map@0.0.1",
- "/Users/omefire/Projects/cordova-ios/node_modules/brace-expansion"
+ "d:\\cordova\\cordova-ios\\node_modules\\brace-expansion"
]
],
"_from": "concat-map@0.0.1",
@@ -31,7 +31,7 @@
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
"_shrinkwrap": null,
"_spec": "concat-map@0.0.1",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/brace-expansion",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\brace-expansion",
"author": {
"email": "mail@substack.net",
"name": "James Halliday",
@@ -51,7 +51,7 @@
},
"dist": {
"shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
- "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
+ "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
},
"homepage": "https://github.com/substack/node-concat-map",
"keywords": [
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/RELEASENOTES.md b/node_modules/cordova-common/RELEASENOTES.md
index 806b6f2..350d5c9 100644
--- a/node_modules/cordova-common/RELEASENOTES.md
+++ b/node_modules/cordova-common/RELEASENOTES.md
@@ -20,6 +20,13 @@
-->
# Cordova-common Release Notes
+### 1.2.0 (Apr 18, 2016)
+* CB-11022 Save modulesMetadata to both www and platform_www when necessary
+* CB-10833 Deduplicate common logic for plugin installation/uninstallation
+* CB-10822 Manage plugins/modules metadata using PlatformJson
+* CB-10940 Can't add Android platform from path
+* CB-10965 xml helper allows multiple instances to be merge in config.xml
+
### 1.1.1 (Mar 18, 2016)
* CB-10694 Update test to reflect merging of CB-9264 fix
* CB-10694 Platform-specific configuration preferences don't override global settings
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/cordova-common.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/cordova-common.js b/node_modules/cordova-common/cordova-common.js
index 22e90a7..1f97b66 100644
--- a/node_modules/cordova-common/cordova-common.js
+++ b/node_modules/cordova-common/cordova-common.js
@@ -17,9 +17,6 @@
under the License.
*/
-/* jshint node:true */
-
-// For now expose plugman and cordova just as they were in the old repos
exports = module.exports = {
events: require('./src/events'),
superspawn: require('./src/superspawn'),
@@ -33,6 +30,8 @@ exports = module.exports = {
PluginInfo: require('./src/PluginInfo/PluginInfo.js'),
PluginInfoProvider: require('./src/PluginInfo/PluginInfoProvider.js'),
+
+ PluginManager: require('./src/PluginManager'),
ConfigChanges: require('./src/ConfigChanges/ConfigChanges.js'),
ConfigKeeper: require('./src/ConfigChanges/ConfigKeeper.js'),
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/package.json
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/package.json b/node_modules/cordova-common/package.json
index 164939c..73ef986 100644
--- a/node_modules/cordova-common/package.json
+++ b/node_modules/cordova-common/package.json
@@ -1,30 +1,50 @@
{
- "author": {
- "name": "Apache Software Foundation"
+ "_args": [
+ [
+ "cordova-common@1.2.0",
+ "d:\\cordova\\cordova-ios"
+ ]
+ ],
+ "_from": "cordova-common@1.2.0",
+ "_id": "cordova-common@1.2.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/cordova-common",
+ "_nodeVersion": "5.9.1",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/cordova-common-1.2.0.tgz_1461227352417_0.14771279646083713"
},
- "name": "cordova-common",
- "description": "Apache Cordova tools and platforms shared routines",
- "license": "Apache-2.0",
- "version": "1.1.1",
- "repository": {
- "type": "git",
- "url": "git://git-wip-us.apache.org/repos/asf/cordova-common.git"
+ "_npmUser": {
+ "email": "kotikov.vladimir@gmail.com",
+ "name": "kotikov.vladimir"
},
- "bugs": {
- "url": "https://issues.apache.org/jira/browse/CB",
- "email": "dev@cordova.apache.org"
+ "_npmVersion": "3.8.5",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "cordova-common",
+ "raw": "cordova-common@1.2.0",
+ "rawSpec": "1.2.0",
+ "scope": null,
+ "spec": "1.2.0",
+ "type": "version"
},
- "main": "cordova-common.js",
- "engines": {
- "node": ">=0.9.9"
+ "_requiredBy": [
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.2.0.tgz",
+ "_shasum": "474b7f77c6c89d3f995c947d96046edf2e8c404d",
+ "_shrinkwrap": null,
+ "_spec": "cordova-common@1.2.0",
+ "_where": "d:\\cordova\\cordova-ios",
+ "author": {
+ "name": "Apache Software Foundation"
},
- "scripts": {
- "test": "npm run jshint && npm run jasmine",
- "jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
- "jasmine": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
- "cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec"
+ "bugs": {
+ "email": "dev@cordova.apache.org",
+ "url": "https://issues.apache.org/jira/browse/CB"
},
- "engineStrict": true,
+ "contributors": [],
"dependencies": {
"ansi": "^0.3.1",
"bplist-parser": "^0.1.0",
@@ -35,60 +55,67 @@
"plist": "^1.2.0",
"q": "^1.4.1",
"semver": "^5.0.1",
- "shelljs": "^0.5.1",
+ "shelljs": "^0.5.3",
"underscore": "^1.8.3",
"unorm": "^1.3.3"
},
+ "description": "Apache Cordova tools and platforms shared routines",
"devDependencies": {
"istanbul": "^0.3.17",
"jasmine-node": "^1.14.5",
- "jshint": "^2.8.0"
- },
- "contributors": [],
- "_id": "cordova-common@1.1.1",
- "_shasum": "4f74e182fe706b7a0ad626b0b3d303910af21d25",
- "_resolved": "http://visustar.francelab.fr.ibm.com:8081/nexus/content/groups/mobile-npm-all/cordova-common/-/cordova-common-1.1.1.tgz",
- "_from": "cordova-common@>=1.1.0 <2.0.0",
- "_npmVersion": "3.5.3",
- "_nodeVersion": "5.4.1",
- "_npmUser": {
- "name": "stevegill",
- "email": "stevengill97@gmail.com"
+ "jshint": "^2.8.0",
+ "promise-matchers": "^0.9.6",
+ "rewire": "^2.5.1"
},
+ "directories": {},
"dist": {
- "shasum": "4f74e182fe706b7a0ad626b0b3d303910af21d25",
- "tarball": "http://visustar.francelab.fr.ibm.com:8081/nexus/content/groups/mobile-npm-all/cordova-common/-/cordova-common-1.1.1.tgz"
+ "shasum": "474b7f77c6c89d3f995c947d96046edf2e8c404d",
+ "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.2.0.tgz"
},
+ "engineStrict": true,
+ "engines": {
+ "node": ">=0.9.9"
+ },
+ "license": "Apache-2.0",
+ "main": "cordova-common.js",
"maintainers": [
{
- "name": "bowserj",
- "email": "bowserj@apache.org"
+ "email": "bowserj@apache.org",
+ "name": "bowserj"
},
{
- "name": "kotikov.vladimir",
- "email": "kotikov.vladimir@gmail.com"
+ "email": "kotikov.vladimir@gmail.com",
+ "name": "kotikov.vladimir"
},
{
- "name": "purplecabbage",
- "email": "purplecabbage@gmail.com"
+ "email": "purplecabbage@gmail.com",
+ "name": "purplecabbage"
},
{
- "name": "shazron",
- "email": "shazron@gmail.com"
+ "email": "shazron@gmail.com",
+ "name": "shazron"
},
{
- "name": "stevegill",
- "email": "stevengill97@gmail.com"
+ "email": "stevengill97@gmail.com",
+ "name": "stevegill"
},
{
- "name": "timbarham",
- "email": "npmjs@barhams.info"
+ "email": "npmjs@barhams.info",
+ "name": "timbarham"
}
],
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/cordova-common-1.1.1.tgz_1458760117765_0.2676008273847401"
+ "name": "cordova-common",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://git-wip-us.apache.org/repos/asf/cordova-common.git"
},
- "directories": {},
- "readme": "ERROR: No README data found!"
+ "scripts": {
+ "cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec",
+ "jasmine": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
+ "jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
+ "test": "npm run jshint && npm run jasmine"
+ },
+ "version": "1.2.0"
}
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/src/PlatformJson.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/src/PlatformJson.js b/node_modules/cordova-common/src/PlatformJson.js
index 793e976..4e2b287 100644
--- a/node_modules/cordova-common/src/PlatformJson.js
+++ b/node_modules/cordova-common/src/PlatformJson.js
@@ -91,6 +91,38 @@ PlatformJson.prototype.addPlugin = function(pluginId, variables, isTopLevel) {
return this;
};
+/**
+ * @chaining
+ * Generates and adds metadata for provided plugin into associated <platform>.json file
+ *
+ * @param {PluginInfo} pluginInfo A pluginInfo instance to add metadata from
+ * @returns {this} Current PlatformJson instance to allow calls chaining
+ */
+PlatformJson.prototype.addPluginMetadata = function (pluginInfo) {
+
+ var installedModules = this.root.modules || [];
+
+ var installedPaths = installedModules.map(function (installedModule) {
+ return installedModule.file;
+ });
+
+ var modulesToInstall = pluginInfo.getJsModules(this.platform)
+ .map(function (module) {
+ return new ModuleMetadata(pluginInfo.id, module);
+ })
+ .filter(function (metadata) {
+ // Filter out modules which are already added to metadata
+ return installedPaths.indexOf(metadata.file) === -1;
+ });
+
+ this.root.modules = installedModules.concat(modulesToInstall);
+
+ this.root.plugin_metadata = this.root.plugin_metadata || {};
+ this.root.plugin_metadata[pluginInfo.id] = pluginInfo.version;
+
+ return this;
+};
+
PlatformJson.prototype.removePlugin = function(pluginId, isTopLevel) {
var pluginsList = isTopLevel ?
this.root.installed_plugins :
@@ -101,6 +133,35 @@ PlatformJson.prototype.removePlugin = function(pluginId, isTopLevel) {
return this;
};
+/**
+ * @chaining
+ * Removes metadata for provided plugin from associated file
+ *
+ * @param {PluginInfo} pluginInfo A PluginInfo instance to which modules' metadata
+ * we need to remove
+ *
+ * @returns {this} Current PlatformJson instance to allow calls chaining
+ */
+PlatformJson.prototype.removePluginMetadata = function (pluginInfo) {
+ var modulesToRemove = pluginInfo.getJsModules(this.platform)
+ .map(function (jsModule) {
+ return ['plugins', pluginInfo.id, jsModule.src].join('/');
+ });
+
+ var installedModules = this.root.modules || [];
+ this.root.modules = installedModules
+ .filter(function (installedModule) {
+ // Leave only those metadatas which 'file' is not in removed modules
+ return (modulesToRemove.indexOf(installedModule.file) === -1);
+ });
+
+ if (this.root.plugin_metadata) {
+ delete this.root.plugin_metadata[pluginInfo.id];
+ }
+
+ return this;
+};
+
PlatformJson.prototype.addInstalledPluginToPrepareQueue = function(pluginDirName, vars, is_top_level) {
this.root.prepare_queue.installed.push({'plugin':pluginDirName, 'vars':vars, 'topLevel':is_top_level});
};
@@ -125,6 +186,39 @@ PlatformJson.prototype.makeTopLevel = function(pluginId) {
return this;
};
+/**
+ * Generates a metadata for all installed plugins and js modules. The resultant
+ * string is ready to be written to 'cordova_plugins.js'
+ *
+ * @returns {String} cordova_plugins.js contents
+ */
+PlatformJson.prototype.generateMetadata = function () {
+ return [
+ 'cordova.define(\'cordova/plugin_list\', function(require, exports, module) {',
+ 'module.exports = ' + JSON.stringify(this.root.modules, null, 4) + ';',
+ 'module.exports.metadata = ',
+ '// TOP OF METADATA',
+ JSON.stringify(this.root.plugin_metadata, null, 4) + ';',
+ '// BOTTOM OF METADATA',
+ '});' // Close cordova.define.
+ ].join('\n');
+};
+
+/**
+ * @chaining
+ * Generates and then saves metadata to specified file. Doesn't check if file exists.
+ *
+ * @param {String} destination File metadata will be written to
+ * @return {PlatformJson} PlatformJson instance
+ */
+PlatformJson.prototype.generateAndSaveMetadata = function (destination) {
+ var meta = this.generateMetadata();
+ shelljs.mkdir('-p', path.dirname(destination));
+ fs.writeFileSync(destination, meta, 'utf-8');
+
+ return this;
+};
+
// convert a munge from the old format ([file][parent][xml] = count) to the current one
function fix_munge(root) {
root.prepare_queue = root.prepare_queue || {installed:[], uninstalled:[]};
@@ -151,5 +245,35 @@ function fix_munge(root) {
return root;
}
+/**
+ * @constructor
+ * @class ModuleMetadata
+ *
+ * Creates a ModuleMetadata object that represents module entry in 'cordova_plugins.js'
+ * file at run time
+ *
+ * @param {String} pluginId Plugin id where this module installed from
+ * @param (JsModule|Object) jsModule A js-module entry from PluginInfo class to generate metadata for
+ */
+function ModuleMetadata (pluginId, jsModule) {
+
+ if (!pluginId) throw new TypeError('pluginId argument must be a valid plugin id');
+ if (!jsModule.src && !jsModule.name) throw new TypeError('jsModule argument must contain src or/and name properties');
+
+ this.id = pluginId + '.' + ( jsModule.name || jsModule.src.match(/([^\/]+)\.js/)[1] );
+ this.file = ['plugins', pluginId, jsModule.src].join('/');
+ this.pluginId = pluginId;
+
+ if (jsModule.clobbers && jsModule.clobbers.length > 0) {
+ this.clobbers = jsModule.clobbers.map(function(o) { return o.target; });
+ }
+ if (jsModule.merges && jsModule.merges.length > 0) {
+ this.merges = jsModule.merges.map(function(o) { return o.target; });
+ }
+ if (jsModule.runs) {
+ this.runs = true;
+ }
+}
+
module.exports = PlatformJson;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/src/PluginManager.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/src/PluginManager.js b/node_modules/cordova-common/src/PluginManager.js
new file mode 100644
index 0000000..c3a29fc
--- /dev/null
+++ b/node_modules/cordova-common/src/PluginManager.js
@@ -0,0 +1,152 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var Q = require('q');
+var fs = require('fs');
+var path = require('path');
+
+var ActionStack = require('./ActionStack');
+var PlatformJson = require('./PlatformJson');
+var CordovaError = require('./CordovaError/CordovaError');
+var PlatformMunger = require('./ConfigChanges/ConfigChanges').PlatformMunger;
+var PluginInfoProvider = require('./PluginInfo/PluginInfoProvider');
+
+/**
+ * @constructor
+ * @class PluginManager
+ * Represents an entity for adding/removing plugins for platforms
+ *
+ * @param {String} platform Platform name
+ * @param {Object} locations - Platform files and directories
+ * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from
+ */
+function PluginManager(platform, locations, ideProject) {
+ this.platform = platform;
+ this.locations = locations;
+ this.project = ideProject;
+
+ var platformJson = PlatformJson.load(locations.root, platform);
+ this.munger = new PlatformMunger(platform, locations.root, platformJson, new PluginInfoProvider());
+}
+
+
+/**
+ * @constructs PluginManager
+ * A convenience shortcut to new PluginManager(...)
+ *
+ * @param {String} platform Platform name
+ * @param {Object} locations - Platform files and directories
+ * @param {IDEProject} ideProject The IDE project to add/remove plugin changes to/from
+ * @returns new PluginManager instance
+ */
+PluginManager.get = function(platform, locations, ideProject) {
+ return new PluginManager(platform, locations, ideProject);
+};
+
+PluginManager.INSTALL = 'install';
+PluginManager.UNINSTALL = 'uninstall';
+
+module.exports = PluginManager;
+
+/**
+ * Describes and implements common plugin installation/uninstallation routine. The flow is the following:
+ * * Validate and set defaults for options. Note that options are empty by default. Everything
+ * needed for platform IDE project must be passed from outside. Plugin variables (which
+ * are the part of the options) also must be already populated with 'PACKAGE_NAME' variable.
+ * * Collect all plugin's native and web files, get installers/uninstallers and process
+ * all these via ActionStack.
+ * * Save the IDE project, so the changes made by installers are persisted.
+ * * Generate config changes munge for plugin and apply it to all required files
+ * * Generate metadata for plugin and plugin modules and save it to 'cordova_plugins.js'
+ *
+ * @param {PluginInfo} plugin A PluginInfo structure representing plugin to install
+ * @param {Object} [options={}] An installation options. It is expected but is not necessary
+ * that options would contain 'variables' inner object with 'PACKAGE_NAME' field set by caller.
+ *
+ * @returns {Promise} Returns a Q promise, either resolved in case of success, rejected otherwise.
+ */
+PluginManager.prototype.doOperation = function (operation, plugin, options) {
+ if (operation !== PluginManager.INSTALL && operation !== PluginManager.UNINSTALL)
+ return Q.reject(new CordovaError('The parameter is incorrect. The opeation must be either "add" or "remove"'));
+
+ if (!plugin || plugin.constructor.name !== 'PluginInfo')
+ return Q.reject(new CordovaError('The parameter is incorrect. The first parameter should be a PluginInfo instance'));
+
+ // Set default to empty object to play safe when accesing properties
+ options = options || {};
+
+ var self = this;
+ var actions = new ActionStack();
+
+ // gather all files need to be handled during operation ...
+ plugin.getFilesAndFrameworks(this.platform)
+ .concat(plugin.getAssets(this.platform))
+ .concat(plugin.getJsModules(this.platform))
+ // ... put them into stack ...
+ .forEach(function(item) {
+ var installer = self.project.getInstaller(item.itemType);
+ var uninstaller = self.project.getUninstaller(item.itemType);
+ var actionArgs = [item, plugin, self.project, options];
+
+ var action;
+ if (operation === PluginManager.INSTALL) {
+ action = actions.createAction.apply(actions, [installer, actionArgs, uninstaller, actionArgs]);
+ } else /* op === PluginManager.UNINSTALL */{
+ action = actions.createAction.apply(actions, [uninstaller, actionArgs, installer, actionArgs]);
+ }
+ actions.push(action);
+ });
+
+ // ... and run through the action stack
+ return actions.process(this.platform)
+ .then(function () {
+ if (self.project.write) {
+ self.project.write();
+ }
+
+ if (operation === PluginManager.INSTALL) {
+ // Ignore passed `is_top_level` option since platform itself doesn't know
+ // anything about managing dependencies - it's responsibility of caller.
+ self.munger.add_plugin_changes(plugin, options.variables, /*is_top_level=*/true, /*should_increment=*/true);
+ self.munger.platformJson.addPluginMetadata(plugin);
+ } else {
+ self.munger.remove_plugin_changes(plugin, /*is_top_level=*/true);
+ self.munger.platformJson.removePluginMetadata(plugin);
+ }
+
+ // Save everything (munge and plugin/modules metadata)
+ self.munger.save_all();
+
+ var metadata = self.munger.platformJson.generateMetadata();
+ fs.writeFileSync(path.join(self.locations.www, 'cordova_plugins.js'), metadata, 'utf-8');
+
+ // CB-11022 save plugin metadata to both www and platform_www if options.usePlatformWww is specified
+ if (options.usePlatformWww) {
+ fs.writeFileSync(path.join(self.locations.platformWww, 'cordova_plugins.js'), metadata, 'utf-8');
+ }
+ });
+};
+
+PluginManager.prototype.addPlugin = function (plugin, installOptions) {
+ return this.doOperation(PluginManager.INSTALL, plugin, installOptions);
+};
+
+PluginManager.prototype.removePlugin = function (plugin, uninstallOptions) {
+ return this.doOperation(PluginManager.UNINSTALL, plugin, uninstallOptions);
+};
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/src/events.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/src/events.js b/node_modules/cordova-common/src/events.js
index 868d363..8751976 100644
--- a/node_modules/cordova-common/src/events.js
+++ b/node_modules/cordova-common/src/events.js
@@ -42,7 +42,14 @@ module.exports.forwardEventsTo = function (eventEmitter) {
if (!(eventEmitter instanceof EventEmitter))
throw new Error('Cordova events could be redirected to another EventEmitter instance only');
- EVENTS_RECEIVER = eventEmitter;
+ // CB-10940 Skipping forwarding to self to avoid infinite recursion.
+ // This is the case when the modules are npm-linked.
+ if (this !== eventEmitter) {
+ EVENTS_RECEIVER = eventEmitter;
+ } else {
+ // Reset forwarding if we are subscribing to self
+ EVENTS_RECEIVER = undefined;
+ }
};
var emit = INSTANCE.emit;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-common/src/util/xml-helpers.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-common/src/util/xml-helpers.js b/node_modules/cordova-common/src/util/xml-helpers.js
index fc84128..6366af9 100644
--- a/node_modules/cordova-common/src/util/xml-helpers.js
+++ b/node_modules/cordova-common/src/util/xml-helpers.js
@@ -194,7 +194,7 @@ function findInsertIdx(children, after) {
}
var BLACKLIST = ['platform', 'feature','plugin','engine'];
-var SINGLETONS = ['content', 'author'];
+var SINGLETONS = ['content', 'author', 'name'];
function mergeXml(src, dest, platform, clobber) {
// Do nothing for blacklisted tags.
if (BLACKLIST.indexOf(src.tag) != -1) return;
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/cordova-registry-mapper/package.json
----------------------------------------------------------------------
diff --git a/node_modules/cordova-registry-mapper/package.json b/node_modules/cordova-registry-mapper/package.json
index 684bab0..e490576 100644
--- a/node_modules/cordova-registry-mapper/package.json
+++ b/node_modules/cordova-registry-mapper/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"cordova-registry-mapper@^1.1.8",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "cordova-registry-mapper@>=1.1.8 <2.0.0",
@@ -32,7 +32,7 @@
"_shasum": "e244b9185b8175473bff6079324905115f83dc7c",
"_shrinkwrap": null,
"_spec": "cordova-registry-mapper@^1.1.8",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"name": "Steve Gill"
},
@@ -47,7 +47,7 @@
"directories": {},
"dist": {
"shasum": "e244b9185b8175473bff6079324905115f83dc7c",
- "tarball": "http://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz"
+ "tarball": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz"
},
"gitHead": "00af0f028ec94154a364eeabe38b8e22320647bd",
"homepage": "https://github.com/stevengill/cordova-registry-mapper#readme",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/elementtree/package.json
----------------------------------------------------------------------
diff --git a/node_modules/elementtree/package.json b/node_modules/elementtree/package.json
index 224a23a..ae0e9b4 100644
--- a/node_modules/elementtree/package.json
+++ b/node_modules/elementtree/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"elementtree@^0.1.6",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "elementtree@>=0.1.6 <0.2.0",
@@ -31,7 +31,7 @@
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"_shrinkwrap": null,
"_spec": "elementtree@^0.1.6",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"name": "Rackspace US, Inc."
},
@@ -60,7 +60,7 @@
},
"dist": {
"shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
- "tarball": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz"
+ "tarball": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz"
},
"engines": {
"node": ">= 0.4.0"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/glob/package.json
----------------------------------------------------------------------
diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json
index 5d4894c..5618bbf 100644
--- a/node_modules/glob/package.json
+++ b/node_modules/glob/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"glob@^5.0.13",
- "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common"
+ "d:\\cordova\\cordova-ios\\node_modules\\cordova-common"
]
],
"_from": "glob@>=5.0.13 <6.0.0",
@@ -32,7 +32,7 @@
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
"_shrinkwrap": null,
"_spec": "glob@^5.0.13",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/cordova-common",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\cordova-common",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -58,7 +58,7 @@
"directories": {},
"dist": {
"shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
- "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz"
+ "tarball": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz"
},
"engines": {
"node": "*"
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/inflight/package.json
----------------------------------------------------------------------
diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json
index a62b4e3..2441358 100644
--- a/node_modules/inflight/package.json
+++ b/node_modules/inflight/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"inflight@^1.0.4",
- "/Users/omefire/Projects/cordova-ios/node_modules/glob"
+ "d:\\cordova\\cordova-ios\\node_modules\\glob"
]
],
"_from": "inflight@>=1.0.4 <2.0.0",
@@ -32,7 +32,7 @@
"_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
"_shrinkwrap": null,
"_spec": "inflight@^1.0.4",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/glob",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\glob",
"author": {
"email": "i@izs.me",
"name": "Isaac Z. Schlueter",
@@ -52,7 +52,7 @@
"directories": {},
"dist": {
"shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
- "tarball": "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"
+ "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"
},
"gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba",
"homepage": "https://github.com/isaacs/inflight",
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/77c848ad/node_modules/inherits/package.json
----------------------------------------------------------------------
diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json
index d380a89..2945f1e 100644
--- a/node_modules/inherits/package.json
+++ b/node_modules/inherits/package.json
@@ -2,7 +2,7 @@
"_args": [
[
"inherits@2",
- "/Users/omefire/Projects/cordova-ios/node_modules/glob"
+ "d:\\cordova\\cordova-ios\\node_modules\\glob"
]
],
"_from": "inherits@>=2.0.0 <3.0.0",
@@ -31,7 +31,7 @@
"_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
"_shrinkwrap": null,
"_spec": "inherits@2",
- "_where": "/Users/omefire/Projects/cordova-ios/node_modules/glob",
+ "_where": "d:\\cordova\\cordova-ios\\node_modules\\glob",
"browser": "./inherits_browser.js",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
@@ -42,7 +42,7 @@
"directories": {},
"dist": {
"shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
- "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
+ "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"homepage": "https://github.com/isaacs/inherits#readme",
"keywords": [
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org