mirror of
https://github.com/apache/cordova-android.git
synced 2026-01-30 00:05:28 +08:00
Compare commits
67 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35dfdece12 | ||
|
|
cbed234069 | ||
|
|
81b2bccd97 | ||
|
|
89a00c02a4 | ||
|
|
40d3cdc0d6 | ||
|
|
8416c4e5e9 | ||
|
|
97ce7dd417 | ||
|
|
b32b8c89c6 | ||
|
|
fd1d3006c0 | ||
|
|
22918152cc | ||
|
|
1fcee242dc | ||
|
|
3f99c15338 | ||
|
|
f496f015b6 | ||
|
|
5e7e9d5b6c | ||
|
|
8bd4ca49a8 | ||
|
|
d33f7e08a8 | ||
|
|
d46ad592b5 | ||
|
|
eda765453b | ||
|
|
b295fc6687 | ||
|
|
0959608ab9 | ||
|
|
6db94dbb9a | ||
|
|
04a3c9d9ee | ||
|
|
db4d1f5768 | ||
|
|
81d6219663 | ||
|
|
3a1b4ffcb8 | ||
|
|
d6fe1a65eb | ||
|
|
72bbe9fdf0 | ||
|
|
d125ece9e9 | ||
|
|
ecb99c963d | ||
|
|
9738079c42 | ||
|
|
e9e27ca47c | ||
|
|
5d21fb26e6 | ||
|
|
d351e316bf | ||
|
|
dc6384d063 | ||
|
|
914e2fa35f | ||
|
|
8b96081579 | ||
|
|
f3e0623d1d | ||
|
|
abcaee24f9 | ||
|
|
8951660393 | ||
|
|
e4ecbad3cb | ||
|
|
40a740b45c | ||
|
|
9af7f506f0 | ||
|
|
9b8558dbde | ||
|
|
d28ca67edb | ||
|
|
0deaba0920 | ||
|
|
bcb10ba6da | ||
|
|
ef268e2320 | ||
|
|
d9814c5542 | ||
|
|
dd3b9dd01c | ||
|
|
1b43bc99a1 | ||
|
|
eccde6c0c0 | ||
|
|
69a2a5b551 | ||
|
|
bc9e895e25 | ||
|
|
457c5b8b3b | ||
|
|
9f1aedb56d | ||
|
|
a048aa94ec | ||
|
|
27d359bd43 | ||
|
|
456b4801af | ||
|
|
82582e5a5b | ||
|
|
18e81c4b90 | ||
|
|
bad0034e5d | ||
|
|
99d5ff7347 | ||
|
|
dc579417fe | ||
|
|
fe906dabda | ||
|
|
8ab75e7109 | ||
|
|
aa2b3d3da1 | ||
|
|
0a1b71f125 |
87
.gitignore
vendored
87
.gitignore
vendored
@@ -35,6 +35,7 @@ Desktop.ini
|
||||
*.swp
|
||||
*.class
|
||||
*.jar
|
||||
!/spec/fixtures/org.test.plugins.dummyplugin/src/android/TestLib.jar
|
||||
# IntelliJ IDEA files
|
||||
*.iml
|
||||
.idea
|
||||
@@ -43,3 +44,89 @@ npm-debug.log
|
||||
node_modules/jshint
|
||||
node_modules/promise-matchers
|
||||
node_modules/jasmine-node
|
||||
node_modules/rewire
|
||||
node_modules/istanbul
|
||||
node_modules/.bin/cake
|
||||
node_modules/.bin/coffee
|
||||
node_modules/.bin/escodegen
|
||||
node_modules/.bin/esgenerate
|
||||
node_modules/.bin/esparse
|
||||
node_modules/.bin/esvalidate
|
||||
node_modules/.bin/handlebars
|
||||
node_modules/.bin/istanbul
|
||||
node_modules/.bin/jasmine-node
|
||||
node_modules/.bin/js-yaml
|
||||
node_modules/.bin/jshint
|
||||
node_modules/.bin/mkdirp
|
||||
node_modules/.bin/r.js
|
||||
node_modules/.bin/r_js
|
||||
node_modules/.bin/strip-json-comments
|
||||
node_modules/.bin/uglifyjs
|
||||
node_modules/.bin/which
|
||||
node_modules/align-text/
|
||||
node_modules/amdefine/
|
||||
node_modules/argparse/
|
||||
node_modules/async/
|
||||
node_modules/camelcase/
|
||||
node_modules/center-align/
|
||||
node_modules/cli/
|
||||
node_modules/cliui/
|
||||
node_modules/coffee-script/
|
||||
node_modules/console-browserify/
|
||||
node_modules/core-util-is/
|
||||
node_modules/date-now/
|
||||
node_modules/decamelize/
|
||||
node_modules/deep-is/
|
||||
node_modules/dom-serializer/
|
||||
node_modules/domelementtype/
|
||||
node_modules/domhandler/
|
||||
node_modules/domutils/
|
||||
node_modules/entities/
|
||||
node_modules/escodegen/
|
||||
node_modules/esprima/
|
||||
node_modules/estraverse/
|
||||
node_modules/esutils/
|
||||
node_modules/exit/
|
||||
node_modules/fast-levenshtein/
|
||||
node_modules/fileset/
|
||||
node_modules/gaze/
|
||||
node_modules/growl/
|
||||
node_modules/handlebars/
|
||||
node_modules/has-flag/
|
||||
node_modules/htmlparser2/
|
||||
node_modules/is-buffer/
|
||||
node_modules/isarray/
|
||||
node_modules/isexe/
|
||||
node_modules/jasmine-growl-reporter/
|
||||
node_modules/jasmine-reporters/
|
||||
node_modules/js-yaml/
|
||||
node_modules/kind-of/
|
||||
node_modules/lazy-cache/
|
||||
node_modules/levn/
|
||||
node_modules/longest/
|
||||
node_modules/lru-cache/
|
||||
node_modules/minimist/
|
||||
node_modules/mkdirp/
|
||||
node_modules/optimist/
|
||||
node_modules/optionator/
|
||||
node_modules/prelude-ls/
|
||||
node_modules/readable-stream/
|
||||
node_modules/repeat-string/
|
||||
node_modules/requirejs/
|
||||
node_modules/resolve/
|
||||
node_modules/right-align/
|
||||
node_modules/sigmund/
|
||||
node_modules/source-map/
|
||||
node_modules/sprintf-js/
|
||||
node_modules/string_decoder/
|
||||
node_modules/strip-json-comments/
|
||||
node_modules/supports-color/
|
||||
node_modules/type-check/
|
||||
node_modules/uglify-js/
|
||||
node_modules/uglify-to-browserify/
|
||||
node_modules/walkdir/
|
||||
node_modules/which/
|
||||
node_modules/window-size/
|
||||
node_modules/wordwrap/
|
||||
node_modules/yargs/
|
||||
/coverage
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
bin/node_modules/*
|
||||
bin/templates/project/*
|
||||
spec/fixtures/*
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
bin
|
||||
gen
|
||||
proguard-project.txt
|
||||
spec
|
||||
appveyor.yml
|
||||
|
||||
@@ -2,7 +2,11 @@ language: android
|
||||
sudo: false
|
||||
install:
|
||||
- npm install
|
||||
- npm install -g codecov
|
||||
- echo y | android update sdk -u --filter android-22,android-23
|
||||
script:
|
||||
- npm test
|
||||
- npm run jshint
|
||||
- npm run cover
|
||||
- npm run test-build
|
||||
after_script:
|
||||
- codecov
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
# under the License.
|
||||
#
|
||||
-->
|
||||
|
||||
[](https://ci.appveyor.com/project/Humbedooh/cordova-android)
|
||||
[](https://travis-ci.org/apache/cordova-android)
|
||||
[](https://codecov.io/github/apache/cordova-android?branch=master)
|
||||
|
||||
# Cordova Android
|
||||
|
||||
Cordova Android is an Android application library that allows for Cordova-based
|
||||
@@ -26,6 +31,8 @@ at the core, applications written with web technology: HTML, CSS and JavaScript.
|
||||
|
||||
[Apache Cordova](https://cordova.apache.org) is a project of The Apache Software Foundation (ASF).
|
||||
|
||||
:warning: Report issues on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Android%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
|
||||
|
||||
|
||||
## Requires
|
||||
|
||||
@@ -55,4 +62,3 @@ These commands live in a generated Cordova Android project. Any interactions wit
|
||||
|
||||
1. Create a project
|
||||
2. Import it via "Non-Android Studio Project"
|
||||
|
||||
|
||||
521
RELEASENOTES.md
521
RELEASENOTES.md
@@ -20,129 +20,168 @@
|
||||
-->
|
||||
## Release Notes for Cordova (Android) ##
|
||||
|
||||
### 5.2.1 (Jul 11, 2016)
|
||||
* [CB-9489](https://issues.apache.org/jira/browse/CB-9489) Fixed "endless waiting for emulator" issue
|
||||
* [CB-11481](https://issues.apache.org/jira/browse/CB-11481) android-library is deprecated use com.android.library instead
|
||||
|
||||
### 5.2.0 (Jun 29, 2016)
|
||||
* [CB-11383](https://issues.apache.org/jira/browse/CB-11383) Update to gradle for using `jcenter` and correct Application plugin
|
||||
* [CB-11365](https://issues.apache.org/jira/browse/CB-11365) fixed plugin rm issue with emit being `undefined`
|
||||
* [CB-11117](https://issues.apache.org/jira/browse/CB-11117) Use `FileUpdater` to optimize prepare for **android** platform
|
||||
* [CB-10096](https://issues.apache.org/jira/browse/CB-10096) Upgrade test project to `Gradle Plugin 2.1.0`
|
||||
* [CB-11292](https://issues.apache.org/jira/browse/CB-11292) fix broken `MessageChannel` after plugins are recreated
|
||||
* [CB-11259](https://issues.apache.org/jira/browse/CB-11259) Improving build output
|
||||
* [CB-10096](https://issues.apache.org/jira/browse/CB-10096) Upgrading to `Gradle Plugin 2.1.0`
|
||||
* [CB-11198](https://issues.apache.org/jira/browse/CB-11198) Skip **android** target sdk check. This closes #303.
|
||||
* [CB-11138](https://issues.apache.org/jira/browse/CB-11138) Reuse `PluginManager` from `common` to add/rm plugins
|
||||
* [CB-11133](https://issues.apache.org/jira/browse/CB-11133) Handle **android** emulator start failure
|
||||
* [CB-11132](https://issues.apache.org/jira/browse/CB-11132) Fix Error: Cannot read property `match` of undefined in `cordova-android` `emulator.js`
|
||||
* Add simple log for package name being deployed
|
||||
* [CB-11015](https://issues.apache.org/jira/browse/CB-11015) Error adding plugin with gradle extras
|
||||
* [CB-11095](https://issues.apache.org/jira/browse/CB-11095) Fix plugin add/removal when running on `Node v.010`
|
||||
* [CB-11022](https://issues.apache.org/jira/browse/CB-11022) Duplicate www files to both destinations on plugin operations
|
||||
* [CB-10964](https://issues.apache.org/jira/browse/CB-10964) Handle `build.json` file starting with a BOM.
|
||||
* [CB-10963](https://issues.apache.org/jira/browse/CB-10963) Handle overlapping permission requests from plugins
|
||||
* [CB-8582](https://issues.apache.org/jira/browse/CB-8582) Obscure `INSTALL_FAILED_VERSION_DOWNGRADE` error when installing app
|
||||
* [CB-10862](https://issues.apache.org/jira/browse/CB-10862) Cannot set `minsdkversion`
|
||||
* [CB-10896](https://issues.apache.org/jira/browse/CB-10896) We never enabled cookies on the `WebView` proper
|
||||
* [CB-10837](https://issues.apache.org/jira/browse/CB-10837) Support platform-specific orientation on **Android**
|
||||
* [CB-10600](https://issues.apache.org/jira/browse/CB-10600) `cordova run android --release` does not use signed and zip-aligned version of `APK`
|
||||
* [CB-9710](https://issues.apache.org/jira/browse/CB-9710) Fixing issues parsing `android avd list` output for certain AVDs which resulted in them not being included in the selection process even if they are the best match.
|
||||
* [CB-10888](https://issues.apache.org/jira/browse/CB-10888) Enable coverage reports collection via codecov
|
||||
* [CB-10846](https://issues.apache.org/jira/browse/CB-10846) Add Travis and AppVeyor badges to readme
|
||||
* [CB-10846](https://issues.apache.org/jira/browse/CB-10846) Add AppVeyor configuration
|
||||
* [CB-10749](https://issues.apache.org/jira/browse/CB-10749) Use `cordova-common.CordovaLogger` in `cordova-android`
|
||||
* [CB-10673](https://issues.apache.org/jira/browse/CB-10673) fixed conflicting plugin install issue with overlapped `<source-file>` tag. Add `--force` flag.
|
||||
* [CB-8976](https://issues.apache.org/jira/browse/CB-8976) Removing the auto-version for non-Crosswalk applications
|
||||
* [CB-10768](https://issues.apache.org/jira/browse/CB-10768) Use `cordova-common.superspawn` in `GradleBuilder`
|
||||
* [CB-10729](https://issues.apache.org/jira/browse/CB-10729) Move plugin handlers tests for into platform's repo
|
||||
* [CB-10669](https://issues.apache.org/jira/browse/CB-10669) `cordova run --list` cannot find `adb`
|
||||
* [CB-10660](https://issues.apache.org/jira/browse/CB-10660) fixed the exception when removing a non-existing directory.
|
||||
|
||||
### 5.1.1 (Feb 24, 2016)
|
||||
* updated `cordova-common` dependnecy to `1.1.0`
|
||||
* CB-10628 Fix `emulate android --target`
|
||||
* CB-10618 Handle gradle frameworks on plugin installation/uninstallation
|
||||
* CB-10510: Add an optional timeout to `emu` start script
|
||||
* CB-10498: Resume event should be sticky if it has a plugin result
|
||||
* [CB-10628](https://issues.apache.org/jira/browse/CB-10628) Fix `emulate android --target`
|
||||
* [CB-10618](https://issues.apache.org/jira/browse/CB-10618) Handle gradle frameworks on plugin installation/uninstallation
|
||||
* [CB-10510](https://issues.apache.org/jira/browse/CB-10510) Add an optional timeout to `emu` start script
|
||||
* [CB-10498](https://issues.apache.org/jira/browse/CB-10498) Resume event should be sticky if it has a plugin result
|
||||
* fix `HtmlNotFoundTest` so that it passes when file not found is handled correctly
|
||||
* CB-10472 `NullPointerException`: `org.apache.cordova.PluginManager.onSaveInstanceState` check if `pluginManager` is `null` before using it
|
||||
* CB-10138 Adds missing plugin metadata to `plugin_list` module.
|
||||
* CB-10443 Pass original options instead of remaining
|
||||
* CB-10443 Fix `this.root` null reference
|
||||
* CB-10421 Fixes exception when calling run script with `--help` option
|
||||
* [CB-10472](https://issues.apache.org/jira/browse/CB-10472) `NullPointerException`: `org.apache.cordova.PluginManager.onSaveInstanceState` check if `pluginManager` is `null` before using it
|
||||
* [CB-10138](https://issues.apache.org/jira/browse/CB-10138) Adds missing plugin metadata to `plugin_list` module.
|
||||
* [CB-10443](https://issues.apache.org/jira/browse/CB-10443) Pass original options instead of remaining
|
||||
* [CB-10443](https://issues.apache.org/jira/browse/CB-10443) Fix `this.root` null reference
|
||||
* [CB-10421](https://issues.apache.org/jira/browse/CB-10421) Fixes exception when calling run script with `--help` option
|
||||
* updated `.gitignore`
|
||||
* CB-10406 Fixes an exception, thrown when building using Ant.
|
||||
* CB-10157 Uninstall app from device/emulator only when signed apk is already installed
|
||||
* [CB-10406](https://issues.apache.org/jira/browse/CB-10406) Fixes an exception, thrown when building using Ant.
|
||||
* [CB-10157](https://issues.apache.org/jira/browse/CB-10157) Uninstall app from device/emulator only when signed apk is already installed
|
||||
|
||||
### 5.1.0 (Jan 19, 2016)
|
||||
* CB-10386 Add `android.useDeprecatedNdk=true` to support `NDK` in `gradle`
|
||||
* CB-8864: Fixing this to mitigate CB-8685 and CB-10104
|
||||
* CB-10105: Spot fix for tilde errors on paths.
|
||||
* [CB-10386](https://issues.apache.org/jira/browse/CB-10386) Add `android.useDeprecatedNdk=true` to support `NDK` in `gradle`
|
||||
* [CB-8864](https://issues.apache.org/jira/browse/CB-8864) Fixing this to mitigate [CB-8685](https://issues.apache.org/jira/browse/CB-8685) and [CB-10104](https://issues.apache.org/jira/browse/CB-10104)
|
||||
* [CB-10105](https://issues.apache.org/jira/browse/CB-10105) Spot fix for tilde errors on paths.
|
||||
* Update theme to `Theme.DeviceDefault.NoActionBar`
|
||||
* CB-10014: Set gradle `applicationId` to `package name`.
|
||||
* CB-9949: Fixing menu button event not fired in **Android**
|
||||
* CB-9479: Fixing the conditionals again, we should
|
||||
* CB-8917: New Plugin API for passing results on resume after Activity destruction
|
||||
* CB-9971 Suppress `gradlew _JAVA_OPTIONS` output during build
|
||||
* CB-9836 Add `.gitattributes` to prevent `CRLF` line endings in repos
|
||||
* [CB-10014](https://issues.apache.org/jira/browse/CB-10014) Set gradle `applicationId` to `package name`.
|
||||
* [CB-9949](https://issues.apache.org/jira/browse/CB-9949) Fixing menu button event not fired in **Android**
|
||||
* [CB-9479](https://issues.apache.org/jira/browse/CB-9479) Fixing the conditionals again, we should
|
||||
* [CB-8917](https://issues.apache.org/jira/browse/CB-8917) New Plugin API for passing results on resume after Activity destruction
|
||||
* [CB-9971](https://issues.apache.org/jira/browse/CB-9971) Suppress `gradlew _JAVA_OPTIONS` output during build
|
||||
* [CB-9836](https://issues.apache.org/jira/browse/CB-9836) Add `.gitattributes` to prevent `CRLF` line endings in repos
|
||||
* added node_modules back into `.gitignore`
|
||||
|
||||
### 5.0.0 (Nov 01, 2015)
|
||||
* Update CordovaWebViewEngine.java
|
||||
* CB-9909 Shouldn't escape spaces in paths on Windows.
|
||||
* CB-9870 updated hello world template
|
||||
* CB-9880 Fixes platform update failure when upgrading from android@<4.1.0
|
||||
* CB-9844 Remove old .java after renaming activity
|
||||
* CB-9800 Fixing contribute link.
|
||||
* CB-9782 Check in `cordova-common` dependency
|
||||
* [CB-9909](https://issues.apache.org/jira/browse/CB-9909) Shouldn't escape spaces in paths on Windows.
|
||||
* [CB-9870](https://issues.apache.org/jira/browse/CB-9870) updated hello world template
|
||||
* [CB-9880](https://issues.apache.org/jira/browse/CB-9880) Fixes platform update failure when upgrading from android@<4.1.0
|
||||
* [CB-9844](https://issues.apache.org/jira/browse/CB-9844) Remove old .java after renaming activity
|
||||
* [CB-9800](https://issues.apache.org/jira/browse/CB-9800) Fixing contribute link.
|
||||
* [CB-9782](https://issues.apache.org/jira/browse/CB-9782) Check in `cordova-common` dependency
|
||||
* Adds licence header to Adb to pass rat audit
|
||||
* CB-9835 Downgrade `properties-parser` to prevent failures in Node < 4.x
|
||||
* CB-9782 Implements PlatformApi contract for Android platform.
|
||||
* CB-9826 Fixed `test-build` script on windows.
|
||||
* [CB-9835](https://issues.apache.org/jira/browse/CB-9835) Downgrade `properties-parser` to prevent failures in Node < 4.x
|
||||
* [CB-9782](https://issues.apache.org/jira/browse/CB-9782) Implements PlatformApi contract for Android platform.
|
||||
* [CB-9826](https://issues.apache.org/jira/browse/CB-9826) Fixed `test-build` script on windows.
|
||||
* Refactor of the Cordova Plugin/Permissions API
|
||||
* Manually updating version to 5.0.0-dev for engine tags
|
||||
* Bump up to API level 23
|
||||
* Commiting code to handle permissions, and the special case of the Geolocation Plugin
|
||||
* CB-9608 cordova-android no longer builds on Node 0.10 or below
|
||||
* CB-9080 Cordova CLI run for Android versions 4.1.1 and lower throws error
|
||||
* CB-9557 Fixes apk install failure when switching from debug to release build
|
||||
* CB-9496 removed permissions added for crosswalk
|
||||
* CB-9402 Allow to set gradle distubutionUrl via env variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
|
||||
* CB-9428 update script now bumps up minSdkVersion to 14 if it is less than that.
|
||||
* CB-9430 Fixes check_reqs failure when javac returns an extra line
|
||||
* CB-9172 Improved emulator deploy stability. This closes #188.
|
||||
* CB-9404 Fixed an exception when path contained -debug or -release
|
||||
* CB-8320 Setting up gradle so we can use CordovaLib as a standard Android Library
|
||||
* CB-9185 Fixed an issue when unsigned apks couldn't be found.
|
||||
* CB-9397 Fixes minor issues with `cordova requirements android`
|
||||
* CB-9389 Fixes build/check_reqs hang
|
||||
* [CB-9608](https://issues.apache.org/jira/browse/CB-9608) cordova-android no longer builds on Node 0.10 or below
|
||||
* [CB-9080](https://issues.apache.org/jira/browse/CB-9080) Cordova CLI run for Android versions 4.1.1 and lower throws error
|
||||
* [CB-9557](https://issues.apache.org/jira/browse/CB-9557) Fixes apk install failure when switching from debug to release build
|
||||
* [CB-9496](https://issues.apache.org/jira/browse/CB-9496) removed permissions added for crosswalk
|
||||
* [CB-9402](https://issues.apache.org/jira/browse/CB-9402) Allow to set gradle distubutionUrl via env variable CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
|
||||
* [CB-9428](https://issues.apache.org/jira/browse/CB-9428) update script now bumps up minSdkVersion to 14 if it is less than that.
|
||||
* [CB-9430](https://issues.apache.org/jira/browse/CB-9430) Fixes check_reqs failure when javac returns an extra line
|
||||
* [CB-9172](https://issues.apache.org/jira/browse/CB-9172) Improved emulator deploy stability. This closes #188.
|
||||
* [CB-9404](https://issues.apache.org/jira/browse/CB-9404) Fixed an exception when path contained -debug or -release
|
||||
* [CB-8320](https://issues.apache.org/jira/browse/CB-8320) Setting up gradle so we can use CordovaLib as a standard Android Library
|
||||
* [CB-9185](https://issues.apache.org/jira/browse/CB-9185) Fixed an issue when unsigned apks couldn't be found.
|
||||
* [CB-9397](https://issues.apache.org/jira/browse/CB-9397) Fixes minor issues with `cordova requirements android`
|
||||
* [CB-9389](https://issues.apache.org/jira/browse/CB-9389) Fixes build/check_reqs hang
|
||||
|
||||
### Release 4.1.1 (Aug 2015) ###
|
||||
|
||||
* CB-9428 update script now bumps up minSdkVersion to 14 if it is less than that
|
||||
* CB-9430 Fixes check_reqs failure when javac returns an extra line
|
||||
* [CB-9428](https://issues.apache.org/jira/browse/CB-9428) update script now bumps up minSdkVersion to 14 if it is less than that
|
||||
* [CB-9430](https://issues.apache.org/jira/browse/CB-9430) Fixes check_reqs failure when javac returns an extra line
|
||||
|
||||
### Release 4.1.0 (Jul 2015) ###
|
||||
* CB-9392 Fixed printing flavored versions. This closes #184.
|
||||
* CB-9382 [Android] Fix KeepRunning setting when Plugin activity is showed. This closes #200
|
||||
* CB-9391 Fixes cdvBuildMultipleApks option casting
|
||||
* CB-9343 Split the Content-Type to obtain a clean mimetype
|
||||
* CB-9255 Make getUriType case insensitive.
|
||||
* CB-9149 Fixes JSHint issue introduced by 899daa9
|
||||
* CB-9372: Remove unused files: 'main.js' & 'master.css'. This closes #198
|
||||
* CB-9149 Make gradle alias subprojects in order to handle libs that depend on libs. This closes #182
|
||||
* [CB-9392](https://issues.apache.org/jira/browse/CB-9392) Fixed printing flavored versions. This closes #184.
|
||||
* [CB-9382](https://issues.apache.org/jira/browse/CB-9382) [Android] Fix KeepRunning setting when Plugin activity is showed. This closes #200
|
||||
* [CB-9391](https://issues.apache.org/jira/browse/CB-9391) Fixes cdvBuildMultipleApks option casting
|
||||
* [CB-9343](https://issues.apache.org/jira/browse/CB-9343) Split the Content-Type to obtain a clean mimetype
|
||||
* [CB-9255](https://issues.apache.org/jira/browse/CB-9255) Make getUriType case insensitive.
|
||||
* [CB-9149](https://issues.apache.org/jira/browse/CB-9149) Fixes JSHint issue introduced by 899daa9
|
||||
* [CB-9372](https://issues.apache.org/jira/browse/CB-9372) Remove unused files: 'main.js' & 'master.css'. This closes #198
|
||||
* [CB-9149](https://issues.apache.org/jira/browse/CB-9149) Make gradle alias subprojects in order to handle libs that depend on libs. This closes #182
|
||||
* Update min SDK version to 14
|
||||
* Update licenses. This closes #190
|
||||
* CB-9185 Fix signed release build exception. This closes #193.
|
||||
* CB-9286 Fixes build failure when ANDROID_HOME is not set.
|
||||
* CB-9284 Fix for handling absolute path for keystore in build.json
|
||||
* CB-9260 Install Android-22 on Travis-CI
|
||||
* [CB-9185](https://issues.apache.org/jira/browse/CB-9185) Fix signed release build exception. This closes #193.
|
||||
* [CB-9286](https://issues.apache.org/jira/browse/CB-9286) Fixes build failure when ANDROID_HOME is not set.
|
||||
* [CB-9284](https://issues.apache.org/jira/browse/CB-9284) Fix for handling absolute path for keystore in build.json
|
||||
* [CB-9260](https://issues.apache.org/jira/browse/CB-9260) Install Android-22 on Travis-CI
|
||||
* Adding .ratignore file.
|
||||
* CB-9119 Adding lib/retry.js for retrying promise-returning functions. Retrying 'adb install' in emulator.js because it sometimes hangs.
|
||||
* CB-9115 android: Grant Lollipop permission req
|
||||
* [CB-9119](https://issues.apache.org/jira/browse/CB-9119) Adding lib/retry.js for retrying promise-returning functions. Retrying 'adb install' in emulator.js because it sometimes hangs.
|
||||
* [CB-9115](https://issues.apache.org/jira/browse/CB-9115) android: Grant Lollipop permission req
|
||||
* Remove extra console message
|
||||
* CB-8898 Report expected gradle location properly
|
||||
* CB-8898 Fixes gradle check failure due to missing quotes
|
||||
* CB-9080: -d option is not supported on Android 4.1.1 and lower, removing
|
||||
* CB-8954 Adds `requirements` command support to check_reqs module
|
||||
* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Report expected gradle location properly
|
||||
* [CB-8898](https://issues.apache.org/jira/browse/CB-8898) Fixes gradle check failure due to missing quotes
|
||||
* [CB-9080](https://issues.apache.org/jira/browse/CB-9080) -d option is not supported on Android 4.1.1 and lower, removing
|
||||
* [CB-8954](https://issues.apache.org/jira/browse/CB-8954) Adds `requirements` command support to check_reqs module
|
||||
* Update JS snapshot to version 4.1.0-dev (via coho)
|
||||
* CB-8417 updated platform specific files from cordova.js repo
|
||||
* [CB-8417](https://issues.apache.org/jira/browse/CB-8417) updated platform specific files from cordova.js repo
|
||||
* Adding tests to confirm that preferences aren't changed by Intents
|
||||
* Forgot to remove the method that copied over the intent data
|
||||
* Getting around to removing this old Intent code
|
||||
* Update JS snapshot to version 4.1.0-dev (via coho)
|
||||
* Fix CordovaPluginTest on KitKat (start-up events seem to change)
|
||||
* CB-3360 Allow setting a custom User-Agent (close #162)
|
||||
* CB-8902 Use immersive mode when available when going fullscreen (close #175)
|
||||
* [CB-3360](https://issues.apache.org/jira/browse/CB-3360) Allow setting a custom User-Agent (close #162)
|
||||
* [CB-8902](https://issues.apache.org/jira/browse/CB-8902) Use immersive mode when available when going fullscreen (close #175)
|
||||
* Make BridgeMode methods public (they were always supposed to be)
|
||||
* Simplify: EncodingUtils.getBytes(str) -> str.getBytes()
|
||||
* Don't show warning when gradlew file is read-only
|
||||
* Don't show warning when prepEnv copies gradlew and it's read-only
|
||||
* Make gradle wrapper prepEnv code work even when android-sdk is read-only
|
||||
* CB-8897 Delete drawable/icon.png since it duplicates drawable-mdpi/icon.png
|
||||
* [CB-8897](https://issues.apache.org/jira/browse/CB-8897) Delete drawable/icon.png since it duplicates drawable-mdpi/icon.png
|
||||
* Updating the template to target mininumSdkTarget=14
|
||||
* CB-8894: Updating the template to target mininumSdkTarget=14
|
||||
* CB-8891 Add a note about when the gradle helpers were added
|
||||
* CB-8891 Add a gradle helper for retrieving config.xml preference values
|
||||
* CB-8884 Delete Eclipse tweaks from create script
|
||||
* CB-8834 Don't fail to install on VERSION_DOWNGRADE
|
||||
* [CB-8894](https://issues.apache.org/jira/browse/CB-8894) Updating the template to target mininumSdkTarget=14
|
||||
* [CB-8891](https://issues.apache.org/jira/browse/CB-8891) Add a note about when the gradle helpers were added
|
||||
* [CB-8891](https://issues.apache.org/jira/browse/CB-8891) Add a gradle helper for retrieving config.xml preference values
|
||||
* [CB-8884](https://issues.apache.org/jira/browse/CB-8884) Delete Eclipse tweaks from create script
|
||||
* [CB-8834](https://issues.apache.org/jira/browse/CB-8834) Don't fail to install on VERSION_DOWNGRADE
|
||||
* Automated tools fail, and you have to remember all four places where this is set.
|
||||
* Update the package.json
|
||||
* CB-9042 coho failed to update version, so here we are
|
||||
* [CB-9042](https://issues.apache.org/jira/browse/CB-9042) coho failed to update version, so here we are
|
||||
* CB9042 - Updating Release Notes
|
||||
* Adding tests to confirm that preferences aren't changed by Intents
|
||||
* updating existing test code
|
||||
* Forgot to remove the method that copied over the intent data
|
||||
* Getting around to removing this old Intent code
|
||||
* CB-8834 Don't fail to install on VERSION_DOWNGRADE
|
||||
* [CB-8834](https://issues.apache.org/jira/browse/CB-8834) Don't fail to install on VERSION_DOWNGRADE
|
||||
|
||||
### Release 4.0.2 (May 2015) ###
|
||||
|
||||
* Removed Intent Functionality from Preferences - Preferences can no longer be set by intents
|
||||
|
||||
### Release 4.0.1 (April 2015) ###
|
||||
### Release 4.0.1 (April 2015) ###
|
||||
|
||||
* Bug fixed where platform failed to install on a version downgrade
|
||||
|
||||
@@ -178,111 +217,111 @@ Changes For Plugin Developers:
|
||||
* Plugins can depend on Maven libraries using `<framework>` tags
|
||||
* New APIs: `onStart`, `onStop`, `onConfigurationChanged`
|
||||
* `"onScrollChanged"` message removed. Use `view.getViewTreeObserver().addOnScrollChangedListener(...)` instead
|
||||
* CB-8702 New API for plugins to override `shouldInterceptRequest` with a stream
|
||||
* [CB-8702](https://issues.apache.org/jira/browse/CB-8702) New API for plugins to override `shouldInterceptRequest` with a stream
|
||||
|
||||
#### Other Changes ####
|
||||
* CB-8378 Removed `hidekeyboard` and `showkeyboard` events (apps should use a plugin instead)
|
||||
* CB-8735 `bin/create` regex relaxed / better support for numbers
|
||||
* CB-8699 Fix CordovaResourceApi `copyResource` creating zero-length files when src=uncompressed asset
|
||||
* CB-8693 CordovaLib should not contain icons / splashscreens
|
||||
* CB-8592 Fix NPE if lifecycle events reach CordovaWebView before `init()` has been called
|
||||
* CB-8588 Add CATEGORY_BROWSABLE to intents from showWebPage openExternal=true
|
||||
* CB-8587 Don't allow WebView navigations within showWebPage that are not whitelisted
|
||||
* CB-7827 Add `--activity-name` for `bin/create`
|
||||
* CB-8548 Use debug-signing.properties and release-signing.properties when they exist
|
||||
* CB-8545 Don't add a layout as a parent of the WebView
|
||||
* CB-7159 BackgroundColor not used when `<html style="opacity:0">`, nor during screen rotation
|
||||
* CB-6630 Removed OkHttp from core library. It's now available as a plugin: [cordova-plugin-okhttp](https://www.npmjs.com/package/cordova-plugin-okhttp)
|
||||
* [CB-8378](https://issues.apache.org/jira/browse/CB-8378) Removed `hidekeyboard` and `showkeyboard` events (apps should use a plugin instead)
|
||||
* [CB-8735](https://issues.apache.org/jira/browse/CB-8735) `bin/create` regex relaxed / better support for numbers
|
||||
* [CB-8699](https://issues.apache.org/jira/browse/CB-8699) Fix CordovaResourceApi `copyResource` creating zero-length files when src=uncompressed asset
|
||||
* [CB-8693](https://issues.apache.org/jira/browse/CB-8693) CordovaLib should not contain icons / splashscreens
|
||||
* [CB-8592](https://issues.apache.org/jira/browse/CB-8592) Fix NPE if lifecycle events reach CordovaWebView before `init()` has been called
|
||||
* [CB-8588](https://issues.apache.org/jira/browse/CB-8588) Add CATEGORY_BROWSABLE to intents from showWebPage openExternal=true
|
||||
* [CB-8587](https://issues.apache.org/jira/browse/CB-8587) Don't allow WebView navigations within showWebPage that are not whitelisted
|
||||
* [CB-7827](https://issues.apache.org/jira/browse/CB-7827) Add `--activity-name` for `bin/create`
|
||||
* [CB-8548](https://issues.apache.org/jira/browse/CB-8548) Use debug-signing.properties and release-signing.properties when they exist
|
||||
* [CB-8545](https://issues.apache.org/jira/browse/CB-8545) Don't add a layout as a parent of the WebView
|
||||
* [CB-7159](https://issues.apache.org/jira/browse/CB-7159) BackgroundColor not used when `<html style="opacity:0">`, nor during screen rotation
|
||||
* [CB-6630](https://issues.apache.org/jira/browse/CB-6630) Removed OkHttp from core library. It's now available as a plugin: [cordova-plugin-okhttp](https://www.npmjs.com/package/cordova-plugin-okhttp)
|
||||
|
||||
### Release 3.7.1 (January 2015) ###
|
||||
* CB-8411 Initialize plugins only after `createViews()` is called (regression in 3.7.0)
|
||||
* [CB-8411](https://issues.apache.org/jira/browse/CB-8411) Initialize plugins only after `createViews()` is called (regression in 3.7.0)
|
||||
|
||||
### Release 3.7.0 (January 2015) ###
|
||||
|
||||
* CB-8328 Allow plugins to handle certificate challenges (close #150)
|
||||
* CB-8201 Add support for auth dialogs into Cordova Android
|
||||
* CB-8017 Add support for `<input type=file>` for Lollipop
|
||||
* CB-8143 Loads of gradle improvements (try it with cordova/build --gradle)
|
||||
* CB-8329 Cancel outstanding ActivityResult requests when a new startActivityForResult occurs
|
||||
* CB-8026 Bumping up Android Version and setting it up to allow third-party cookies. This might change later.
|
||||
* CB-8210 Use PluginResult for various events from native so that content-security-policy <meta> can be used
|
||||
* CB-8168 Add support for `cordova/run --list` (closes #139)
|
||||
* CB-8176 Vastly better auto-detection of SDK & JDK locations
|
||||
* CB-8079 Use activity class package name, but fallback to application package name when looking for splash screen drawable
|
||||
* CB-8147 Have corodva/build warn about unrecognized flags rather than fail
|
||||
* CB-7881 Android tooling shouldn't lock application directory
|
||||
* CB-8112 Turn off mediaPlaybackRequiresUserGesture
|
||||
* CB-6153 Add a preference for controlling hardware button audio stream (DefaultVolumeStream)
|
||||
* CB-8031 Fix race condition that shows as ConcurrentModificationException
|
||||
* CB-7974 Cancel timeout timer if view is destroyed
|
||||
* CB-7940 Disable exec bridge if bridgeSecret is wrong
|
||||
* CB-7758 Allow content-url-hosted pages to access the bridge
|
||||
* CB-6511 Fixes build for android when app name contains unicode characters.
|
||||
* CB-7707 Added multipart PluginResult
|
||||
* CB-6837 Fix leaked window when hitting back button while alert being rendered
|
||||
* CB-7674 Move preference activation back into onCreate()
|
||||
* CB-7499 Support RTL text direction
|
||||
* CB-7330 Don't run check_reqs for bin/create.
|
||||
* [CB-8328](https://issues.apache.org/jira/browse/CB-8328) Allow plugins to handle certificate challenges (close #150)
|
||||
* [CB-8201](https://issues.apache.org/jira/browse/CB-8201) Add support for auth dialogs into Cordova Android
|
||||
* [CB-8017](https://issues.apache.org/jira/browse/CB-8017) Add support for `<input type=file>` for Lollipop
|
||||
* [CB-8143](https://issues.apache.org/jira/browse/CB-8143) Loads of gradle improvements (try it with cordova/build --gradle)
|
||||
* [CB-8329](https://issues.apache.org/jira/browse/CB-8329) Cancel outstanding ActivityResult requests when a new startActivityForResult occurs
|
||||
* [CB-8026](https://issues.apache.org/jira/browse/CB-8026) Bumping up Android Version and setting it up to allow third-party cookies. This might change later.
|
||||
* [CB-8210](https://issues.apache.org/jira/browse/CB-8210) Use PluginResult for various events from native so that content-security-policy <meta> can be used
|
||||
* [CB-8168](https://issues.apache.org/jira/browse/CB-8168) Add support for `cordova/run --list` (closes #139)
|
||||
* [CB-8176](https://issues.apache.org/jira/browse/CB-8176) Vastly better auto-detection of SDK & JDK locations
|
||||
* [CB-8079](https://issues.apache.org/jira/browse/CB-8079) Use activity class package name, but fallback to application package name when looking for splash screen drawable
|
||||
* [CB-8147](https://issues.apache.org/jira/browse/CB-8147) Have corodva/build warn about unrecognized flags rather than fail
|
||||
* [CB-7881](https://issues.apache.org/jira/browse/CB-7881) Android tooling shouldn't lock application directory
|
||||
* [CB-8112](https://issues.apache.org/jira/browse/CB-8112) Turn off mediaPlaybackRequiresUserGesture
|
||||
* [CB-6153](https://issues.apache.org/jira/browse/CB-6153) Add a preference for controlling hardware button audio stream (DefaultVolumeStream)
|
||||
* [CB-8031](https://issues.apache.org/jira/browse/CB-8031) Fix race condition that shows as ConcurrentModificationException
|
||||
* [CB-7974](https://issues.apache.org/jira/browse/CB-7974) Cancel timeout timer if view is destroyed
|
||||
* [CB-7940](https://issues.apache.org/jira/browse/CB-7940) Disable exec bridge if bridgeSecret is wrong
|
||||
* [CB-7758](https://issues.apache.org/jira/browse/CB-7758) Allow content-url-hosted pages to access the bridge
|
||||
* [CB-6511](https://issues.apache.org/jira/browse/CB-6511) Fixes build for android when app name contains unicode characters.
|
||||
* [CB-7707](https://issues.apache.org/jira/browse/CB-7707) Added multipart PluginResult
|
||||
* [CB-6837](https://issues.apache.org/jira/browse/CB-6837) Fix leaked window when hitting back button while alert being rendered
|
||||
* [CB-7674](https://issues.apache.org/jira/browse/CB-7674) Move preference activation back into onCreate()
|
||||
* [CB-7499](https://issues.apache.org/jira/browse/CB-7499) Support RTL text direction
|
||||
* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Don't run check_reqs for bin/create.
|
||||
|
||||
### 3.6.4 (Sept 30, 2014) ###
|
||||
|
||||
* Set VERSION to 3.6.4 (via coho)
|
||||
* Update JS snapshot to version 3.6.4 (via coho)
|
||||
* CB-7634 Detect JAVA_HOME properly on Ubuntu
|
||||
* CB-7579 Fix run script's ability to use non-arch-specific APKs
|
||||
* CB-6511 Fixes build for android when app name contains unicode characters.
|
||||
* CB-7463: Adding licences. I don't know what the gradle syntax is for comments, that still needs to be done.
|
||||
* CB-7463: Looked at the Apache BigTop git, gradle uses C-style comments
|
||||
* CB-7460: Fixing bug with KitKat where the background colour would override the CSS colours on the application
|
||||
* [CB-7634](https://issues.apache.org/jira/browse/CB-7634) Detect JAVA_HOME properly on Ubuntu
|
||||
* [CB-7579](https://issues.apache.org/jira/browse/CB-7579) Fix run script's ability to use non-arch-specific APKs
|
||||
* [CB-6511](https://issues.apache.org/jira/browse/CB-6511) Fixes build for android when app name contains unicode characters.
|
||||
* [CB-7463](https://issues.apache.org/jira/browse/CB-7463) Adding licences. I don't know what the gradle syntax is for comments, that still needs to be done.
|
||||
* [CB-7463](https://issues.apache.org/jira/browse/CB-7463) Looked at the Apache BigTop git, gradle uses C-style comments
|
||||
* [CB-7460](https://issues.apache.org/jira/browse/CB-7460) Fixing bug with KitKat where the background colour would override the CSS colours on the application
|
||||
|
||||
### 3.6.0 (Sept 2014) ###
|
||||
|
||||
* Set VERSION to 3.6.0 (via coho)
|
||||
* CB-7410 fix the menu test
|
||||
* CB-7410 Fix the errorUrl test
|
||||
* CB-7410 Fix Basic Authentication test
|
||||
* CB-3445: Allow build and run scripts to select APK by architecture
|
||||
* CB-3445: Add environment variable 'BUILD_MULTIPLE_APKS' for splitting APKs based on architecture
|
||||
* CB-3445: Ensure that JAR files in libs directory are included
|
||||
* CB-7267 update RELEASENOTES for 3.5.1
|
||||
* CB-7410 clarify the title
|
||||
* CB-7385 update cordova.js for testing prior to branch/tag
|
||||
* CB-7410 add whitelist entries to get iframe/GoogleMaps working
|
||||
* CB-7291 propogate change in method signature to the native tests
|
||||
* CB-7291: Restrict meaning of "\*" in internal whitelist to just http and https
|
||||
* CB-7291: Only add file, content and data URLs to internal whitelist
|
||||
* CB-7291: Add defaults to external whitelist
|
||||
* CB-7291: Add external-launch-whitelist and use it for filtering intent launches
|
||||
* CB-3445: Read project.properties to configure gradle libraries
|
||||
* CB-7325 Fix error message in android_sdk_version.js when missing SDK on windows
|
||||
* CB-7335 Add a .gitignore to android project template
|
||||
* CB-7330 Fix dangling function call in last commit (broke gradle builds)
|
||||
* CB-7330 Don't run "android update" during creation
|
||||
* CB-3445 Add gradle support clean command (plus some code cleanup)
|
||||
* CB-7044 Fix typo in prev commit causing check_reqs to always fail.
|
||||
* CB-3445 Copy gradle wrapper in build instead of create
|
||||
* CB-3445 Add .gradle template files for "update" as well as "create"
|
||||
* CB-7044 Add JAVA_HOME when not set. Be stricter about ANDROID_HOME
|
||||
* CB-3445 Speed up gradle building (incremental builds go from 10s -> 1.5s for me)
|
||||
* CB-3445: android: Copy Gradle wrapper from Android SDK rather than bundling a JAR
|
||||
* CB-3445: Add which to checked-in node_modules
|
||||
* CB-3445: Add option to build and install with gradle
|
||||
* CB-3445: Add an initial set of Gradle build scripts
|
||||
* CB-7321 Don't require ant for create script
|
||||
* CB-7044, CB-7299 Fix up PATH problems when possible.
|
||||
* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) fix the menu test
|
||||
* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) Fix the errorUrl test
|
||||
* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) Fix Basic Authentication test
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Allow build and run scripts to select APK by architecture
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add environment variable 'BUILD_MULTIPLE_APKS' for splitting APKs based on architecture
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Ensure that JAR files in libs directory are included
|
||||
* [CB-7267](https://issues.apache.org/jira/browse/CB-7267) update RELEASENOTES for 3.5.1
|
||||
* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) clarify the title
|
||||
* [CB-7385](https://issues.apache.org/jira/browse/CB-7385) update cordova.js for testing prior to branch/tag
|
||||
* [CB-7410](https://issues.apache.org/jira/browse/CB-7410) add whitelist entries to get iframe/GoogleMaps working
|
||||
* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) propogate change in method signature to the native tests
|
||||
* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Restrict meaning of "\*" in internal whitelist to just http and https
|
||||
* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Only add file, content and data URLs to internal whitelist
|
||||
* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Add defaults to external whitelist
|
||||
* [CB-7291](https://issues.apache.org/jira/browse/CB-7291) Add external-launch-whitelist and use it for filtering intent launches
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Read project.properties to configure gradle libraries
|
||||
* [CB-7325](https://issues.apache.org/jira/browse/CB-7325) Fix error message in android_sdk_version.js when missing SDK on windows
|
||||
* [CB-7335](https://issues.apache.org/jira/browse/CB-7335) Add a .gitignore to android project template
|
||||
* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Fix dangling function call in last commit (broke gradle builds)
|
||||
* [CB-7330](https://issues.apache.org/jira/browse/CB-7330) Don't run "android update" during creation
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add gradle support clean command (plus some code cleanup)
|
||||
* [CB-7044](https://issues.apache.org/jira/browse/CB-7044) Fix typo in prev commit causing check_reqs to always fail.
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Copy gradle wrapper in build instead of create
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add .gradle template files for "update" as well as "create"
|
||||
* [CB-7044](https://issues.apache.org/jira/browse/CB-7044) Add JAVA_HOME when not set. Be stricter about ANDROID_HOME
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Speed up gradle building (incremental builds go from 10s -> 1.5s for me)
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) android: Copy Gradle wrapper from Android SDK rather than bundling a JAR
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add which to checked-in node_modules
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add option to build and install with gradle
|
||||
* [CB-3445](https://issues.apache.org/jira/browse/CB-3445) Add an initial set of Gradle build scripts
|
||||
* [CB-7321](https://issues.apache.org/jira/browse/CB-7321) Don't require ant for create script
|
||||
* CB-7044, [CB-7299](https://issues.apache.org/jira/browse/CB-7299) Fix up PATH problems when possible.
|
||||
* Change in test's AndroidManifest.xml needed for the test to run properly. Forgot the manifest.
|
||||
* Change in test's AndroidManifest.xml needed for the test to run properly
|
||||
* Adding tests related to 3.5.1
|
||||
* CB-7261 Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT
|
||||
* CB-7265 Fix crash when navigating to custom protocol (introduced in 3.5.1)
|
||||
* [CB-7261](https://issues.apache.org/jira/browse/CB-7261) Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT
|
||||
* [CB-7265](https://issues.apache.org/jira/browse/CB-7265) Fix crash when navigating to custom protocol (introduced in 3.5.1)
|
||||
* Filter out non-launchable intents
|
||||
* Handle unsupported protocol errors in webview better
|
||||
* CB-7238: I should have collapsed this, but Config.init() must go before the creation of CordovaWebView
|
||||
* CB-7238: Minor band-aid to get tests running again, this has to go away before 3.6.0 is released, since this is an API change.
|
||||
* [CB-7238](https://issues.apache.org/jira/browse/CB-7238) I should have collapsed this, but Config.init() must go before the creation of CordovaWebView
|
||||
* [CB-7238](https://issues.apache.org/jira/browse/CB-7238) Minor band-aid to get tests running again, this has to go away before 3.6.0 is released, since this is an API change.
|
||||
* Extend whitelist to handle URLs without // chars
|
||||
* CB-7172 Force window to have focus after resume
|
||||
* CB-7159 Set background color of webView as well as its parent
|
||||
* CB-7018 Fix setButtonPlumbedToJs never un-listening
|
||||
* [CB-7172](https://issues.apache.org/jira/browse/CB-7172) Force window to have focus after resume
|
||||
* [CB-7159](https://issues.apache.org/jira/browse/CB-7159) Set background color of webView as well as its parent
|
||||
* [CB-7018](https://issues.apache.org/jira/browse/CB-7018) Fix setButtonPlumbedToJs never un-listening
|
||||
* Undeprecate some just-deprecated symbols in PluginManager.
|
||||
* @Deprecate methods of PluginManager that were never meant to be public
|
||||
* Move plugin instantiation and instance storing logic PluginEntry->PluginManager
|
||||
@@ -307,7 +346,7 @@ Changes For Plugin Developers:
|
||||
* Fix PluginManager.setPluginEntries not removing old entries
|
||||
* Move registration of App plugin from config.xml -> code
|
||||
* Make setWebViewClient an override instead of an overload. Delete Location-change JS->Native bridge mode (missed some of it).
|
||||
* CB-4404 Revert setting android:windowSoftInputMode to "adjustPan"
|
||||
* [CB-4404](https://issues.apache.org/jira/browse/CB-4404) Revert setting android:windowSoftInputMode to "adjustPan"
|
||||
* Refactor: Use ConfigXmlParser in activity. Adds CordovaWebView.init()
|
||||
* Deprecate some convenience methods on CordovaActivity
|
||||
* Fix CordovaPreferences not correctly parsing hex values (valueOf->decode)
|
||||
@@ -319,36 +358,36 @@ Changes For Plugin Developers:
|
||||
* Delete "CB-3064: The errorUrl is..." Log message left over from debugging presumably
|
||||
* Refactor Config into ConfigXmlParser, CordovaPreferences
|
||||
* Delete Location-change JS->Native bridge mode
|
||||
* CB-5988 Allow exec() only from file: or start-up URL's domain
|
||||
* CB-6761 Fix native->JS bridge ceasing to fire when page changes and online is set to false and the JS loads quickly
|
||||
* [CB-5988](https://issues.apache.org/jira/browse/CB-5988) Allow exec() only from file: or start-up URL's domain
|
||||
* [CB-6761](https://issues.apache.org/jira/browse/CB-6761) Fix native->JS bridge ceasing to fire when page changes and online is set to false and the JS loads quickly
|
||||
* Update the errorurl to no longer use intents
|
||||
* This breaks running the JUnit tests, we'll bring it back soon
|
||||
* Refactoring the URI handling on Cordova, removing dead code
|
||||
* CB-7018 Clean up and deprecation of some button-related functions
|
||||
* CB-7017 Fix onload=true being set on all subsequent plugins
|
||||
* CB-5971: Fix package / project validation
|
||||
* CB-5971: Add unit tests to cordova-android
|
||||
* CB-5971: Factor out package/project name validation logic
|
||||
* [CB-7018](https://issues.apache.org/jira/browse/CB-7018) Clean up and deprecation of some button-related functions
|
||||
* [CB-7017](https://issues.apache.org/jira/browse/CB-7017) Fix onload=true being set on all subsequent plugins
|
||||
* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Fix package / project validation
|
||||
* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Add unit tests to cordova-android
|
||||
* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) Factor out package/project name validation logic
|
||||
* Delete explicit activity.finish() in back button handling. No change in behaviour.
|
||||
* CB-5971: This would have been a good first bug, too bad
|
||||
* CB-4404: Changing where android:windowSoftInputMode is in the manifest so it works
|
||||
* [CB-5971](https://issues.apache.org/jira/browse/CB-5971) This would have been a good first bug, too bad
|
||||
* [CB-4404](https://issues.apache.org/jira/browse/CB-4404) Changing where android:windowSoftInputMode is in the manifest so it works
|
||||
* Add documentation referencing other implementation.
|
||||
* CB-6851 Deprecate WebView.sendJavascript()
|
||||
* CB-6876 Show the correct executable name
|
||||
* CB-6876 Fix the "print usage"
|
||||
* [CB-6851](https://issues.apache.org/jira/browse/CB-6851) Deprecate WebView.sendJavascript()
|
||||
* [CB-6876](https://issues.apache.org/jira/browse/CB-6876) Show the correct executable name
|
||||
* [CB-6876](https://issues.apache.org/jira/browse/CB-6876) Fix the "print usage"
|
||||
* Trivial spelling fix in comments when reading CordovaResourceApi
|
||||
* CB-6818: I want to remove this code, because Square didn't do their headers properly
|
||||
* CB-6860 Add activity_name and launcher_name to AndroidManifest.xml & strings.xml
|
||||
* [CB-6818](https://issues.apache.org/jira/browse/CB-6818) I want to remove this code, because Square didn't do their headers properly
|
||||
* [CB-6860](https://issues.apache.org/jira/browse/CB-6860) Add activity_name and launcher_name to AndroidManifest.xml & strings.xml
|
||||
* Add a comment to custom_rules.xml saying why we move AndroidManifest.xml
|
||||
* Remove +x from README.md
|
||||
* CB-6784 Add missing licenses
|
||||
* CB-6784 Add license to CONTRIBUTING.md
|
||||
* [CB-6784](https://issues.apache.org/jira/browse/CB-6784) Add missing licenses
|
||||
* [CB-6784](https://issues.apache.org/jira/browse/CB-6784) Add license to CONTRIBUTING.md
|
||||
* Revert "defaults.xml: Add AndroidLaunchMode preference"
|
||||
* updated RELEASENOTES
|
||||
* CB-6315: Wrapping this so it runs on the UI thread
|
||||
* CB-6723 Update package name for Robotium
|
||||
* CB-6707 Update minSdkVersion to 10 consistently
|
||||
* CB-5652 make visible cordova version
|
||||
* [CB-6315](https://issues.apache.org/jira/browse/CB-6315) Wrapping this so it runs on the UI thread
|
||||
* [CB-6723](https://issues.apache.org/jira/browse/CB-6723) Update package name for Robotium
|
||||
* [CB-6707](https://issues.apache.org/jira/browse/CB-6707) Update minSdkVersion to 10 consistently
|
||||
* [CB-5652](https://issues.apache.org/jira/browse/CB-5652) make visible cordova version
|
||||
* Update JS snapshot to version 3.6.0-dev (via coho)
|
||||
* Update JS snapshot to version 3.6.0-dev (via coho)
|
||||
* Set VERSION to 3.6.0-dev (via coho)
|
||||
@@ -368,112 +407,112 @@ http://cordova.apache.org/announcements/2014/08/04/android-351.html
|
||||
|
||||
* OkHttp has broken headers. Updating for ASF compliance.
|
||||
* Revert accidentally removed lines from NOTICE
|
||||
* CB-6552: added top level package.json
|
||||
* CB-6491 add CONTRIBUTING.md
|
||||
* CB-6543 Fix cordova/run failure when no custom_rules.xml available
|
||||
* [CB-6552](https://issues.apache.org/jira/browse/CB-6552) added top level package.json
|
||||
* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
|
||||
* [CB-6543](https://issues.apache.org/jira/browse/CB-6543) Fix cordova/run failure when no custom_rules.xml available
|
||||
* defaults.xml: Add AndroidLaunchMode preference
|
||||
* Add JavaDoc for CordovaResourceApi
|
||||
* CB-6388: Handle binary data correctly in LOAD_URL bridge
|
||||
* Fix CB-6048: Set launchMode=singleTop so tapping app icon does not always restart app
|
||||
* [CB-6388](https://issues.apache.org/jira/browse/CB-6388) Handle binary data correctly in LOAD_URL bridge
|
||||
* Fix [CB-6048](https://issues.apache.org/jira/browse/CB-6048) Set launchMode=singleTop so tapping app icon does not always restart app
|
||||
* Remove incorrect usage of AlertDialog.Builder.create
|
||||
* Catch uncaught exceptions in from plugins and turn them into error responses.
|
||||
* Add NOTICE file
|
||||
* CB-6047 Fix online sometimes getting in a bad state on page transitions.
|
||||
* [CB-6047](https://issues.apache.org/jira/browse/CB-6047) Fix online sometimes getting in a bad state on page transitions.
|
||||
* Add another convenience overload for CordovaResourceApi.copyResource
|
||||
* Update framework's .classpath to what Eclipse wants it to be.
|
||||
* README.md: `android update` to `android-19`.
|
||||
* Fix NPE when POLLING bridge mode is used.
|
||||
* Updating NOTICE to include Square for OkHttp
|
||||
* CB-5398 Apply KitKat content URI fix to all content URIs
|
||||
* CB-5398 Work-around for KitKat content: URLs not rendering in <img> tags
|
||||
* CB-5908: add splascreen images to template
|
||||
* CB-5395: Make scheme and host (but not path) case-insensitive in whitelist
|
||||
* [CB-5398](https://issues.apache.org/jira/browse/CB-5398) Apply KitKat content URI fix to all content URIs
|
||||
* [CB-5398](https://issues.apache.org/jira/browse/CB-5398) Work-around for KitKat content: URLs not rendering in <img> tags
|
||||
* [CB-5908](https://issues.apache.org/jira/browse/CB-5908) add splascreen images to template
|
||||
* [CB-5395](https://issues.apache.org/jira/browse/CB-5395) Make scheme and host (but not path) case-insensitive in whitelist
|
||||
* Ignore multiple onPageFinished() callbacks & onReceivedError due to stopLoading()
|
||||
* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vu
|
||||
* CB-4984 Don't create on CordovaActivity name
|
||||
* CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins.
|
||||
* [CB-4984](https://issues.apache.org/jira/browse/CB-4984) Don't create on CordovaActivity name
|
||||
* [CB-5917](https://issues.apache.org/jira/browse/CB-5917) Add a loadUrlIntoView overload that doesn't recreate plugins.
|
||||
* Use thread pool for load timeout.
|
||||
* CB-5715 For CLI, hide assets/www and res/xml/config.xml by default
|
||||
* CB-5793 ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/
|
||||
* CB-5889 Make update script find project name instead of using "null" for CordovaLib
|
||||
* CB-5889 Add a message in the update script about needing to import CordovaLib when using an IDE.
|
||||
* [CB-5715](https://issues.apache.org/jira/browse/CB-5715) For CLI, hide assets/www and res/xml/config.xml by default
|
||||
* [CB-5793](https://issues.apache.org/jira/browse/CB-5793) ant builds: Rename AndroidManifest during -post-build to avoid Eclipse detecting ant-build/
|
||||
* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Make update script find project name instead of using "null" for CordovaLib
|
||||
* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Add a message in the update script about needing to import CordovaLib when using an IDE.
|
||||
|
||||
### 3.4.0 (Feb 2014) ###
|
||||
|
||||
43 commits from 10 authors. Highlights include:
|
||||
|
||||
* Removing addJavascriptInterface support from all Android versions lower than 4.2 due to security vulnerability
|
||||
* CB-5917 Add a loadUrlIntoView overload that doesn't recreate plugins.
|
||||
* CB-5889 Make update script find project name instead of using "null" for CordovaLib
|
||||
* CB-5889 Add a message in the update script about needing to import CordovaLib when using an IDE.
|
||||
* CB-5793 Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse.
|
||||
* CB-5803 Fix cordova/emulate on windows.
|
||||
* CB-5801 exec->spawn in build to make sure compile errors are shown.
|
||||
* CB-5799 Update version of OkHTTP to 1.3
|
||||
* CB-4910 Update CLI project template to point to config.xml at the root now that it's not in www/ by default.
|
||||
* CB-5504 Adding onDestroy to app plugin to deregister telephonyReceiver
|
||||
* CB-5715 Add Eclipse .project file to create template. For CLI projects, it adds refs for root www/ & config.xml and hides platform versions
|
||||
* CB-5447 Removed android:debuggable=“true” from project template.
|
||||
* CB-5714 Fix of android build when too big output stops build with error due to buffer overflow.
|
||||
* CB-5592 Set MIME type for openExternal when scheme is file:
|
||||
* [CB-5917](https://issues.apache.org/jira/browse/CB-5917) Add a loadUrlIntoView overload that doesn't recreate plugins.
|
||||
* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Make update script find project name instead of using "null" for CordovaLib
|
||||
* [CB-5889](https://issues.apache.org/jira/browse/CB-5889) Add a message in the update script about needing to import CordovaLib when using an IDE.
|
||||
* [CB-5793](https://issues.apache.org/jira/browse/CB-5793) Don't clean before build and change output directory to ant-build to avoid conflicts with Eclipse.
|
||||
* [CB-5803](https://issues.apache.org/jira/browse/CB-5803) Fix cordova/emulate on windows.
|
||||
* [CB-5801](https://issues.apache.org/jira/browse/CB-5801) exec->spawn in build to make sure compile errors are shown.
|
||||
* [CB-5799](https://issues.apache.org/jira/browse/CB-5799) Update version of OkHTTP to 1.3
|
||||
* [CB-4910](https://issues.apache.org/jira/browse/CB-4910) Update CLI project template to point to config.xml at the root now that it's not in www/ by default.
|
||||
* [CB-5504](https://issues.apache.org/jira/browse/CB-5504) Adding onDestroy to app plugin to deregister telephonyReceiver
|
||||
* [CB-5715](https://issues.apache.org/jira/browse/CB-5715) Add Eclipse .project file to create template. For CLI projects, it adds refs for root www/ & config.xml and hides platform versions
|
||||
* [CB-5447](https://issues.apache.org/jira/browse/CB-5447) Removed android:debuggable=“true” from project template.
|
||||
* [CB-5714](https://issues.apache.org/jira/browse/CB-5714) Fix of android build when too big output stops build with error due to buffer overflow.
|
||||
* [CB-5592](https://issues.apache.org/jira/browse/CB-5592) Set MIME type for openExternal when scheme is file:
|
||||
|
||||
### 3.3.0 (Dec 2013) ###
|
||||
|
||||
41 commits from 11 authors. Highlights include:
|
||||
|
||||
* CB-5481 Fix for Cordova trying to get config.xml from the wrong namespace
|
||||
* CB-5487 Enable Remote Debugging when your Android app is debuggable.
|
||||
* CB-5445 Adding onScrollChanged and the ScrollEvent object
|
||||
* CB-5422 Don't require JAVA_HOME to be defined
|
||||
* CB-5490 Add javadoc target to ant script
|
||||
* CB-5471 Deprecated DroidGap class
|
||||
* CB-5255 Prefer Google API targets over android-## targets when building.
|
||||
* CB-5232 Change create script to use Cordova as a Library Project instead of a .jar
|
||||
* CB-5302 Massive movement to get tests working again
|
||||
* CB-4996 Fix paths with spaces while launching on emulator and device
|
||||
* CB-5209 Cannot build Android app if project path contains spaces
|
||||
* [CB-5481](https://issues.apache.org/jira/browse/CB-5481) Fix for Cordova trying to get config.xml from the wrong namespace
|
||||
* [CB-5487](https://issues.apache.org/jira/browse/CB-5487) Enable Remote Debugging when your Android app is debuggable.
|
||||
* [CB-5445](https://issues.apache.org/jira/browse/CB-5445) Adding onScrollChanged and the ScrollEvent object
|
||||
* [CB-5422](https://issues.apache.org/jira/browse/CB-5422) Don't require JAVA_HOME to be defined
|
||||
* [CB-5490](https://issues.apache.org/jira/browse/CB-5490) Add javadoc target to ant script
|
||||
* [CB-5471](https://issues.apache.org/jira/browse/CB-5471) Deprecated DroidGap class
|
||||
* [CB-5255](https://issues.apache.org/jira/browse/CB-5255) Prefer Google API targets over android-## targets when building.
|
||||
* [CB-5232](https://issues.apache.org/jira/browse/CB-5232) Change create script to use Cordova as a Library Project instead of a .jar
|
||||
* [CB-5302](https://issues.apache.org/jira/browse/CB-5302) Massive movement to get tests working again
|
||||
* [CB-4996](https://issues.apache.org/jira/browse/CB-4996) Fix paths with spaces while launching on emulator and device
|
||||
* [CB-5209](https://issues.apache.org/jira/browse/CB-5209) Cannot build Android app if project path contains spaces
|
||||
|
||||
|
||||
### 3.2.0 (Nov 2013) ###
|
||||
|
||||
27 commits from 7 authors. Highlights include:
|
||||
|
||||
* CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.
|
||||
* CB-5191 Deprecate <url-filter>
|
||||
* [CB-5193](https://issues.apache.org/jira/browse/CB-5193) Fix Android WebSQL sometime throwing SECURITY_ERR.
|
||||
* [CB-5191](https://issues.apache.org/jira/browse/CB-5191) Deprecate <url-filter>
|
||||
* Updating shelljs to 0.2.6. Copy now preserves mode bits.
|
||||
* CB-4872 Added android version scripts (android_sdk_version, etc)
|
||||
* CB-5117 Output confirmation message if check_reqs passes.
|
||||
* CB-5080 Find resources in a way that works with aapt's --rename-manifest-package
|
||||
* CB-4527 Don't delete .bat files even when on non-windows platform
|
||||
* CB-4892 Fix create script only escaping the first space instead of all spaces.
|
||||
* [CB-4872](https://issues.apache.org/jira/browse/CB-4872) Added android version scripts (android_sdk_version, etc)
|
||||
* [CB-5117](https://issues.apache.org/jira/browse/CB-5117) Output confirmation message if check_reqs passes.
|
||||
* [CB-5080](https://issues.apache.org/jira/browse/CB-5080) Find resources in a way that works with aapt's --rename-manifest-package
|
||||
* [CB-4527](https://issues.apache.org/jira/browse/CB-4527) Don't delete .bat files even when on non-windows platform
|
||||
* [CB-4892](https://issues.apache.org/jira/browse/CB-4892) Fix create script only escaping the first space instead of all spaces.
|
||||
|
||||
### 3.1.0 (Sept 2013) ###
|
||||
|
||||
55 commits from 9 authors. Highlights include:
|
||||
|
||||
* [CB-4817] Remove unused assets in project template.
|
||||
* [CB-4817](https://issues.apache.org/jira/browse/CB-4817) Remove unused assets in project template.
|
||||
* Fail fast in create script if package name is not com.foo.bar.
|
||||
* [CB-4782] Convert ApplicationInfo.java -> appinfo.js
|
||||
* [CB-4766] Deprecated JSONUtils.java (moved into plugins)
|
||||
* [CB-4765] Deprecated ExifHelper.java (moved into plugins)
|
||||
* [CB-4764] Deprecated DirectoryManager.java (moved into plugins)
|
||||
* [CB-4763] Deprecated FileHelper.java (moved into plugins), Move getMimeType() into CordovaResourceApi.
|
||||
* [CB-4725] Add CordovaWebView.CORDOVA_VERSION constant
|
||||
* [CB-4782](https://issues.apache.org/jira/browse/CB-4782) Convert ApplicationInfo.java -> appinfo.js
|
||||
* [CB-4766](https://issues.apache.org/jira/browse/CB-4766) Deprecated JSONUtils.java (moved into plugins)
|
||||
* [CB-4765](https://issues.apache.org/jira/browse/CB-4765) Deprecated ExifHelper.java (moved into plugins)
|
||||
* [CB-4764](https://issues.apache.org/jira/browse/CB-4764) Deprecated DirectoryManager.java (moved into plugins)
|
||||
* [CB-4763](https://issues.apache.org/jira/browse/CB-4763) Deprecated FileHelper.java (moved into plugins), Move getMimeType() into CordovaResourceApi.
|
||||
* [CB-4725](https://issues.apache.org/jira/browse/CB-4725) Add CordovaWebView.CORDOVA_VERSION constant
|
||||
* Incrementing version check for Android 4.3 API Level 18
|
||||
* [CB-3542] rewrote cli tooling scripts in node
|
||||
* [CB-3542](https://issues.apache.org/jira/browse/CB-3542) rewrote cli tooling scripts in node
|
||||
* Allow CordovaChromeClient subclasses access to CordovaInterface and CordovaWebView members
|
||||
* Refactor CordovaActivity.init so that subclasses can easily override factory methods for webview objects
|
||||
* [CB-4652] Allow default project template to be overridden on create
|
||||
* [CB-4652](https://issues.apache.org/jira/browse/CB-4652) Allow default project template to be overridden on create
|
||||
* Tweak the online bridge to not send excess online events.
|
||||
* [CB-4495] Modify start-emulator script to exit immediately on a fatal emulator error.
|
||||
* [CB-4495](https://issues.apache.org/jira/browse/CB-4495) Modify start-emulator script to exit immediately on a fatal emulator error.
|
||||
* Log WebView IOExceptions only when they are not 404s
|
||||
* Use a higher threshold for slow exec() warnings when debugger is attached.
|
||||
* Fix data URI decoding in CordovaResourceApi
|
||||
* [CB-3819] Made it easier to set SplashScreen delay.
|
||||
* [CB-4013] Fixed loadUrlTimeoutValue preference.
|
||||
* [CB-3819](https://issues.apache.org/jira/browse/CB-3819) Made it easier to set SplashScreen delay.
|
||||
* [CB-4013](https://issues.apache.org/jira/browse/CB-4013) Fixed loadUrlTimeoutValue preference.
|
||||
* Upgrading project to Android 4.3
|
||||
* [CB-4198] bin/create script should be better at handling non-word characters in activity name. Patched windows script as well.
|
||||
* [CB-4198] bin/create should handle spaces in activity better.
|
||||
* [CB-4096] Implemented new unified whitelist for android
|
||||
* [CB-3384] Fix thread assertion when plugins remap URIs
|
||||
* [CB-4198](https://issues.apache.org/jira/browse/CB-4198) bin/create script should be better at handling non-word characters in activity name. Patched windows script as well.
|
||||
* [CB-4198](https://issues.apache.org/jira/browse/CB-4198) bin/create should handle spaces in activity better.
|
||||
* [CB-4096](https://issues.apache.org/jira/browse/CB-4096) Implemented new unified whitelist for android
|
||||
* [CB-3384](https://issues.apache.org/jira/browse/CB-3384) Fix thread assertion when plugins remap URIs
|
||||
|
||||
|
||||
19
appveyor.yml
Normal file
19
appveyor.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
environment:
|
||||
matrix:
|
||||
- nodejs_version: "0.10"
|
||||
- nodejs_version: "0.12"
|
||||
- nodejs_version: "4.2"
|
||||
|
||||
install:
|
||||
# - cinst android-sdk
|
||||
# - echo y | android update sdk -u --filter android-22,android-23
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
- npm install
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- node --version
|
||||
- npm --version
|
||||
- npm run test
|
||||
# - npm run test-build
|
||||
@@ -28,7 +28,7 @@ var argv = require('nopt')({
|
||||
'shared' : Boolean,
|
||||
'link' : Boolean,
|
||||
'activity-name' : [String, undefined]
|
||||
});
|
||||
}, { 'd' : '--verbose' });
|
||||
|
||||
if (argv.help || argv.argv.remain.length === 0) {
|
||||
console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name> [<template_path>] [--activity-name <activity_name>] [--link]');
|
||||
@@ -53,4 +53,6 @@ var options = {
|
||||
activityName: argv['activity-name']
|
||||
};
|
||||
|
||||
require('./templates/cordova/loggingHelper').adjustLoggerLevel(argv);
|
||||
|
||||
Api.createPlatform(argv.argv.remain[0], config, options).done();
|
||||
|
||||
@@ -142,22 +142,20 @@ module.exports.check_java = function() {
|
||||
}
|
||||
}
|
||||
}).then(function() {
|
||||
var msg =
|
||||
'Failed to run "java -version", make sure that you have a JDK installed.\n' +
|
||||
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
|
||||
if (process.env['JAVA_HOME']) {
|
||||
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
|
||||
}
|
||||
return tryCommand('java -version', msg)
|
||||
.then(function() {
|
||||
var msg =
|
||||
'Failed to run "javac -version", make sure that you have a JDK installed.\n' +
|
||||
'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n';
|
||||
if (process.env['JAVA_HOME']) {
|
||||
msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n';
|
||||
}
|
||||
// We use tryCommand with catchStderr = true, because
|
||||
// javac writes version info to stderr instead of stdout
|
||||
return tryCommand('javac -version', msg, true);
|
||||
}).then(function (output) {
|
||||
var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
|
||||
return match && match[1];
|
||||
return tryCommand('javac -version', msg, true)
|
||||
.then(function (output) {
|
||||
var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output);
|
||||
return match && match[1];
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Returns a promise.
|
||||
@@ -238,13 +236,13 @@ module.exports.getAbsoluteAndroidCmd = function () {
|
||||
return cmd.replace(/(\s)/g, '\\$1');
|
||||
};
|
||||
|
||||
module.exports.check_android_target = function(valid_target) {
|
||||
module.exports.check_android_target = function(originalError) {
|
||||
// valid_target can look like:
|
||||
// android-19
|
||||
// android-L
|
||||
// Google Inc.:Google APIs:20
|
||||
// Google Inc.:Glass Development Kit Preview:20
|
||||
if (!valid_target) valid_target = module.exports.get_target();
|
||||
var valid_target = module.exports.get_target();
|
||||
var msg = 'Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.';
|
||||
return tryCommand('android list targets --compact', msg)
|
||||
.then(function(output) {
|
||||
@@ -254,18 +252,22 @@ module.exports.check_android_target = function(valid_target) {
|
||||
}
|
||||
|
||||
var androidCmd = module.exports.getAbsoluteAndroidCmd();
|
||||
throw new CordovaError('Please install Android target: "' + valid_target + '".\n\n' +
|
||||
var msg = 'Please install Android target: "' + valid_target + '".\n\n' +
|
||||
'Hint: Open the SDK manager by running: ' + androidCmd + '\n' +
|
||||
'You will require:\n' +
|
||||
'1. "SDK Platform" for ' + valid_target + '\n' +
|
||||
'2. "Android SDK Platform-tools (latest)\n' +
|
||||
'3. "Android SDK Build-tools" (latest)');
|
||||
'3. "Android SDK Build-tools" (latest)';
|
||||
if (originalError) {
|
||||
msg = originalError + '\n' + msg;
|
||||
}
|
||||
throw new CordovaError(msg);
|
||||
});
|
||||
};
|
||||
|
||||
// Returns a promise.
|
||||
module.exports.run = function() {
|
||||
return Q.all([this.check_java(), this.check_android().then(this.check_android_target)])
|
||||
return Q.all([this.check_java(), this.check_android()])
|
||||
.then(function() {
|
||||
console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
|
||||
console.log('JAVA_HOME=' + process.env['JAVA_HOME']);
|
||||
|
||||
@@ -246,7 +246,7 @@ exports.create = function(project_path, config, options, events) {
|
||||
events.emit('log', '\tActivity: ' + safe_activity_name);
|
||||
events.emit('log', '\tAndroid target: ' + target_api);
|
||||
|
||||
events.emit('verbose', 'Copying template files...');
|
||||
events.emit('verbose', 'Copying android template project to ' + project_path);
|
||||
|
||||
setShellFatal(true, function() {
|
||||
var project_template_dir = options.customTemplate || path.join(ROOT, 'bin', 'templates', 'project');
|
||||
|
||||
253
bin/templates/cordova/Api.js
vendored
253
bin/templates/cordova/Api.js
vendored
@@ -17,23 +17,29 @@
|
||||
under the License.
|
||||
*/
|
||||
|
||||
var Q = require('q');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var shell = require('shelljs');
|
||||
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
var PlatformJson = require('cordova-common').PlatformJson;
|
||||
var ActionStack = require('cordova-common').ActionStack;
|
||||
var AndroidProject = require('./lib/AndroidProject');
|
||||
var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
|
||||
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
|
||||
var PluginManager = require('cordova-common').PluginManager;
|
||||
|
||||
var ConsoleLogger = require('./lib/ConsoleLogger');
|
||||
var pluginHandlers = require('./lib/pluginHandlers');
|
||||
var CordovaLogger = require('cordova-common').CordovaLogger;
|
||||
var selfEvents = require('cordova-common').events;
|
||||
|
||||
var PLATFORM = 'android';
|
||||
|
||||
function setupEvents(externalEventEmitter) {
|
||||
if (externalEventEmitter) {
|
||||
// This will make the platform internal events visible outside
|
||||
selfEvents.forwardEventsTo(externalEventEmitter);
|
||||
return externalEventEmitter;
|
||||
}
|
||||
|
||||
// There is no logger if external emitter is not present,
|
||||
// so attach a console logger
|
||||
CordovaLogger.get().subscribe(selfEvents);
|
||||
return selfEvents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class, that acts as abstraction over particular platform. Encapsulates the
|
||||
* platform's properties and methods.
|
||||
@@ -48,13 +54,8 @@ var PLATFORM = 'android';
|
||||
function Api(platform, platformRootDir, events) {
|
||||
this.platform = PLATFORM;
|
||||
this.root = path.resolve(__dirname, '..');
|
||||
this.events = events || ConsoleLogger.get();
|
||||
// NOTE: trick to share one EventEmitter instance across all js code
|
||||
require('cordova-common').events = this.events;
|
||||
|
||||
this._platformJson = PlatformJson.load(this.root, platform);
|
||||
this._pluginInfoProvider = new PluginInfoProvider();
|
||||
this._munger = new PlatformMunger(this.platform, this.root, this._platformJson, this._pluginInfoProvider);
|
||||
setupEvents(events);
|
||||
|
||||
var self = this;
|
||||
|
||||
@@ -91,8 +92,10 @@ function Api(platform, platformRootDir, events) {
|
||||
* instance or rejected with CordovaError.
|
||||
*/
|
||||
Api.createPlatform = function (destination, config, options, events) {
|
||||
events = setupEvents(events);
|
||||
|
||||
return require('../../lib/create')
|
||||
.create(destination, config, options, events || ConsoleLogger.get())
|
||||
.create(destination, config, options, events)
|
||||
.then(function (destination) {
|
||||
var PlatformApi = require(path.resolve(destination, 'cordova/Api'));
|
||||
return new PlatformApi(PLATFORM, destination, events);
|
||||
@@ -116,8 +119,10 @@ Api.createPlatform = function (destination, config, options, events) {
|
||||
* instance or rejected with CordovaError.
|
||||
*/
|
||||
Api.updatePlatform = function (destination, options, events) {
|
||||
events = setupEvents(events);
|
||||
|
||||
return require('../../lib/create')
|
||||
.update(destination, options, events || ConsoleLogger.get())
|
||||
.update(destination, options, events)
|
||||
.then(function (destination) {
|
||||
var PlatformApi = require(path.resolve(destination, 'cordova/Api'));
|
||||
return new PlatformApi('android', destination, events);
|
||||
@@ -155,8 +160,8 @@ Api.prototype.getPlatformInfo = function () {
|
||||
* @return {Promise} Return a promise either fulfilled, or rejected with
|
||||
* CordovaError instance.
|
||||
*/
|
||||
Api.prototype.prepare = function (cordovaProject) {
|
||||
return require('./lib/prepare').prepare.call(this, cordovaProject);
|
||||
Api.prototype.prepare = function (cordovaProject, prepareOptions) {
|
||||
return require('./lib/prepare').prepare.call(this, cordovaProject, prepareOptions);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -180,56 +185,25 @@ Api.prototype.prepare = function (cordovaProject) {
|
||||
* CordovaError instance.
|
||||
*/
|
||||
Api.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'));
|
||||
var project = AndroidProject.getProjectFile(this.root);
|
||||
|
||||
installOptions = installOptions || {};
|
||||
installOptions.variables = installOptions.variables || {};
|
||||
// Add PACKAGE_NAME variable into vars
|
||||
if (!installOptions.variables.PACKAGE_NAME) {
|
||||
installOptions.variables.PACKAGE_NAME = project.getPackageName();
|
||||
}
|
||||
|
||||
var self = this;
|
||||
var actions = new ActionStack();
|
||||
var project = AndroidProject.getProjectFile(this.root);
|
||||
return PluginManager.get(this.platform, this.locations, project)
|
||||
.addPlugin(plugin, installOptions)
|
||||
.then(function () {
|
||||
if (plugin.getFrameworks(this.platform).length === 0) return;
|
||||
|
||||
// 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();
|
||||
|
||||
if (plugin.getFrameworks(self.platform).length > 0) {
|
||||
self.events.emit('verbose', 'Updating build files since android plugin contained <framework>');
|
||||
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
|
||||
require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
|
||||
}
|
||||
|
||||
var targetDir = installOptions.usePlatformWww ?
|
||||
self.locations.platformWww :
|
||||
self.locations.www;
|
||||
|
||||
self._addModulesInfo(plugin, targetDir);
|
||||
});
|
||||
}.bind(this))
|
||||
// CB-11022 Return truthy value to prevent running prepare after
|
||||
.thenResolve(true);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -246,48 +220,17 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
|
||||
* CordovaError instance.
|
||||
*/
|
||||
Api.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 = AndroidProject.getProjectFile(this.root);
|
||||
return PluginManager.get(this.platform, this.locations, project)
|
||||
.removePlugin(plugin, uninstallOptions)
|
||||
.then(function () {
|
||||
if (plugin.getFrameworks(this.platform).length === 0) return;
|
||||
|
||||
// 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();
|
||||
|
||||
if (plugin.getFrameworks(self.platform).length > 0) {
|
||||
self.events.emit('verbose', 'Updating build files since android plugin contained <framework>');
|
||||
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
|
||||
require('./lib/builders/builders').getBuilder('gradle').prepBuildFiles();
|
||||
}
|
||||
|
||||
var targetDir = uninstallOptions.usePlatformWww ?
|
||||
self.locations.platformWww :
|
||||
self.locations.www;
|
||||
|
||||
self._removeModulesInfo(plugin, targetDir);
|
||||
});
|
||||
}.bind(this))
|
||||
// CB-11022 Return truthy value to prevent running prepare after
|
||||
.thenResolve(true);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -385,6 +328,9 @@ Api.prototype.clean = function(cleanOptions) {
|
||||
return require('./lib/check_reqs').run()
|
||||
.then(function () {
|
||||
return require('./lib/build').runClean.call(self, cleanOptions);
|
||||
})
|
||||
.then(function () {
|
||||
return require('./lib/prepare').clean.call(self, cleanOptions);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -401,104 +347,3 @@ Api.prototype.requirements = function() {
|
||||
};
|
||||
|
||||
module.exports = Api;
|
||||
|
||||
/**
|
||||
* 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} targetDir The directory, where updated cordova_plugins.js
|
||||
* should be written to.
|
||||
*/
|
||||
Api.prototype._addModulesInfo = function(plugin, targetDir) {
|
||||
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
|
||||
};
|
||||
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(targetDir);
|
||||
this._platformJson.save();
|
||||
};
|
||||
|
||||
/**
|
||||
* 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} targetDir The directory, where updated cordova_plugins.js
|
||||
* should be written to.
|
||||
*/
|
||||
Api.prototype._removeModulesInfo = function(plugin, targetDir) {
|
||||
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(targetDir);
|
||||
this._platformJson.save();
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetches all installed modules, generates cordova_plugins contents and writes
|
||||
* it to file.
|
||||
*
|
||||
* @param {String} targetDir Directory, where write cordova_plugins.js to.
|
||||
* Ususally it is either <platform>/www or <platform>/platform_www
|
||||
* directories.
|
||||
*/
|
||||
Api.prototype._writePluginModules = function (targetDir) {
|
||||
// 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.
|
||||
|
||||
shell.mkdir('-p', targetDir);
|
||||
fs.writeFileSync(path.join(targetDir, 'cordova_plugins.js'), final_contents, 'utf-8');
|
||||
};
|
||||
|
||||
@@ -41,6 +41,8 @@ var buildOpts = nopt({
|
||||
// Make buildOptions compatible with PlatformApi build method spec
|
||||
buildOpts.argv = buildOpts.argv.original;
|
||||
|
||||
require('./loggingHelper').adjustLoggerLevel(buildOpts);
|
||||
|
||||
new Api().build(buildOpts)
|
||||
.catch(function(err) {
|
||||
console.error(err.stack);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
var Api = require('./Api');
|
||||
var path = require('path');
|
||||
var nopt = require('nopt');
|
||||
|
||||
// Support basic help commands
|
||||
if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
|
||||
@@ -29,7 +30,21 @@ if(['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >=
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
new Api().clean({argv: process.argv.slice(2)})
|
||||
// Do some basic argument parsing
|
||||
var opts = nopt({
|
||||
'verbose' : Boolean,
|
||||
'silent' : Boolean
|
||||
}, { 'd' : '--verbose' });
|
||||
|
||||
// Make buildOptions compatible with PlatformApi clean method spec
|
||||
opts.argv = opts.argv.original;
|
||||
|
||||
// Skip cleaning prepared files when not invoking via cordova CLI.
|
||||
opts.noPrepare = true;
|
||||
|
||||
require('./loggingHelper').adjustLoggerLevel(opts);
|
||||
|
||||
new Api().clean(opts)
|
||||
.catch(function(err) {
|
||||
console.error(err.stack);
|
||||
process.exit(2);
|
||||
|
||||
19
bin/templates/cordova/lib/Adb.js
vendored
19
bin/templates/cordova/lib/Adb.js
vendored
@@ -56,25 +56,34 @@ Adb.devices = function (opts) {
|
||||
};
|
||||
|
||||
Adb.install = function (target, packagePath, opts) {
|
||||
events.emit('verbose', 'Installing apk ' + packagePath + ' on ' + target + '...');
|
||||
events.emit('verbose', 'Installing apk ' + packagePath + ' on target ' + target + '...');
|
||||
var args = ['-s', target, 'install'];
|
||||
if (opts && opts.replace) args.push('-r');
|
||||
return spawn('adb', args.concat(packagePath), {cwd: os.tmpdir()})
|
||||
.then(function(output) {
|
||||
// 'adb install' seems to always returns no error, even if installation fails
|
||||
// so we catching output to detect installation failure
|
||||
if (output.match(/Failure/))
|
||||
if (output.match(/Failure/)) {
|
||||
if (output.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) {
|
||||
output += '\n\n' + 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' +
|
||||
' or sign and deploy the unsigned apk manually using Android tools.';
|
||||
} else if (output.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) {
|
||||
output += '\n\n' + 'You\'re trying to install apk with a lower versionCode that is already installed.' +
|
||||
'\nEither uninstall an app or increment the versionCode.';
|
||||
}
|
||||
|
||||
return Q.reject(new CordovaError('Failed to install apk to device: ' + output));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Adb.uninstall = function (target, packageId) {
|
||||
events.emit('verbose', 'Uninstalling ' + packageId + ' from ' + target + '...');
|
||||
events.emit('verbose', 'Uninstalling package ' + packageId + ' from target ' + target + '...');
|
||||
return spawn('adb', ['-s', target, 'uninstall', packageId], {cwd: os.tmpdir()});
|
||||
};
|
||||
|
||||
Adb.shell = function (target, shellCommand) {
|
||||
events.emit('verbose', 'Running command "' + shellCommand + '" on ' + target + '...');
|
||||
events.emit('verbose', 'Running adb shell command "' + shellCommand + '" on target ' + target + '...');
|
||||
var args = ['-s', target, 'shell'];
|
||||
shellCommand = shellCommand.split(/\s+/);
|
||||
return spawn('adb', args.concat(shellCommand), {cwd: os.tmpdir()})
|
||||
@@ -85,7 +94,7 @@ Adb.shell = function (target, shellCommand) {
|
||||
};
|
||||
|
||||
Adb.start = function (target, activityName) {
|
||||
events.emit('verbose', 'Starting application "' + activityName + '" on ' + target + '...');
|
||||
events.emit('verbose', 'Starting application "' + activityName + '" on target ' + target + '...');
|
||||
return Adb.shell(target, 'am start -W -a android.intent.action.MAIN -n' + activityName)
|
||||
.catch(function (output) {
|
||||
return Q.reject(new CordovaError('Failed to start application "' +
|
||||
|
||||
2
bin/templates/cordova/lib/AndroidManifest.js
vendored
2
bin/templates/cordova/lib/AndroidManifest.js
vendored
@@ -28,7 +28,7 @@ function AndroidManifest(path) {
|
||||
this.path = path;
|
||||
this.doc = xml.parseElementtreeSync(path);
|
||||
if (this.doc.getroot().tag !== 'manifest') {
|
||||
throw new Error(path + ' has incorrect root node name (expected "manifest")');
|
||||
throw new Error('AndroidManifest at ' + path + ' has incorrect root node name (expected "manifest")');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
bin/templates/cordova/lib/AndroidProject.js
vendored
9
bin/templates/cordova/lib/AndroidProject.js
vendored
@@ -21,6 +21,7 @@ var fs = require('fs');
|
||||
var path = require('path');
|
||||
var properties_parser = require('properties-parser');
|
||||
var AndroidManifest = require('./AndroidManifest');
|
||||
var pluginHandlers = require('./pluginHandlers');
|
||||
|
||||
var projectFileCache = {};
|
||||
|
||||
@@ -180,5 +181,13 @@ AndroidProject.prototype._getPropertiesFile = function (filename) {
|
||||
return this._propertiesEditors[filename];
|
||||
};
|
||||
|
||||
AndroidProject.prototype.getInstaller = function (type) {
|
||||
return pluginHandlers.getInstaller(type);
|
||||
};
|
||||
|
||||
AndroidProject.prototype.getUninstaller = function (type) {
|
||||
return pluginHandlers.getUninstaller(type);
|
||||
};
|
||||
|
||||
|
||||
module.exports = AndroidProject;
|
||||
|
||||
75
bin/templates/cordova/lib/ConsoleLogger.js
vendored
75
bin/templates/cordova/lib/ConsoleLogger.js
vendored
@@ -1,75 +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.
|
||||
*/
|
||||
|
||||
var loggerInstance;
|
||||
var util = require('util');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
|
||||
/**
|
||||
* @class ConsoleLogger
|
||||
* @extends EventEmitter
|
||||
*
|
||||
* Implementing basic logging for platform. Inherits regular NodeJS
|
||||
* EventEmitter. All events, emitted on this class instance are immediately
|
||||
* logged to console.
|
||||
*
|
||||
* Also attaches handler to process' uncaught exceptions, so these exceptions
|
||||
* logged to console similar to regular error events.
|
||||
*/
|
||||
function ConsoleLogger() {
|
||||
EventEmitter.call(this);
|
||||
|
||||
var isVerbose = process.argv.indexOf('-d') >= 0 || process.argv.indexOf('--verbose') >= 0;
|
||||
// For CordovaError print only the message without stack trace unless we
|
||||
// are in a verbose mode.
|
||||
process.on('uncaughtException', function(err){
|
||||
if ((err instanceof CordovaError) && isVerbose) {
|
||||
console.error(err.stack);
|
||||
} else {
|
||||
console.error(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
this.on('results', console.log);
|
||||
this.on('verbose', function () {
|
||||
if (isVerbose)
|
||||
console.log.apply(console, arguments);
|
||||
});
|
||||
this.on('info', console.log);
|
||||
this.on('log', console.log);
|
||||
this.on('warn', console.warn);
|
||||
}
|
||||
util.inherits(ConsoleLogger, EventEmitter);
|
||||
|
||||
/**
|
||||
* Returns already instantiated/newly created instance of ConsoleLogger class.
|
||||
* This method should be used instead of creating ConsoleLogger directly,
|
||||
* otherwise we'll get multiple handlers attached to process'
|
||||
* uncaughtException
|
||||
*
|
||||
* @return {ConsoleLogger} New or already created instance of ConsoleLogger
|
||||
*/
|
||||
ConsoleLogger.get = function () {
|
||||
loggerInstance = loggerInstance || new ConsoleLogger();
|
||||
return loggerInstance;
|
||||
};
|
||||
|
||||
module.exports = ConsoleLogger;
|
||||
21
bin/templates/cordova/lib/build.js
vendored
21
bin/templates/cordova/lib/build.js
vendored
@@ -39,7 +39,7 @@ function parseOpts(options, resolvedTarget, projectRoot) {
|
||||
prepenv: Boolean,
|
||||
versionCode: String,
|
||||
minSdkVersion: String,
|
||||
gradleArg: String,
|
||||
gradleArg: [String, Array],
|
||||
keystore: path,
|
||||
alias: String,
|
||||
storePassword: String,
|
||||
@@ -66,8 +66,9 @@ function parseOpts(options, resolvedTarget, projectRoot) {
|
||||
if (options.argv.minSdkVersion)
|
||||
ret.extraArgs.push('-PcdvMinSdkVersion=' + options.argv.minSdkVersion);
|
||||
|
||||
if (options.argv.gradleArg)
|
||||
ret.extraArgs.push(options.argv.gradleArg);
|
||||
if (options.argv.gradleArg) {
|
||||
ret.extraArgs = ret.extraArgs.concat(options.argv.gradleArg);
|
||||
}
|
||||
|
||||
var packageArgs = {};
|
||||
|
||||
@@ -89,8 +90,7 @@ function parseOpts(options, resolvedTarget, projectRoot) {
|
||||
}
|
||||
events.emit('log', 'Reading build config file: '+ path.resolve(buildConfig));
|
||||
var buildjson = fs.readFileSync(buildConfig, 'utf8');
|
||||
//var config = JSON.parse(fs.readFileSync(buildConfig, 'utf8'));
|
||||
var config = JSON.parse(buildjson);
|
||||
var config = JSON.parse(buildjson.replace(/^\ufeff/, '')); // Remove BOM
|
||||
if (config.android && config.android[ret.buildType]) {
|
||||
var androidInfo = config.android[ret.buildType];
|
||||
if(androidInfo.keystore && !packageArgs.keystore) {
|
||||
@@ -149,17 +149,16 @@ module.exports.runClean = function(options) {
|
||||
module.exports.run = function(options, optResolvedTarget) {
|
||||
var opts = parseOpts(options, optResolvedTarget, this.root);
|
||||
var builder = builders.getBuilder(opts.buildMethod);
|
||||
var self = this;
|
||||
return builder.prepEnv(opts)
|
||||
.then(function() {
|
||||
if (opts.prepEnv) {
|
||||
self.events.emit('verbose', 'Build file successfully prepared.');
|
||||
events.emit('verbose', 'Build file successfully prepared.');
|
||||
return;
|
||||
}
|
||||
return builder.build(opts)
|
||||
.then(function() {
|
||||
var apkPaths = builder.findOutputApks(opts.buildType, opts.arch);
|
||||
self.events.emit('log', 'Built the following apk(s): \n\t' + apkPaths.join('\n\t'));
|
||||
events.emit('log', 'Built the following apk(s): \n\t' + apkPaths.join('\n\t'));
|
||||
return {
|
||||
apkPaths: apkPaths,
|
||||
buildType: opts.buildType,
|
||||
@@ -189,18 +188,18 @@ module.exports.detectArchitecture = function(target) {
|
||||
// adb kill-server doesn't seem to do the trick.
|
||||
// Could probably find a x-platform version of killall, but I'm not actually
|
||||
// sure that this scenario even happens on non-OSX machines.
|
||||
events.emit('verbose', 'adb timed out while detecting device/emulator architecture. Killing adb and trying again.');
|
||||
return spawn('killall', ['adb'])
|
||||
.then(function() {
|
||||
events.emit('verbose', 'adb seems hung. retrying.');
|
||||
return helper()
|
||||
.then(null, function() {
|
||||
// The double kill is sadly often necessary, at least on mac.
|
||||
events.emit('warn', 'Now device not found... restarting adb again.');
|
||||
events.emit('warn', 'adb timed out a second time while detecting device/emulator architecture. Killing adb and trying again.');
|
||||
return spawn('killall', ['adb'])
|
||||
.then(function() {
|
||||
return helper()
|
||||
.then(null, function() {
|
||||
return Q.reject(new CordovaError('USB is flakey. Try unplugging & replugging the device.'));
|
||||
return Q.reject(new CordovaError('adb timed out a third time while detecting device/emulator architecture. Try unplugging & replugging the device.'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
19
bin/templates/cordova/lib/builders/AntBuilder.js
vendored
19
bin/templates/cordova/lib/builders/AntBuilder.js
vendored
@@ -79,7 +79,7 @@ AntBuilder.prototype.prepEnv = function(opts) {
|
||||
writeBuildXml(path.join(self.root, subProjects[i]));
|
||||
}
|
||||
if (propertiesObj.systemLibs.length > 0) {
|
||||
throw new CordovaError('Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.');
|
||||
throw new CordovaError('Project contains at least one plugin that requires a system library. This is not supported with ANT. Use gradle instead.');
|
||||
}
|
||||
|
||||
var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
|
||||
@@ -107,7 +107,22 @@ AntBuilder.prototype.build = function(opts) {
|
||||
var args = this.getArgs(opts.buildType == 'debug' ? 'debug' : 'release', opts);
|
||||
return check_reqs.check_ant()
|
||||
.then(function() {
|
||||
return spawn('ant', args, {stdio: 'inherit'});
|
||||
return spawn('ant', args, {stdio: 'pipe'});
|
||||
}).progress(function (stdio){
|
||||
if (stdio.stderr) {
|
||||
process.stderr.write(stdio.stderr);
|
||||
} else {
|
||||
process.stdout.write(stdio.stdout);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
if (error.toString().indexOf('Unable to resolve project target') >= 0) {
|
||||
return check_reqs.check_android_target(error).then(function() {
|
||||
// If due to some odd reason - check_android_target succeeds
|
||||
// we should still fail here.
|
||||
return Q.reject(error);
|
||||
});
|
||||
}
|
||||
return Q.reject(error);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -93,6 +93,14 @@ GenericBuilder.prototype.extractRealProjectNameFromManifest = function () {
|
||||
module.exports = GenericBuilder;
|
||||
|
||||
function apkSorter(fileA, fileB) {
|
||||
// De-prioritize unsigned builds
|
||||
var unsignedRE = /-unsigned/;
|
||||
if (unsignedRE.exec(fileA)) {
|
||||
return 1;
|
||||
} else if (unsignedRE.exec(fileB)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var timeDiff = fs.statSync(fileA).mtime - fs.statSync(fileB).mtime;
|
||||
return timeDiff === 0 ? fileA.length - fileB.length : timeDiff;
|
||||
}
|
||||
@@ -128,7 +136,8 @@ function findOutputApksHelper(dir, build_type, arch) {
|
||||
return !!/-x86|-arm/.exec(path.basename(p)) == archSpecific;
|
||||
/*jshint +W018 */
|
||||
});
|
||||
if (archSpecific && ret.length > 1) {
|
||||
|
||||
if (archSpecific && ret.length > 1 && arch) {
|
||||
ret = ret.filter(function(p) {
|
||||
return path.basename(p).indexOf('-' + arch) != -1;
|
||||
});
|
||||
|
||||
@@ -22,7 +22,6 @@ var fs = require('fs');
|
||||
var util = require('util');
|
||||
var path = require('path');
|
||||
var shell = require('shelljs');
|
||||
var child_process = require('child_process');
|
||||
var spawn = require('cordova-common').superspawn.spawn;
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
var check_reqs = require('../check_reqs');
|
||||
@@ -162,7 +161,7 @@ GradleBuilder.prototype.prepEnv = function(opts) {
|
||||
// For some reason, using ^ and $ don't work. This does the job, though.
|
||||
var distributionUrlRegex = /distributionUrl.*zip/;
|
||||
/*jshint -W069 */
|
||||
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';
|
||||
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.13-all.zip';
|
||||
/*jshint +W069 */
|
||||
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
|
||||
shell.chmod('u+w', gradleWrapperPropertiesPath);
|
||||
@@ -185,7 +184,35 @@ GradleBuilder.prototype.prepEnv = function(opts) {
|
||||
GradleBuilder.prototype.build = function(opts) {
|
||||
var wrapper = path.join(this.root, 'gradlew');
|
||||
var args = this.getArgs(opts.buildType == 'debug' ? 'debug' : 'release', opts);
|
||||
return spawnAndSuppressJavaOptions(wrapper, args);
|
||||
|
||||
return spawn(wrapper, args, {stdio: 'pipe'})
|
||||
.progress(function (stdio){
|
||||
if (stdio.stderr) {
|
||||
/*
|
||||
* Workaround for the issue with Java printing some unwanted information to
|
||||
* stderr instead of stdout.
|
||||
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
|
||||
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
|
||||
* explanation.
|
||||
*/
|
||||
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
|
||||
if (suppressThisLine) {
|
||||
return;
|
||||
}
|
||||
process.stderr.write(stdio.stderr);
|
||||
} else {
|
||||
process.stdout.write(stdio.stdout);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
if (error.toString().indexOf('failed to find target with hash string') >= 0) {
|
||||
return check_reqs.check_android_target(error).then(function() {
|
||||
// If due to some odd reason - check_android_target succeeds
|
||||
// we should still fail here.
|
||||
return Q.reject(error);
|
||||
});
|
||||
}
|
||||
return Q.reject(error);
|
||||
});
|
||||
};
|
||||
|
||||
GradleBuilder.prototype.clean = function(opts) {
|
||||
@@ -212,64 +239,3 @@ module.exports = GradleBuilder;
|
||||
function isAutoGenerated(file) {
|
||||
return fs.existsSync(file) && fs.readFileSync(file, 'utf8').indexOf(MARKER) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* A special superspawn-like implementation, required to workaround the issue
|
||||
* with Java printing some unwanted information to stderr instead of stdout.
|
||||
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being
|
||||
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
|
||||
* explanation.
|
||||
*
|
||||
* This function needed because superspawn does not provide a way to get and
|
||||
* manage spawned process output streams. There is a CB-10052 which describes
|
||||
* an improvements for superspawn, needed to get rid of this.
|
||||
* TODO: Once this improvement added to cordova-common, we could remove this functionality.
|
||||
*
|
||||
* @param {String} cmd A command to spawn
|
||||
* @param {String[]} args Command arguments. Note that on Windows arguments
|
||||
* will be concatenated into string and passed to 'cmd.exe' along with '/s'
|
||||
* and '/c' switches for proper space-in-path handling
|
||||
*
|
||||
* @return {Promise} A promise, rejected with error message if
|
||||
* underlying command exits with nonzero exit code, fulfilled otherwise
|
||||
*/
|
||||
function spawnAndSuppressJavaOptions(cmd, args) {
|
||||
var opts = { stdio: 'pipe' };
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
// Work around spawn not being able to find .bat files.
|
||||
var joinedArgs = [cmd]
|
||||
.concat(args)
|
||||
.map(function(a){
|
||||
// Add quotes to arguments which contains whitespaces
|
||||
if (/^[^"].* .*[^"]/.test(a)) return '"' + a + '"';
|
||||
return a;
|
||||
}).join(' ');
|
||||
|
||||
args = ['/s', '/c'].concat('"' + joinedArgs + '"');
|
||||
cmd = 'cmd';
|
||||
opts.windowsVerbatimArguments = true;
|
||||
}
|
||||
|
||||
return Q.Promise(function (resolve, reject) {
|
||||
var proc = child_process.spawn(cmd, args, opts);
|
||||
|
||||
proc.stdout.on('data', process.stdout.write.bind(process.stdout));
|
||||
proc.stderr.on('data', function (data) {
|
||||
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(data.toString());
|
||||
if (suppressThisLine) {
|
||||
return;
|
||||
}
|
||||
|
||||
process.stderr.write(data);
|
||||
});
|
||||
|
||||
proc.on('exit', function(code) {
|
||||
if (code) {
|
||||
reject('Error code ' + code + ' for command: ' + cmd + ' with args: ' + args);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
1
bin/templates/cordova/lib/device.js
vendored
1
bin/templates/cordova/lib/device.js
vendored
@@ -89,6 +89,7 @@ module.exports.install = function(target, buildResults) {
|
||||
var pkgName = manifest.getPackageId();
|
||||
var launchName = pkgName + '/.' + manifest.getActivity().getName();
|
||||
events.emit('log', 'Using apk: ' + apk_path);
|
||||
events.emit('log', 'Package name: ' + pkgName);
|
||||
|
||||
return Adb.install(resolvedTarget.target, apk_path, {replace: true})
|
||||
.catch(function (error) {
|
||||
|
||||
117
bin/templates/cordova/lib/emulator.js
vendored
117
bin/templates/cordova/lib/emulator.js
vendored
@@ -62,13 +62,18 @@ module.exports.list_images = function() {
|
||||
var img_obj = {};
|
||||
if (response[i].match(/Name:\s/)) {
|
||||
img_obj['name'] = response[i].split('Name: ')[1].replace('\r', '');
|
||||
if (response[i + 1].match(/Device:\s/)) {
|
||||
i++;
|
||||
img_obj['device'] = response[i].split('Device: ')[1].replace('\r', '');
|
||||
}
|
||||
if (response[i + 1].match(/Path:\s/)) {
|
||||
i++;
|
||||
img_obj['path'] = response[i].split('Path: ')[1].replace('\r', '');
|
||||
}
|
||||
if (response[i + 1].match(/\(API\slevel\s/)) {
|
||||
if (response[i + 1].match(/\(API\slevel\s/) || (response[i + 2] && response[i + 2].match(/\(API\slevel\s/))) {
|
||||
i++;
|
||||
img_obj['target'] = response[i].replace('\r', '');
|
||||
var secondLine = response[i + 1].match(/\(API\slevel\s/) ? response[i + 1] : '';
|
||||
img_obj['target'] = (response[i] + secondLine).split('Target: ')[1].replace('\r', '');
|
||||
}
|
||||
if (response[i + 1].match(/ABI:\s/)) {
|
||||
i++;
|
||||
@@ -142,6 +147,25 @@ module.exports.list_targets = function() {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Gets unused port for android emulator, between 5554 and 5584
|
||||
* Returns a promise.
|
||||
*/
|
||||
module.exports.get_available_port = function () {
|
||||
var self = this;
|
||||
|
||||
return self.list_started()
|
||||
.then(function (emulators) {
|
||||
for (var p = 5584; p >= 5554; p-=2) {
|
||||
if (emulators.indexOf('emulator-' + p) === -1) {
|
||||
events.emit('verbose', 'Found available port: ' + p);
|
||||
return p;
|
||||
}
|
||||
}
|
||||
throw new CordovaError('Could not find an available avd port');
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Starts an emulator with the given ID,
|
||||
* and returns the started ID of that emulator.
|
||||
@@ -173,23 +197,24 @@ module.exports.start = function(emulator_ID, boot_timeout) {
|
||||
'HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver\n'));
|
||||
});
|
||||
}).then(function(emulatorId) {
|
||||
var uuid = 'cordova_emulator_' + new Date().getTime();
|
||||
var uuidProp = 'emu.uuid=' + uuid;
|
||||
var args = ['-avd', emulatorId, '-prop', uuidProp];
|
||||
// Don't wait for it to finish, since the emulator will probably keep running for a long time.
|
||||
child_process
|
||||
.spawn('emulator', args, { stdio: 'inherit', detached: true })
|
||||
.unref();
|
||||
return self.get_available_port()
|
||||
.then(function (port) {
|
||||
var args = ['-avd', emulatorId, '-port', port];
|
||||
// Don't wait for it to finish, since the emulator will probably keep running for a long time.
|
||||
child_process
|
||||
.spawn('emulator', args, { stdio: 'inherit', detached: true })
|
||||
.unref();
|
||||
|
||||
// wait for emulator to start
|
||||
events.emit('log', 'Waiting for emulator...');
|
||||
return self.wait_for_emulator(uuid);
|
||||
// wait for emulator to start
|
||||
events.emit('log', 'Waiting for emulator to start...');
|
||||
return self.wait_for_emulator(port);
|
||||
});
|
||||
}).then(function(emulatorId) {
|
||||
if (!emulatorId)
|
||||
return Q.reject(new CordovaError('Failed to start emulator'));
|
||||
|
||||
//wait for emulator to boot up
|
||||
process.stdout.write('Booting up emulator (this may take a while)...');
|
||||
process.stdout.write('Waiting for emulator to boot (this may take a while)...');
|
||||
return self.wait_for_boot(emulatorId, boot_timeout)
|
||||
.then(function(success) {
|
||||
if (success) {
|
||||
@@ -209,29 +234,29 @@ module.exports.start = function(emulator_ID, boot_timeout) {
|
||||
};
|
||||
|
||||
/*
|
||||
* Waits for an emulator with given uuid to apear on the started-emulator list.
|
||||
* Returns a promise with this emulator's ID.
|
||||
* Waits for an emulator to boot on a given port.
|
||||
* Returns this emulator's ID in a promise.
|
||||
*/
|
||||
module.exports.wait_for_emulator = function(uuid) {
|
||||
module.exports.wait_for_emulator = function(port) {
|
||||
var self = this;
|
||||
return self.list_started()
|
||||
.then(function(new_started) {
|
||||
var emulator_id = null;
|
||||
var promises = [];
|
||||
|
||||
new_started.forEach(function (emulator) {
|
||||
promises.push(
|
||||
Adb.shell(emulator, 'getprop emu.uuid')
|
||||
.then(function (output) {
|
||||
if (output.indexOf(uuid) >= 0) {
|
||||
emulator_id = emulator;
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
return Q.all(promises).then(function () {
|
||||
return emulator_id || self.wait_for_emulator(uuid);
|
||||
return Q().then(function() {
|
||||
var emulator_id = 'emulator-' + port;
|
||||
return Adb.shell(emulator_id, 'getprop dev.bootcomplete')
|
||||
.then(function (output) {
|
||||
if (output.indexOf('1') >= 0) {
|
||||
return emulator_id;
|
||||
}
|
||||
return self.wait_for_emulator(port);
|
||||
}, function (error) {
|
||||
if (error && error.message &&
|
||||
(error.message.indexOf('not found') > -1) ||
|
||||
error.message.indexOf('device offline') > -1) {
|
||||
// emulator not yet started, continue waiting
|
||||
return self.wait_for_emulator(port);
|
||||
} else {
|
||||
// something unexpected has happened
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -267,7 +292,7 @@ module.exports.wait_for_boot = function(emulator_id, time_remaining) {
|
||||
* Returns a promise.
|
||||
*/
|
||||
module.exports.create_image = function(name, target) {
|
||||
console.log('Creating avd named ' + name);
|
||||
console.log('Creating new avd named ' + name);
|
||||
if (target) {
|
||||
return spawn('android', ['create', 'avd', '--name', name, '--target', target])
|
||||
.then(null, function(error) {
|
||||
@@ -281,7 +306,7 @@ module.exports.create_image = function(name, target) {
|
||||
.then(function() {
|
||||
// TODO: This seems like another error case, even though it always happens.
|
||||
console.error('ERROR : Unable to create an avd emulator, no targets found.');
|
||||
console.error('Please insure you have targets available by running the "android" command');
|
||||
console.error('Ensure you have targets available by running the "android" command');
|
||||
return Q.reject();
|
||||
}, function(error) {
|
||||
console.error('ERROR : Failed to create emulator image : ');
|
||||
@@ -294,7 +319,7 @@ module.exports.resolveTarget = function(target) {
|
||||
return this.list_started()
|
||||
.then(function(emulator_list) {
|
||||
if (emulator_list.length < 1) {
|
||||
return Q.reject('No started emulators found, please start an emultor before deploying your project.');
|
||||
return Q.reject('No running Android emulators found, please start an emulator before deploying your project.');
|
||||
}
|
||||
|
||||
// default emulator
|
||||
@@ -349,6 +374,7 @@ module.exports.install = function(givenTarget, buildResults) {
|
||||
};
|
||||
|
||||
events.emit('log', 'Using apk: ' + apk_path);
|
||||
events.emit('log', 'Package name: ' + pkgName);
|
||||
events.emit('verbose', 'Installing app on emulator...');
|
||||
|
||||
// A special function to call adb install in specific environment w/ specific options.
|
||||
@@ -363,8 +389,17 @@ module.exports.install = function(givenTarget, buildResults) {
|
||||
if (err) reject(new CordovaError('Error executing "' + command + '": ' + stderr));
|
||||
// adb does not return an error code even if installation fails. Instead it puts a specific
|
||||
// message to stdout, so we have to use RegExp matching to detect installation failure.
|
||||
else if (/Failure/.test(stdout)) reject(new CordovaError('Failed to install apk to emulator: ' + stdout));
|
||||
else resolve(stdout);
|
||||
else if (/Failure/.test(stdout)) {
|
||||
if (stdout.match(/INSTALL_PARSE_FAILED_NO_CERTIFICATES/)) {
|
||||
stdout += 'Sign the build using \'-- --keystore\' or \'--buildConfig\'' +
|
||||
' or sign and deploy the unsigned apk manually using Android tools.';
|
||||
} else if (stdout.match(/INSTALL_FAILED_VERSION_DOWNGRADE/)) {
|
||||
stdout += 'You\'re trying to install apk with a lower versionCode that is already installed.' +
|
||||
'\nEither uninstall an app or increment the versionCode.';
|
||||
}
|
||||
|
||||
reject(new CordovaError('Failed to install apk to emulator: ' + stdout));
|
||||
} else resolve(stdout);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -377,8 +412,8 @@ module.exports.install = function(givenTarget, buildResults) {
|
||||
if (!/INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES/.test(error.toString()))
|
||||
throw error;
|
||||
|
||||
events.emit('warn', 'Uninstalling app from device and reinstalling it again because the ' +
|
||||
'installed app already signed with different key');
|
||||
events.emit('warn', 'Uninstalling app from device and reinstalling it because the ' +
|
||||
'currently installed app was signed with different key');
|
||||
|
||||
// This promise is always resolved, even if 'adb uninstall' fails to uninstall app
|
||||
// or the app doesn't installed at all, so no error catching needed.
|
||||
|
||||
@@ -22,12 +22,13 @@
|
||||
var devices = require('./device');
|
||||
|
||||
// Usage support for when args are given
|
||||
devices.list().done(function(device_list) {
|
||||
device_list && device_list.forEach(function(dev) {
|
||||
console.log(dev);
|
||||
require('../lib/check_reqs').check_android().then(function() {
|
||||
devices.list().done(function(device_list) {
|
||||
device_list && device_list.forEach(function(dev) {
|
||||
console.log(dev);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
var emulators = require('./emulator');
|
||||
|
||||
// Usage support for when args are given
|
||||
emulators.list_images().done(function(emulator_list) {
|
||||
emulator_list && emulator_list.forEach(function(emu) {
|
||||
console.log(emu.name);
|
||||
require('../lib/check_reqs').check_android().then(function() {
|
||||
emulators.list_images().done(function(emulator_list) {
|
||||
emulator_list && emulator_list.forEach(function(emu) {
|
||||
console.log(emu.name);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
var emulators = require('./emulator');
|
||||
|
||||
// Usage support for when args are given
|
||||
emulators.list_started().done(function(emulator_list) {
|
||||
emulator_list && emulator_list.forEach(function(emu) {
|
||||
console.log(emu);
|
||||
require('../lib/check_reqs').check_android().then(function() {
|
||||
emulators.list_started().done(function(emulator_list) {
|
||||
emulator_list && emulator_list.forEach(function(emu) {
|
||||
console.log(emu);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
}, function(err) {
|
||||
console.error('ERROR: ' + err);
|
||||
process.exit(2);
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'android-library'
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: '*.jar')
|
||||
|
||||
76
bin/templates/cordova/lib/pluginHandlers.js
vendored
76
bin/templates/cordova/lib/pluginHandlers.js
vendored
@@ -28,10 +28,14 @@ var CordovaError = require('cordova-common').CordovaError;
|
||||
var handlers = {
|
||||
'source-file':{
|
||||
install:function(obj, plugin, project, options) {
|
||||
if (!obj.src) throw new CordovaError('<source-file> element is missing "src" attribute for plugin: ' + plugin.id);
|
||||
if (!obj.targetDir) throw new CordovaError('<source-file> element is missing "target-dir" attribute for plugin: ' + plugin.id);
|
||||
if (!obj.src) throw new CordovaError(generateAttributeError('src', 'source-file', plugin.id));
|
||||
if (!obj.targetDir) throw new CordovaError(generateAttributeError('target-dir', 'source-file', plugin.id));
|
||||
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
||||
copyNewFile(plugin.dir, obj.src, project.projectDir, dest, options && options.link);
|
||||
if (options && options.force) {
|
||||
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
|
||||
} else {
|
||||
copyNewFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
|
||||
}
|
||||
},
|
||||
uninstall:function(obj, plugin, project, options) {
|
||||
var dest = path.join(obj.targetDir, path.basename(obj.src));
|
||||
@@ -41,7 +45,7 @@ var handlers = {
|
||||
'lib-file':{
|
||||
install:function(obj, plugin, project, options) {
|
||||
var dest = path.join('libs', path.basename(obj.src));
|
||||
copyFile(plugin.dir, obj.src, project.projectDir, dest, options && options.link);
|
||||
copyFile(plugin.dir, obj.src, project.projectDir, dest, !!(options && options.link));
|
||||
},
|
||||
uninstall:function(obj, plugin, project, options) {
|
||||
var dest = path.join('libs', path.basename(obj.src));
|
||||
@@ -50,7 +54,7 @@ var handlers = {
|
||||
},
|
||||
'resource-file':{
|
||||
install:function(obj, plugin, project, options) {
|
||||
copyFile(plugin.dir, obj.src, project.projectDir, path.normalize(obj.target), options && options.link);
|
||||
copyFile(plugin.dir, obj.src, project.projectDir, path.normalize(obj.target), !!(options && options.link));
|
||||
},
|
||||
uninstall:function(obj, plugin, project, options) {
|
||||
removeFile(project.projectDir, path.normalize(obj.target));
|
||||
@@ -59,7 +63,7 @@ var handlers = {
|
||||
'framework': {
|
||||
install:function(obj, plugin, project, options) {
|
||||
var src = obj.src;
|
||||
if (!src) throw new CordovaError('src not specified in <framework> for plugin: ' + plugin.id);
|
||||
if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id));
|
||||
|
||||
events.emit('verbose', 'Installing Android library: ' + src);
|
||||
var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir;
|
||||
@@ -67,7 +71,7 @@ var handlers = {
|
||||
|
||||
if (obj.custom) {
|
||||
var subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src);
|
||||
copyNewFile(plugin.dir, src, project.projectDir, subRelativeDir, options && options.link);
|
||||
copyNewFile(plugin.dir, src, project.projectDir, subRelativeDir, !!(options && options.link));
|
||||
subDir = path.resolve(project.projectDir, subRelativeDir);
|
||||
} else {
|
||||
obj.type = 'sys';
|
||||
@@ -84,7 +88,7 @@ var handlers = {
|
||||
},
|
||||
uninstall:function(obj, plugin, project, options) {
|
||||
var src = obj.src;
|
||||
if (!src) throw new CordovaError('src not specified in <framework> for plugin: ' + plugin.id);
|
||||
if (!src) throw new CordovaError(generateAttributeError('src', 'framework', plugin.id));
|
||||
|
||||
events.emit('verbose', 'Uninstalling Android library: ' + src);
|
||||
var parentDir = obj.parent ? path.resolve(project.projectDir, obj.parent) : project.projectDir;
|
||||
@@ -96,7 +100,7 @@ var handlers = {
|
||||
subDir = path.resolve(project.projectDir, subRelativeDir);
|
||||
// If it's the last framework in the plugin, remove the parent directory.
|
||||
var parDir = path.dirname(subDir);
|
||||
if (fs.readdirSync(parDir).length === 0) {
|
||||
if (fs.existsSync(parDir) && fs.readdirSync(parDir).length === 0) {
|
||||
fs.rmdirSync(parDir);
|
||||
}
|
||||
} else {
|
||||
@@ -116,30 +120,37 @@ var handlers = {
|
||||
asset:{
|
||||
install:function(obj, plugin, project, options) {
|
||||
if (!obj.src) {
|
||||
throw new CordovaError('<asset> tag without required "src" attribute. plugin=' + plugin.dir);
|
||||
throw new CordovaError(generateAttributeError('src', 'asset', plugin.id));
|
||||
}
|
||||
if (!obj.target) {
|
||||
throw new CordovaError('<asset> tag without required "target" attribute');
|
||||
throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
|
||||
}
|
||||
|
||||
var www = options.usePlatformWww ? project.platformWww : project.www;
|
||||
copyFile(plugin.dir, obj.src, www, obj.target);
|
||||
copyFile(plugin.dir, obj.src, project.www, obj.target);
|
||||
if (options && options.usePlatformWww) {
|
||||
// CB-11022 copy file to both directories if usePlatformWww is specified
|
||||
copyFile(plugin.dir, obj.src, project.platformWww, obj.target);
|
||||
}
|
||||
},
|
||||
uninstall:function(obj, plugin, project, options) {
|
||||
var target = obj.target || obj.src;
|
||||
|
||||
if (!target) throw new CordovaError('<asset> tag without required "target" attribute');
|
||||
if (!target) throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
|
||||
|
||||
var www = options.usePlatformWww ? project.platformWww : project.www;
|
||||
removeFile(www, target);
|
||||
removeFileF(path.resolve(www, 'plugins', plugin.id));
|
||||
removeFileF(path.resolve(project.www, target));
|
||||
removeFileF(path.resolve(project.www, 'plugins', plugin.id));
|
||||
if (options && options.usePlatformWww) {
|
||||
// CB-11022 remove file from both directories if usePlatformWww is specified
|
||||
removeFileF(path.resolve(project.platformWww, target));
|
||||
removeFileF(path.resolve(project.platformWww, 'plugins', plugin.id));
|
||||
}
|
||||
}
|
||||
},
|
||||
'js-module': {
|
||||
install: function (obj, plugin, project, options) {
|
||||
// Copy the plugin's files into the www directory.
|
||||
var moduleSource = path.resolve(plugin.dir, obj.src);
|
||||
var moduleName = plugin.id + '.' + (obj.name || path.parse(obj.src).name);
|
||||
var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname (obj.src)));
|
||||
|
||||
// Read in the file, prepend the cordova.define, and write it back out.
|
||||
var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM
|
||||
@@ -148,15 +159,24 @@ var handlers = {
|
||||
}
|
||||
scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) {\n' + scriptContent + '\n});\n';
|
||||
|
||||
var www = options.usePlatformWww ? project.platformWww : project.www;
|
||||
var moduleDestination = path.resolve(www, 'plugins', plugin.id, obj.src);
|
||||
shell.mkdir('-p', path.dirname(moduleDestination));
|
||||
fs.writeFileSync(moduleDestination, scriptContent, 'utf-8');
|
||||
var wwwDest = path.resolve(project.www, 'plugins', plugin.id, obj.src);
|
||||
shell.mkdir('-p', path.dirname(wwwDest));
|
||||
fs.writeFileSync(wwwDest, scriptContent, 'utf-8');
|
||||
|
||||
if (options && options.usePlatformWww) {
|
||||
// CB-11022 copy file to both directories if usePlatformWww is specified
|
||||
var platformWwwDest = path.resolve(project.platformWww, 'plugins', plugin.id, obj.src);
|
||||
shell.mkdir('-p', path.dirname(platformWwwDest));
|
||||
fs.writeFileSync(platformWwwDest, scriptContent, 'utf-8');
|
||||
}
|
||||
},
|
||||
uninstall: function (obj, plugin, project, options) {
|
||||
var pluginRelativePath = path.join('plugins', plugin.id, obj.src);
|
||||
var www = options.usePlatformWww ? project.platformWww : project.www;
|
||||
removeFileAndParents(www, pluginRelativePath);
|
||||
removeFileAndParents(project.www, pluginRelativePath);
|
||||
if (options && options.usePlatformWww) {
|
||||
// CB-11022 remove file from both directories if usePlatformWww is specified
|
||||
removeFileAndParents(project.platformWww, pluginRelativePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -185,13 +205,13 @@ function copyFile (plugin_dir, src, project_dir, dest, link) {
|
||||
var real_path = fs.realpathSync(src);
|
||||
var real_plugin_path = fs.realpathSync(plugin_dir);
|
||||
if (real_path.indexOf(real_plugin_path) !== 0)
|
||||
throw new CordovaError('"' + src + '" not located within plugin!');
|
||||
throw new CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"');
|
||||
|
||||
dest = path.resolve(project_dir, dest);
|
||||
|
||||
// check that dest path is located in project directory
|
||||
if (dest.indexOf(project_dir) !== 0)
|
||||
throw new CordovaError('"' + dest + '" not located within project!');
|
||||
throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project');
|
||||
|
||||
shell.mkdir('-p', path.dirname(dest));
|
||||
|
||||
@@ -250,3 +270,7 @@ function removeFileAndParents (baseDir, destFile, stopper) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function generateAttributeError(attribute, element, id) {
|
||||
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
|
||||
}
|
||||
|
||||
265
bin/templates/cordova/lib/prepare.js
vendored
265
bin/templates/cordova/lib/prepare.js
vendored
@@ -26,26 +26,55 @@ var AndroidManifest = require('./AndroidManifest');
|
||||
var xmlHelpers = require('cordova-common').xmlHelpers;
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
var ConfigParser = require('cordova-common').ConfigParser;
|
||||
var FileUpdater = require('cordova-common').FileUpdater;
|
||||
var PlatformJson = require('cordova-common').PlatformJson;
|
||||
var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
|
||||
var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
|
||||
|
||||
module.exports.prepare = function (cordovaProject) {
|
||||
|
||||
module.exports.prepare = function (cordovaProject, options) {
|
||||
var self = this;
|
||||
var platformResourcesDir = path.relative(cordovaProject.root, path.join(this.locations.root, 'res'));
|
||||
|
||||
this._config = updateConfigFilesFrom(cordovaProject.projectConfig,
|
||||
this._munger, this.locations);
|
||||
var platformJson = PlatformJson.load(this.locations.root, this.platform);
|
||||
var munger = new PlatformMunger(this.platform, this.locations.root, platformJson, new PluginInfoProvider());
|
||||
|
||||
this._config = updateConfigFilesFrom(cordovaProject.projectConfig, munger, this.locations);
|
||||
|
||||
// Update own www dir with project's www assets and plugins' assets and js-files
|
||||
return Q.when(updateWwwFrom(cordovaProject, this.locations))
|
||||
return Q.when(updateWww(cordovaProject, this.locations))
|
||||
.then(function () {
|
||||
// update project according to config.xml changes.
|
||||
return updateProjectAccordingTo(self._config, self.locations);
|
||||
})
|
||||
.then(function () {
|
||||
handleIcons(cordovaProject.projectConfig, self.root);
|
||||
handleSplashes(cordovaProject.projectConfig, self.root);
|
||||
updateIcons(cordovaProject, platformResourcesDir);
|
||||
updateSplashes(cordovaProject, platformResourcesDir);
|
||||
})
|
||||
.then(function () {
|
||||
self.events.emit('verbose', 'updated project successfully');
|
||||
events.emit('verbose', 'Prepared android project successfully');
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.clean = function (options) {
|
||||
// A cordovaProject isn't passed into the clean() function, because it might have
|
||||
// been called from the platform shell script rather than the CLI. Check for the
|
||||
// noPrepare option passed in by the non-CLI clean script. If that's present, or if
|
||||
// there's no config.xml found at the project root, then don't clean prepared files.
|
||||
var projectRoot = path.resolve(this.root, '../..');
|
||||
var projectConfigFile = path.join(projectRoot, 'config.xml');
|
||||
if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile) ||
|
||||
!fs.existsSync(this.locations.configXml)) {
|
||||
return Q();
|
||||
}
|
||||
|
||||
var projectConfig = new ConfigParser(this.locations.configXml);
|
||||
var platformResourcesDir = path.relative(projectRoot, path.join(this.locations.root, 'res'));
|
||||
|
||||
var self = this;
|
||||
return Q().then(function () {
|
||||
cleanWww(projectRoot, self.locations);
|
||||
cleanIcons(projectRoot, projectConfig, platformResourcesDir);
|
||||
cleanSplashes(projectRoot, projectConfig, platformResourcesDir);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -64,7 +93,7 @@ module.exports.prepare = function (cordovaProject) {
|
||||
* configuration is already dumped to appropriate config.xml file.
|
||||
*/
|
||||
function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
|
||||
events.emit('verbose', 'Generating config.xml from defaults for platform "android"');
|
||||
events.emit('verbose', 'Generating platform-specific config.xml from defaults for android at ' + locations.configXml);
|
||||
|
||||
// First cleanup current config and merge project's one into own
|
||||
// Overwrite platform config.xml with defaults.xml.
|
||||
@@ -74,6 +103,7 @@ function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
|
||||
// in project (including project's config)
|
||||
configMunger.reapply_global_munge().save_all();
|
||||
|
||||
events.emit('verbose', 'Merging project\'s config.xml into platform-specific android config.xml');
|
||||
// Merge changes from app's config.xml into platform's one
|
||||
var config = new ConfigParser(locations.configXml);
|
||||
xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
|
||||
@@ -83,6 +113,13 @@ function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs all file operations via the verbose event stream, indented.
|
||||
*/
|
||||
function logFileOp(message) {
|
||||
events.emit('verbose', ' ' + message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates platform 'www' directory by replacing it with contents of
|
||||
* 'platform_www' and app www. Also copies project's overrides' folder into
|
||||
@@ -92,21 +129,36 @@ function updateConfigFilesFrom(sourceConfig, configMunger, locations) {
|
||||
* @param {Object} destinations An object that contains destination
|
||||
* paths for www files.
|
||||
*/
|
||||
function updateWwwFrom(cordovaProject, destinations) {
|
||||
shell.rm('-rf', destinations.www);
|
||||
shell.mkdir('-p', destinations.www);
|
||||
// Copy source files from project's www directory
|
||||
shell.cp('-rf', path.join(cordovaProject.locations.www, '*'), destinations.www);
|
||||
// Override www sources by files in 'platform_www' directory
|
||||
shell.cp('-rf', path.join(destinations.platformWww, '*'), destinations.www);
|
||||
function updateWww(cordovaProject, destinations) {
|
||||
var sourceDirs = [
|
||||
path.relative(cordovaProject.root, cordovaProject.locations.www),
|
||||
path.relative(cordovaProject.root, destinations.platformWww)
|
||||
];
|
||||
|
||||
// If project contains 'merges' for our platform, use them as another overrides
|
||||
var merges_path = path.join(cordovaProject.root, 'merges', 'android');
|
||||
if (fs.existsSync(merges_path)) {
|
||||
events.emit('verbose', 'Found "merges" for android platform. Copying over existing "www" files.');
|
||||
var overrides = path.join(merges_path, '*');
|
||||
shell.cp('-rf', overrides, destinations.www);
|
||||
events.emit('verbose', 'Found "merges/android" folder. Copying its contents into the android project.');
|
||||
sourceDirs.push(path.join('merges', 'android'));
|
||||
}
|
||||
|
||||
var targetDir = path.relative(cordovaProject.root, destinations.www);
|
||||
events.emit(
|
||||
'verbose', 'Merging and updating files from [' + sourceDirs.join(', ') + '] to ' + targetDir);
|
||||
FileUpdater.mergeAndUpdateDir(
|
||||
sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans all files from the platform 'www' directory.
|
||||
*/
|
||||
function cleanWww(projectRoot, locations) {
|
||||
var targetDir = path.relative(projectRoot, locations.www);
|
||||
events.emit('verbose', 'Cleaning ' + targetDir);
|
||||
|
||||
// No source paths are specified, so mergeAndUpdateDir() will clear the target directory.
|
||||
FileUpdater.mergeAndUpdateDir(
|
||||
[], targetDir, { rootDir: projectRoot, all: true }, logFileOp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +174,7 @@ function updateProjectAccordingTo(platformConfig, locations) {
|
||||
var strings = xmlHelpers.parseElementtreeSync(locations.strings);
|
||||
strings.find('string[@name="app_name"]').text = name;
|
||||
fs.writeFileSync(locations.strings, strings.write({indent: 4}), 'utf-8');
|
||||
events.emit('verbose', 'Wrote out Android application name to "' + name + '"');
|
||||
events.emit('verbose', 'Wrote out android application name "' + name + '" to ' + locations.strings);
|
||||
|
||||
// Java packages cannot support dashes
|
||||
var pkg = (platformConfig.android_packageName() || platformConfig.packageName()).replace(/-/g, '_');
|
||||
@@ -131,7 +183,7 @@ function updateProjectAccordingTo(platformConfig, locations) {
|
||||
var orig_pkg = manifest.getPackageId();
|
||||
|
||||
manifest.getActivity()
|
||||
.setOrientation(findOrientationValue(platformConfig))
|
||||
.setOrientation(platformConfig.getPreference('orientation'))
|
||||
.setLaunchMode(findAndroidLaunchModePreference(platformConfig));
|
||||
|
||||
manifest.setVersionName(platformConfig.version())
|
||||
@@ -148,15 +200,15 @@ function updateProjectAccordingTo(platformConfig, locations) {
|
||||
});
|
||||
|
||||
if (java_files.length === 0) {
|
||||
throw new CordovaError('No Java files found which extend CordovaActivity.');
|
||||
throw new CordovaError('No Java files found that extend CordovaActivity.');
|
||||
} else if(java_files.length > 1) {
|
||||
events.emit('log', 'Multiple candidate Java files (.java files which extend CordovaActivity) found. Guessing at the first one, ' + java_files[0]);
|
||||
events.emit('log', 'Multiple candidate Java files that extend CordovaActivity found. Guessing at the first one, ' + java_files[0]);
|
||||
}
|
||||
|
||||
var destFile = path.join(locations.root, 'src', pkg.replace(/\./g, '/'), path.basename(java_files[0]));
|
||||
shell.mkdir('-p', path.dirname(destFile));
|
||||
shell.sed(/package [\w\.]*;/, 'package ' + pkg + ';', java_files[0]).to(destFile);
|
||||
events.emit('verbose', 'Wrote out Android package name to "' + pkg + '"');
|
||||
events.emit('verbose', 'Wrote out Android package name "' + pkg + '" to ' + destFile);
|
||||
|
||||
if (orig_pkg !== pkg) {
|
||||
// If package was name changed we need to remove old java with main activity
|
||||
@@ -190,55 +242,69 @@ function default_versionCode(version) {
|
||||
if (+nums[2]) {
|
||||
versionCode += +nums[2];
|
||||
}
|
||||
|
||||
events.emit('verbose', 'android-versionCode not found in config.xml. Generating a code based on version in config.xml (' + version + '): ' + versionCode);
|
||||
return versionCode;
|
||||
}
|
||||
|
||||
function copyImage(src, resourcesDir, density, name) {
|
||||
var destFolder = path.join(resourcesDir, (density ? 'drawable-': 'drawable') + density);
|
||||
var isNinePatch = !!/\.9\.png$/.exec(src);
|
||||
var ninePatchName = name.replace(/\.png$/, '.9.png');
|
||||
|
||||
// default template does not have default asset for this density
|
||||
if (!fs.existsSync(destFolder)) {
|
||||
fs.mkdirSync(destFolder);
|
||||
function getImageResourcePath(resourcesDir, density, name, sourceName) {
|
||||
if (/\.9\.png$/.test(sourceName)) {
|
||||
name = name.replace(/\.png$/, '.9.png');
|
||||
}
|
||||
|
||||
var destFilePath = path.join(destFolder, isNinePatch ? ninePatchName : name);
|
||||
events.emit('verbose', 'copying image from ' + src + ' to ' + destFilePath);
|
||||
shell.cp('-f', src, destFilePath);
|
||||
var resourcePath = path.join(resourcesDir, (density ? 'drawable-' + density : 'drawable'), name);
|
||||
return resourcePath;
|
||||
}
|
||||
|
||||
function handleSplashes(projectConfig, platformRoot) {
|
||||
var resources = projectConfig.getSplashScreens('android');
|
||||
function updateSplashes(cordovaProject, platformResourcesDir) {
|
||||
var resources = cordovaProject.projectConfig.getSplashScreens('android');
|
||||
|
||||
// if there are "splash" elements in config.xml
|
||||
if (resources.length > 0) {
|
||||
deleteDefaultResourceAt(platformRoot, 'screen.png');
|
||||
events.emit('verbose', 'splash screens: ' + JSON.stringify(resources));
|
||||
if (resources.length === 0) {
|
||||
events.emit('verbose', 'This app does not have splash screens defined');
|
||||
return;
|
||||
}
|
||||
|
||||
// The source paths for icons and splashes are relative to
|
||||
// project's config.xml location, so we use it as base path.
|
||||
var projectRoot = path.dirname(projectConfig.path);
|
||||
var destination = path.join(platformRoot, 'res');
|
||||
var resourceMap = mapImageResources(cordovaProject.root, platformResourcesDir, 'screen.png');
|
||||
|
||||
var hadMdpi = false;
|
||||
resources.forEach(function (resource) {
|
||||
if (!resource.density) {
|
||||
return;
|
||||
}
|
||||
if (resource.density == 'mdpi') {
|
||||
hadMdpi = true;
|
||||
}
|
||||
copyImage(path.join(projectRoot, resource.src), destination, resource.density, 'screen.png');
|
||||
});
|
||||
// There's no "default" drawable, so assume default == mdpi.
|
||||
if (!hadMdpi && resources.defaultResource) {
|
||||
copyImage(path.join(projectRoot, resources.defaultResource.src), destination, 'mdpi', 'screen.png');
|
||||
var hadMdpi = false;
|
||||
resources.forEach(function (resource) {
|
||||
if (!resource.density) {
|
||||
return;
|
||||
}
|
||||
if (resource.density == 'mdpi') {
|
||||
hadMdpi = true;
|
||||
}
|
||||
var targetPath = getImageResourcePath(
|
||||
platformResourcesDir, resource.density, 'screen.png', path.basename(resource.src));
|
||||
resourceMap[targetPath] = resource.src;
|
||||
});
|
||||
|
||||
// There's no "default" drawable, so assume default == mdpi.
|
||||
if (!hadMdpi && resources.defaultResource) {
|
||||
var targetPath = getImageResourcePath(
|
||||
platformResourcesDir, 'mdpi', 'screen.png', path.basename(resources.defaultResource.src));
|
||||
resourceMap[targetPath] = resources.defaultResource.src;
|
||||
}
|
||||
|
||||
events.emit('verbose', 'Updating splash screens at ' + platformResourcesDir);
|
||||
FileUpdater.updatePaths(
|
||||
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
|
||||
}
|
||||
|
||||
function cleanSplashes(projectRoot, projectConfig, platformResourcesDir) {
|
||||
var resources = projectConfig.getSplashScreens('android');
|
||||
if (resources.length > 0) {
|
||||
var resourceMap = mapImageResources(projectRoot, platformResourcesDir, 'screen.png');
|
||||
events.emit('verbose', 'Cleaning splash screens at ' + platformResourcesDir);
|
||||
|
||||
// No source paths are specified in the map, so updatePaths() will delete the target files.
|
||||
FileUpdater.updatePaths(
|
||||
resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
|
||||
}
|
||||
}
|
||||
|
||||
function handleIcons(projectConfig, platformRoot) {
|
||||
var icons = projectConfig.getIcons('android');
|
||||
function updateIcons(cordovaProject, platformResourcesDir) {
|
||||
var icons = cordovaProject.projectConfig.getIcons('android');
|
||||
|
||||
// if there are icon elements in config.xml
|
||||
if (icons.length === 0) {
|
||||
@@ -246,7 +312,7 @@ function handleIcons(projectConfig, platformRoot) {
|
||||
return;
|
||||
}
|
||||
|
||||
deleteDefaultResourceAt(platformRoot, 'icon.png');
|
||||
var resourceMap = mapImageResources(cordovaProject.root, platformResourcesDir, 'icon.png');
|
||||
|
||||
var android_icons = {};
|
||||
var default_icon;
|
||||
@@ -284,7 +350,7 @@ function handleIcons(projectConfig, platformRoot) {
|
||||
}
|
||||
if (!size && !icon.density) {
|
||||
if (default_icon) {
|
||||
events.emit('verbose', 'more than one default icon: ' + JSON.stringify(icon));
|
||||
events.emit('verbose', 'Found extra default icon: ' + icon.src + ' (ignoring in favor of ' + default_icon.src + ')');
|
||||
} else {
|
||||
default_icon = icon;
|
||||
}
|
||||
@@ -295,25 +361,47 @@ function handleIcons(projectConfig, platformRoot) {
|
||||
|
||||
// The source paths for icons and splashes are relative to
|
||||
// project's config.xml location, so we use it as base path.
|
||||
var projectRoot = path.dirname(projectConfig.path);
|
||||
var destination = path.join(platformRoot, 'res');
|
||||
for (var density in android_icons) {
|
||||
copyImage(path.join(projectRoot, android_icons[density].src), destination, density, 'icon.png');
|
||||
var targetPath = getImageResourcePath(
|
||||
platformResourcesDir, density, 'icon.png', path.basename(android_icons[density].src));
|
||||
resourceMap[targetPath] = android_icons[density].src;
|
||||
}
|
||||
|
||||
// There's no "default" drawable, so assume default == mdpi.
|
||||
if (default_icon && !android_icons.mdpi) {
|
||||
copyImage(path.join(projectRoot, default_icon.src), destination, 'mdpi', 'icon.png');
|
||||
var defaultTargetPath = getImageResourcePath(
|
||||
platformResourcesDir, 'mdpi', 'icon.png', path.basename(default_icon.src));
|
||||
resourceMap[defaultTargetPath] = default_icon.src;
|
||||
}
|
||||
|
||||
events.emit('verbose', 'Updating icons at ' + platformResourcesDir);
|
||||
FileUpdater.updatePaths(
|
||||
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
|
||||
}
|
||||
|
||||
function cleanIcons(projectRoot, projectConfig, platformResourcesDir) {
|
||||
var icons = projectConfig.getIcons('android');
|
||||
if (icons.length > 0) {
|
||||
var resourceMap = mapImageResources(projectRoot, platformResourcesDir, 'icon.png');
|
||||
events.emit('verbose', 'Cleaning icons at ' + platformResourcesDir);
|
||||
|
||||
// No source paths are specified in the map, so updatePaths() will delete the target files.
|
||||
FileUpdater.updatePaths(
|
||||
resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the default resource name from all drawable folders
|
||||
function deleteDefaultResourceAt(baseDir, resourceName) {
|
||||
shell.ls(path.join(baseDir, 'res/drawable-*'))
|
||||
/**
|
||||
* Gets a map containing resources of a specified name from all drawable folders in a directory.
|
||||
*/
|
||||
function mapImageResources(rootDir, subDir, resourceName) {
|
||||
var pathMap = {};
|
||||
shell.ls(path.join(rootDir, subDir, 'drawable-*'))
|
||||
.forEach(function (drawableFolder) {
|
||||
var imagePath = path.join(drawableFolder, resourceName);
|
||||
shell.rm('-f', [imagePath, imagePath.replace(/\.png$/, '.9.png')]);
|
||||
events.emit('verbose', 'Deleted ' + imagePath);
|
||||
var imagePath = path.join(subDir, path.basename(drawableFolder), resourceName);
|
||||
pathMap[imagePath] = null;
|
||||
});
|
||||
return pathMap;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -344,36 +432,3 @@ function findAndroidLaunchModePreference(platformConfig) {
|
||||
|
||||
return launchMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries ConfigParser object for the orientation <preference> value. Warns if
|
||||
* global preference value is not supported by platform.
|
||||
*
|
||||
* @param {Object} platformConfig ConfigParser object
|
||||
*
|
||||
* @return {String} Global/platform-specific orientation in lower-case
|
||||
* (or empty string if both are undefined).
|
||||
*/
|
||||
function findOrientationValue(platformConfig) {
|
||||
|
||||
var ORIENTATION_DEFAULT = 'default';
|
||||
|
||||
var orientation = platformConfig.getPreference('orientation');
|
||||
if (!orientation) {
|
||||
return ORIENTATION_DEFAULT;
|
||||
}
|
||||
|
||||
var GLOBAL_ORIENTATIONS = ['default', 'portrait','landscape'];
|
||||
function isSupported(orientation) {
|
||||
return GLOBAL_ORIENTATIONS.indexOf(orientation.toLowerCase()) >= 0;
|
||||
}
|
||||
|
||||
// Check if the given global orientation is supported
|
||||
if (orientation && isSupported(orientation)) {
|
||||
return orientation;
|
||||
}
|
||||
|
||||
events.emit('warn', 'Unsupported global orientation: ' + orientation +
|
||||
'. Defaulting to value: ' + ORIENTATION_DEFAULT);
|
||||
return ORIENTATION_DEFAULT;
|
||||
}
|
||||
|
||||
7
bin/templates/cordova/lib/run.js
vendored
7
bin/templates/cordova/lib/run.js
vendored
@@ -25,7 +25,8 @@ var path = require('path'),
|
||||
build = require('./build'),
|
||||
emulator = require('./emulator'),
|
||||
device = require('./device'),
|
||||
Q = require('q');
|
||||
Q = require('q'),
|
||||
events = require('cordova-common').events;
|
||||
|
||||
function getInstallTarget(runOptions) {
|
||||
var install_target;
|
||||
@@ -62,10 +63,10 @@ function getInstallTarget(runOptions) {
|
||||
return device.list()
|
||||
.then(function(device_list) {
|
||||
if (device_list.length > 0) {
|
||||
self.events.emit('warn', 'No target specified, deploying to device \'' + device_list[0] + '\'.');
|
||||
events.emit('warn', 'No target specified, deploying to device \'' + device_list[0] + '\'.');
|
||||
install_target = device_list[0];
|
||||
} else {
|
||||
self.events.emit('warn', 'No target specified, deploying to emulator');
|
||||
events.emit('warn', 'No target specified and no devices found, deploying to emulator');
|
||||
install_target = '--emulator';
|
||||
}
|
||||
});
|
||||
|
||||
18
bin/templates/cordova/loggingHelper.js
vendored
Normal file
18
bin/templates/cordova/loggingHelper.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
var CordovaLogger = require('cordova-common').CordovaLogger;
|
||||
|
||||
module.exports = {
|
||||
adjustLoggerLevel: function (opts) {
|
||||
if (opts instanceof Array) {
|
||||
opts.silent = opts.indexOf('--silent') !== -1;
|
||||
opts.verbose = opts.indexOf('--verbose') !== -1;
|
||||
}
|
||||
|
||||
if (opts.silent) {
|
||||
CordovaLogger.get().setLevel('error');
|
||||
}
|
||||
|
||||
if (opts.verbose) {
|
||||
CordovaLogger.get().setLevel('verbose');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -44,6 +44,8 @@ var runOpts = nopt({
|
||||
// Make runOptions compatible with PlatformApi run method spec
|
||||
runOpts.argv = runOpts.argv.remain;
|
||||
|
||||
require('./loggingHelper').adjustLoggerLevel(runOpts);
|
||||
|
||||
new Api().run(runOpts)
|
||||
.catch(function(err) {
|
||||
console.error(err, err.stack);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
// Coho updates this line:
|
||||
var VERSION = "5.2.0-dev";
|
||||
var VERSION = "5.2.1";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
||||
14
bin/templates/project/assets/www/cordova.js
vendored
14
bin/templates/project/assets/www/cordova.js
vendored
@@ -1,5 +1,5 @@
|
||||
// Platform: android
|
||||
// c517ca811b4948b630e0b74dbae6c9637939da24
|
||||
// 2fd4bcb84048415922d13d80d35b8d1668e8e150
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@@ -19,7 +19,7 @@
|
||||
under the License.
|
||||
*/
|
||||
;(function() {
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '5.2.0-dev';
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '5.2.1';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/*jshint -W079 */
|
||||
@@ -330,7 +330,7 @@ module.exports = cordova;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
// file: D:/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -353,7 +353,7 @@ module.exports = {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
// file: D:/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -862,7 +862,7 @@ module.exports = channel;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||
// file: D:/cordova/cordova-android/cordova-js-src/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -1611,7 +1611,7 @@ exports.reset();
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||
// file: D:/cordova/cordova-android/cordova-js-src/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
@@ -1721,7 +1721,7 @@ function onMessageFromNative(msg) {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
// file: D:/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
under the License.
|
||||
*/
|
||||
|
||||
// GENERATED FILE! DO NOT EDIT!
|
||||
|
||||
apply plugin: 'android'
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
// Switch the Android Gradle plugin version requirement depending on the
|
||||
@@ -31,17 +30,20 @@ buildscript {
|
||||
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
|
||||
// and https://issues.apache.org/jira/browse/CB-8143
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
||||
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow plugins to declare Maven dependencies via build-extras.gradle.
|
||||
repositories {
|
||||
mavenCentral()
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenCentral();
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '2.8'
|
||||
gradleVersion = '2.13'
|
||||
}
|
||||
|
||||
// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties.
|
||||
@@ -162,7 +164,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode") + "0")
|
||||
versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode"))
|
||||
applicationId privateHelpers.extractStringFromManifest("package")
|
||||
|
||||
if (cdvMinSdkVersion != null) {
|
||||
@@ -180,13 +182,13 @@ android {
|
||||
if (Boolean.valueOf(cdvBuildMultipleApks)) {
|
||||
productFlavors {
|
||||
armv7 {
|
||||
versionCode defaultConfig.versionCode + 2
|
||||
versionCode defaultConfig.versionCode*10 + 2
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", ""
|
||||
}
|
||||
}
|
||||
x86 {
|
||||
versionCode defaultConfig.versionCode + 4
|
||||
versionCode defaultConfig.versionCode*10 + 4
|
||||
ndk {
|
||||
abiFilters "x86", ""
|
||||
}
|
||||
@@ -197,7 +199,12 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!cdvVersionCode) {
|
||||
}
|
||||
/*
|
||||
|
||||
ELSE NOTHING! DON'T MESS WITH THE VERSION CODE IF YOU DON'T HAVE TO!
|
||||
|
||||
else if (!cdvVersionCode) {
|
||||
def minSdkVersion = cdvMinSdkVersion ?: privateHelpers.extractIntFromManifest("minSdkVersion")
|
||||
// Vary versionCode by the two most common API levels:
|
||||
// 14 is ICS, which is the lowest API level for many apps.
|
||||
@@ -208,6 +215,7 @@ android {
|
||||
defaultConfig.versionCode += 8
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_6
|
||||
|
||||
@@ -24,7 +24,7 @@ var args = require('nopt')({
|
||||
'link': Boolean,
|
||||
'shared': Boolean,
|
||||
'help': Boolean
|
||||
});
|
||||
}, { 'd' : '--verbose' });
|
||||
|
||||
if (args.help || args.argv.remain.length === 0) {
|
||||
console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project> [--link]');
|
||||
@@ -32,4 +32,6 @@ if (args.help || args.argv.remain.length === 0) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
require('./templates/cordova/loggingHelper').adjustLoggerLevel(args);
|
||||
|
||||
Api.updatePlatform(args.argv.remain[0], {link: (args.link || args.shared)}).done();
|
||||
|
||||
@@ -24,12 +24,12 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.5.0'
|
||||
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'android-library'
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
ext {
|
||||
apply from: 'cordova.gradle'
|
||||
|
||||
@@ -61,7 +61,7 @@ String doFindLatestInstalledBuildTools(String minBuildToolsVersion) {
|
||||
highestBuildToolsVersion
|
||||
} else {
|
||||
throw new RuntimeException(
|
||||
"No installed build tools found. Please install the Android build tools version " +
|
||||
"No installed build tools found. Install the Android build tools version " +
|
||||
minBuildToolsVersion + " or higher.")
|
||||
}
|
||||
}
|
||||
|
||||
65
framework/src/org/apache/cordova/CallbackMap.java
Normal file
65
framework/src/org/apache/cordova/CallbackMap.java
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
package org.apache.cordova;
|
||||
|
||||
import android.util.Pair;
|
||||
import android.util.SparseArray;
|
||||
|
||||
/**
|
||||
* Provides a collection that maps unique request codes to CordovaPlugins and Integers.
|
||||
* Used to ensure that when plugins make requests for runtime permissions, those requests do not
|
||||
* collide with requests from other plugins that use the same request code value.
|
||||
*/
|
||||
public class CallbackMap {
|
||||
private int currentCallbackId = 0;
|
||||
private SparseArray<Pair<CordovaPlugin, Integer>> callbacks;
|
||||
|
||||
public CallbackMap() {
|
||||
this.callbacks = new SparseArray<Pair<CordovaPlugin, Integer>>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores a CordovaPlugin and request code and returns a new unique request code to use
|
||||
* in a permission request.
|
||||
*
|
||||
* @param receiver The plugin that is making the request
|
||||
* @param requestCode The original request code used by the plugin
|
||||
* @return A unique request code that can be used to retrieve this callback
|
||||
* with getAndRemoveCallback()
|
||||
*/
|
||||
public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) {
|
||||
int mappedId = this.currentCallbackId++;
|
||||
callbacks.put(mappedId, new Pair<CordovaPlugin, Integer>(receiver, requestCode));
|
||||
return mappedId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves and removes a callback stored in the map using the mapped request code
|
||||
* obtained from registerCallback()
|
||||
*
|
||||
* @param mappedId The request code obtained from registerCallback()
|
||||
* @return The CordovaPlugin and orignal request code that correspond to the
|
||||
* given mappedCode
|
||||
*/
|
||||
public synchronized Pair<CordovaPlugin, Integer> getAndRemoveCallback(int mappedId) {
|
||||
Pair<CordovaPlugin, Integer> callback = callbacks.get(mappedId);
|
||||
callbacks.remove(mappedId);
|
||||
return callback;
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -42,8 +43,8 @@ public class CordovaInterfaceImpl implements CordovaInterface {
|
||||
protected PluginManager pluginManager;
|
||||
|
||||
protected ActivityResultHolder savedResult;
|
||||
protected CallbackMap permissionResultCallbacks;
|
||||
protected CordovaPlugin activityResultCallback;
|
||||
protected CordovaPlugin permissionResultCallback;
|
||||
protected String initCallbackService;
|
||||
protected int activityResultRequestCode;
|
||||
protected boolean activityWasDestroyed = false;
|
||||
@@ -56,6 +57,7 @@ public class CordovaInterfaceImpl implements CordovaInterface {
|
||||
public CordovaInterfaceImpl(Activity activity, ExecutorService threadPool) {
|
||||
this.activity = activity;
|
||||
this.threadPool = threadPool;
|
||||
this.permissionResultCallbacks = new CallbackMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,24 +210,21 @@ public class CordovaInterfaceImpl implements CordovaInterface {
|
||||
*/
|
||||
public void onRequestPermissionResult(int requestCode, String[] permissions,
|
||||
int[] grantResults) throws JSONException {
|
||||
if(permissionResultCallback != null)
|
||||
{
|
||||
permissionResultCallback.onRequestPermissionResult(requestCode, permissions, grantResults);
|
||||
permissionResultCallback = null;
|
||||
Pair<CordovaPlugin, Integer> callback = permissionResultCallbacks.getAndRemoveCallback(requestCode);
|
||||
if(callback != null) {
|
||||
callback.first.onRequestPermissionResult(callback.second, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
|
||||
public void requestPermission(CordovaPlugin plugin, int requestCode, String permission) {
|
||||
permissionResultCallback = plugin;
|
||||
String[] permissions = new String [1];
|
||||
permissions[0] = permission;
|
||||
getActivity().requestPermissions(permissions, requestCode);
|
||||
requestPermissions(plugin, requestCode, permissions);
|
||||
}
|
||||
|
||||
public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions)
|
||||
{
|
||||
permissionResultCallback = plugin;
|
||||
getActivity().requestPermissions(permissions, requestCode);
|
||||
public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions) {
|
||||
int mappedRequestCode = permissionResultCallbacks.registerCallback(plugin, requestCode);
|
||||
getActivity().requestPermissions(permissions, mappedRequestCode);
|
||||
}
|
||||
|
||||
public boolean hasPermission(String permission)
|
||||
|
||||
@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
|
||||
* are not expected to implement it.
|
||||
*/
|
||||
public interface CordovaWebView {
|
||||
public static final String CORDOVA_VERSION = "5.2.0-dev";
|
||||
public static final String CORDOVA_VERSION = "5.2.1";
|
||||
|
||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||
|
||||
|
||||
@@ -135,6 +135,7 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
||||
if (recreatePlugins) {
|
||||
// Don't re-initialize on first load.
|
||||
if (loadedUrl != null) {
|
||||
appPlugin = null;
|
||||
pluginManager.init();
|
||||
}
|
||||
loadedUrl = url;
|
||||
|
||||
@@ -37,6 +37,9 @@ class SystemCookieManager implements ICordovaCookieManager {
|
||||
webView = webview;
|
||||
cookieManager = CookieManager.getInstance();
|
||||
|
||||
//REALLY? Nobody has seen this UNTIL NOW?
|
||||
cookieManager.setAcceptFileSchemeCookies(true);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
cookieManager.setAcceptThirdPartyCookies(webView, true);
|
||||
}
|
||||
|
||||
16
node_modules/.bin/nopt
generated
vendored
16
node_modules/.bin/nopt
generated
vendored
@@ -1 +1,15 @@
|
||||
../nopt/bin/nopt.js
|
||||
#!/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/../nopt/bin/nopt.js" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../nopt/bin/nopt.js" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
7
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
7
node_modules/.bin/nopt.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\nopt\bin\nopt.js" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\nopt\bin\nopt.js" %*
|
||||
)
|
||||
16
node_modules/.bin/semver
generated
vendored
16
node_modules/.bin/semver
generated
vendored
@@ -1 +1,15 @@
|
||||
../semver/bin/semver
|
||||
#!/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
|
||||
|
||||
7
node_modules/.bin/semver.cmd
generated
vendored
Normal file
7
node_modules/.bin/semver.cmd
generated
vendored
Normal file
@@ -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" %*
|
||||
)
|
||||
16
node_modules/.bin/shjs
generated
vendored
16
node_modules/.bin/shjs
generated
vendored
@@ -1 +1,15 @@
|
||||
../shelljs/bin/shjs
|
||||
#!/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/../shelljs/bin/shjs" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../shelljs/bin/shjs" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
|
||||
7
node_modules/.bin/shjs.cmd
generated
vendored
Normal file
7
node_modules/.bin/shjs.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\shelljs\bin\shjs" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\shelljs\bin\shjs" %*
|
||||
)
|
||||
4
node_modules/abbrev/.npmignore
generated
vendored
4
node_modules/abbrev/.npmignore
generated
vendored
@@ -1,4 +0,0 @@
|
||||
.nyc_output
|
||||
nyc_output
|
||||
node_modules
|
||||
coverage
|
||||
5
node_modules/abbrev/.travis.yml
generated
vendored
5
node_modules/abbrev/.travis.yml
generated
vendored
@@ -1,5 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.10'
|
||||
- '0.12'
|
||||
- 'iojs'
|
||||
3
node_modules/abbrev/CONTRIBUTING.md
generated
vendored
3
node_modules/abbrev/CONTRIBUTING.md
generated
vendored
@@ -1,3 +0,0 @@
|
||||
To get started, <a
|
||||
href="http://www.clahub.com/agreements/isaacs/abbrev-js">sign the
|
||||
Contributor License Agreement</a>.
|
||||
56
node_modules/abbrev/package.json
generated
vendored
56
node_modules/abbrev/package.json
generated
vendored
@@ -1,41 +1,54 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"abbrev@1",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/nopt"
|
||||
{
|
||||
"raw": "abbrev@1",
|
||||
"scope": null,
|
||||
"escapedName": "abbrev",
|
||||
"name": "abbrev",
|
||||
"rawSpec": "1",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\nopt"
|
||||
]
|
||||
],
|
||||
"_from": "abbrev@>=1.0.0 <2.0.0",
|
||||
"_id": "abbrev@1.0.7",
|
||||
"_id": "abbrev@1.0.9",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/abbrev",
|
||||
"_nodeVersion": "2.0.1",
|
||||
"_npmUser": {
|
||||
"email": "isaacs@npmjs.com",
|
||||
"name": "isaacs"
|
||||
"_nodeVersion": "4.4.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/abbrev-1.0.9.tgz_1466016055839_0.7825860097073019"
|
||||
},
|
||||
"_npmVersion": "2.10.1",
|
||||
"_npmUser": {
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"_npmVersion": "3.9.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "abbrev",
|
||||
"raw": "abbrev@1",
|
||||
"rawSpec": "1",
|
||||
"scope": null,
|
||||
"escapedName": "abbrev",
|
||||
"name": "abbrev",
|
||||
"rawSpec": "1",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz",
|
||||
"_shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843",
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
|
||||
"_shasum": "91b4792588a7738c25f35dd6f63752a2f8776135",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "abbrev@1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/nopt",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\nopt",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter"
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
@@ -43,14 +56,17 @@
|
||||
"dependencies": {},
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^1.2.0"
|
||||
"tap": "^5.7.2"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843",
|
||||
"tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz"
|
||||
"shasum": "91b4792588a7738c25f35dd6f63752a2f8776135",
|
||||
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz"
|
||||
},
|
||||
"gitHead": "821d09ce7da33627f91bbd8ed631497ed6f760c2",
|
||||
"files": [
|
||||
"abbrev.js"
|
||||
],
|
||||
"gitHead": "c386cd9dbb1d8d7581718c54d4ba944cc9298d6f",
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
@@ -70,5 +86,5 @@
|
||||
"scripts": {
|
||||
"test": "tap test.js --cov"
|
||||
},
|
||||
"version": "1.0.7"
|
||||
"version": "1.0.9"
|
||||
}
|
||||
|
||||
47
node_modules/abbrev/test.js
generated
vendored
47
node_modules/abbrev/test.js
generated
vendored
@@ -1,47 +0,0 @@
|
||||
var abbrev = require('./abbrev.js')
|
||||
var assert = require("assert")
|
||||
var util = require("util")
|
||||
|
||||
console.log("TAP version 13")
|
||||
var count = 0
|
||||
|
||||
function test (list, expect) {
|
||||
count++
|
||||
var actual = abbrev(list)
|
||||
assert.deepEqual(actual, expect,
|
||||
"abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
|
||||
"actual: "+util.inspect(actual))
|
||||
actual = abbrev.apply(exports, list)
|
||||
assert.deepEqual(abbrev.apply(exports, list), expect,
|
||||
"abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
|
||||
"actual: "+util.inspect(actual))
|
||||
console.log('ok - ' + list.join(' '))
|
||||
}
|
||||
|
||||
test([ "ruby", "ruby", "rules", "rules", "rules" ],
|
||||
{ rub: 'ruby'
|
||||
, ruby: 'ruby'
|
||||
, rul: 'rules'
|
||||
, rule: 'rules'
|
||||
, rules: 'rules'
|
||||
})
|
||||
test(["fool", "foom", "pool", "pope"],
|
||||
{ fool: 'fool'
|
||||
, foom: 'foom'
|
||||
, poo: 'pool'
|
||||
, pool: 'pool'
|
||||
, pop: 'pope'
|
||||
, pope: 'pope'
|
||||
})
|
||||
test(["a", "ab", "abc", "abcd", "abcde", "acde"],
|
||||
{ a: 'a'
|
||||
, ab: 'ab'
|
||||
, abc: 'abc'
|
||||
, abcd: 'abcd'
|
||||
, abcde: 'abcde'
|
||||
, ac: 'acde'
|
||||
, acd: 'acde'
|
||||
, acde: 'acde'
|
||||
})
|
||||
|
||||
console.log("1..%d", count)
|
||||
39
node_modules/ansi/package.json
generated
vendored
39
node_modules/ansi/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ansi@^0.3.1",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common"
|
||||
{
|
||||
"raw": "ansi@^0.3.1",
|
||||
"scope": null,
|
||||
"escapedName": "ansi",
|
||||
"name": "ansi",
|
||||
"rawSpec": "^0.3.1",
|
||||
"spec": ">=0.3.1 <0.4.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\cordova-common"
|
||||
]
|
||||
],
|
||||
"_from": "ansi@>=0.3.1 <0.4.0",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/ansi",
|
||||
"_nodeVersion": "5.3.0",
|
||||
"_npmUser": {
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
"name": "tootallnate",
|
||||
"email": "nathan@tootallnate.net"
|
||||
},
|
||||
"_npmVersion": "3.3.12",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ansi",
|
||||
"raw": "ansi@^0.3.1",
|
||||
"rawSpec": "^0.3.1",
|
||||
"scope": null,
|
||||
"escapedName": "ansi",
|
||||
"name": "ansi",
|
||||
"rawSpec": "^0.3.1",
|
||||
"spec": ">=0.3.1 <0.4.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
|
||||
"_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ansi@^0.3.1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\cordova-common",
|
||||
"author": {
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "Nathan Rajlich",
|
||||
"email": "nathan@tootallnate.net",
|
||||
"url": "http://tootallnate.net"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -47,19 +56,19 @@
|
||||
"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",
|
||||
"keywords": [
|
||||
"256",
|
||||
"ansi",
|
||||
"color",
|
||||
"cursor",
|
||||
"formatting",
|
||||
"cursor",
|
||||
"color",
|
||||
"terminal",
|
||||
"rgb",
|
||||
"stream",
|
||||
"terminal"
|
||||
"256",
|
||||
"stream"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/ansi.js",
|
||||
|
||||
7
node_modules/balanced-match/.npmignore
generated
vendored
7
node_modules/balanced-match/.npmignore
generated
vendored
@@ -1,2 +1,5 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
test
|
||||
.gitignore
|
||||
.travis.yml
|
||||
Makefile
|
||||
example.js
|
||||
|
||||
3
node_modules/balanced-match/.travis.yml
generated
vendored
3
node_modules/balanced-match/.travis.yml
generated
vendored
@@ -1,3 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
6
node_modules/balanced-match/Makefile
generated
vendored
6
node_modules/balanced-match/Makefile
generated
vendored
@@ -1,6 +0,0 @@
|
||||
|
||||
test:
|
||||
@node_modules/.bin/tape test/*.js
|
||||
|
||||
.PHONY: test
|
||||
|
||||
4
node_modules/balanced-match/README.md
generated
vendored
4
node_modules/balanced-match/README.md
generated
vendored
@@ -1,6 +1,6 @@
|
||||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`.
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
|
||||
|
||||
[](http://travis-ci.org/juliangruber/balanced-match)
|
||||
[](https://www.npmjs.org/package/balanced-match)
|
||||
@@ -16,6 +16,7 @@ var balanced = require('balanced-match');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
|
||||
```
|
||||
|
||||
The matches are:
|
||||
@@ -28,6 +29,7 @@ $ node example.js
|
||||
pre: 'pre',
|
||||
body: 'first',
|
||||
post: 'between{second}post' }
|
||||
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
5
node_modules/balanced-match/example.js
generated
vendored
5
node_modules/balanced-match/example.js
generated
vendored
@@ -1,5 +0,0 @@
|
||||
var balanced = require('./');
|
||||
|
||||
console.log(balanced('{', '}', 'pre{in{nested}}post'));
|
||||
console.log(balanced('{', '}', 'pre{first}between{second}post'));
|
||||
|
||||
8
node_modules/balanced-match/index.js
generated
vendored
8
node_modules/balanced-match/index.js
generated
vendored
@@ -1,5 +1,8 @@
|
||||
module.exports = balanced;
|
||||
function balanced(a, b, str) {
|
||||
if (a instanceof RegExp) a = maybeMatch(a, str);
|
||||
if (b instanceof RegExp) b = maybeMatch(b, str);
|
||||
|
||||
var r = range(a, b, str);
|
||||
|
||||
return r && {
|
||||
@@ -11,6 +14,11 @@ function balanced(a, b, str) {
|
||||
};
|
||||
}
|
||||
|
||||
function maybeMatch(reg, str) {
|
||||
var m = str.match(reg);
|
||||
return m ? m[0] : null;
|
||||
}
|
||||
|
||||
balanced.range = range;
|
||||
function range(a, b, str) {
|
||||
var begs, beg, left, right, result;
|
||||
|
||||
83
node_modules/balanced-match/package.json
generated
vendored
83
node_modules/balanced-match/package.json
generated
vendored
@@ -1,41 +1,54 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"balanced-match@^0.3.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/brace-expansion"
|
||||
{
|
||||
"raw": "balanced-match@^0.4.1",
|
||||
"scope": null,
|
||||
"escapedName": "balanced-match",
|
||||
"name": "balanced-match",
|
||||
"rawSpec": "^0.4.1",
|
||||
"spec": ">=0.4.1 <0.5.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\brace-expansion"
|
||||
]
|
||||
],
|
||||
"_from": "balanced-match@>=0.3.0 <0.4.0",
|
||||
"_id": "balanced-match@0.3.0",
|
||||
"_from": "balanced-match@>=0.4.1 <0.5.0",
|
||||
"_id": "balanced-match@0.4.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/balanced-match",
|
||||
"_nodeVersion": "4.2.1",
|
||||
"_npmUser": {
|
||||
"email": "julian@juliangruber.com",
|
||||
"name": "juliangruber"
|
||||
"_nodeVersion": "6.0.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144"
|
||||
},
|
||||
"_npmVersion": "2.14.7",
|
||||
"_npmUser": {
|
||||
"name": "juliangruber",
|
||||
"email": "julian@juliangruber.com"
|
||||
},
|
||||
"_npmVersion": "3.8.6",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "balanced-match",
|
||||
"raw": "balanced-match@^0.3.0",
|
||||
"rawSpec": "^0.3.0",
|
||||
"raw": "balanced-match@^0.4.1",
|
||||
"scope": null,
|
||||
"spec": ">=0.3.0 <0.4.0",
|
||||
"escapedName": "balanced-match",
|
||||
"name": "balanced-match",
|
||||
"rawSpec": "^0.4.1",
|
||||
"spec": ">=0.4.1 <0.5.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/brace-expansion"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz",
|
||||
"_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756",
|
||||
"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz",
|
||||
"_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "balanced-match@^0.3.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/brace-expansion",
|
||||
"_spec": "balanced-match@^0.4.1",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\brace-expansion",
|
||||
"author": {
|
||||
"email": "mail@juliangruber.com",
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -44,21 +57,21 @@
|
||||
"dependencies": {},
|
||||
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||
"devDependencies": {
|
||||
"tape": "~4.2.2"
|
||||
"tape": "~4.5.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756",
|
||||
"tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz"
|
||||
"shasum": "19053e2e0748eadb379da6c09d455cf5e1039335",
|
||||
"tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz"
|
||||
},
|
||||
"gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5",
|
||||
"gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863",
|
||||
"homepage": "https://github.com/juliangruber/balanced-match",
|
||||
"keywords": [
|
||||
"balanced",
|
||||
"match",
|
||||
"parse",
|
||||
"regexp",
|
||||
"test"
|
||||
"test",
|
||||
"balanced",
|
||||
"parse"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
@@ -79,20 +92,20 @@
|
||||
"test": "make test"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"android-browser/4.2..latest",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"ie/8..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest"
|
||||
],
|
||||
"files": "test/*.js"
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "0.3.0"
|
||||
"version": "0.4.1"
|
||||
}
|
||||
|
||||
84
node_modules/balanced-match/test/balanced.js
generated
vendored
84
node_modules/balanced-match/test/balanced.js
generated
vendored
@@ -1,84 +0,0 @@
|
||||
var test = require('tape');
|
||||
var balanced = require('..');
|
||||
|
||||
test('balanced', function(t) {
|
||||
t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), {
|
||||
start: 3,
|
||||
end: 12,
|
||||
pre: 'pre',
|
||||
body: 'in{nest}',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), {
|
||||
start: 8,
|
||||
end: 11,
|
||||
pre: '{{{{{{{{',
|
||||
body: 'in',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre{body{in}post'), {
|
||||
start: 8,
|
||||
end: 11,
|
||||
pre: 'pre{body',
|
||||
body: 'in',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), {
|
||||
start: 4,
|
||||
end: 13,
|
||||
pre: 'pre}',
|
||||
body: 'in{nest}',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), {
|
||||
start: 3,
|
||||
end: 8,
|
||||
pre: 'pre',
|
||||
body: 'body',
|
||||
post: 'between{body2}post'
|
||||
});
|
||||
t.notOk(balanced('{', '}', 'nope'), 'should be notOk');
|
||||
t.deepEqual(balanced('<b>', '</b>', 'pre<b>in<b>nest</b></b>post'), {
|
||||
start: 3,
|
||||
end: 19,
|
||||
pre: 'pre',
|
||||
body: 'in<b>nest</b>',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('<b>', '</b>', 'pre</b><b>in<b>nest</b></b>post'), {
|
||||
start: 7,
|
||||
end: 23,
|
||||
pre: 'pre</b>',
|
||||
body: 'in<b>nest</b>',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), {
|
||||
start: 3,
|
||||
end: 9,
|
||||
pre: 'pre',
|
||||
body: '{in}',
|
||||
post: 'post'
|
||||
});
|
||||
t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), {
|
||||
start: 3,
|
||||
end: 8,
|
||||
pre: 'pre',
|
||||
body: 'in',
|
||||
post: '}post'
|
||||
});
|
||||
t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), {
|
||||
start: 4,
|
||||
end: 10,
|
||||
pre: 'pre{',
|
||||
body: 'first',
|
||||
post: 'in{second}post'
|
||||
});
|
||||
t.deepEqual(balanced('<?', '?>', 'pre<?>post'), {
|
||||
start: 3,
|
||||
end: 4,
|
||||
pre: 'pre',
|
||||
body: '',
|
||||
post: 'post'
|
||||
});
|
||||
t.end();
|
||||
});
|
||||
43
node_modules/base64-js/package.json
generated
vendored
43
node_modules/base64-js/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"base64-js@0.0.8",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/plist"
|
||||
{
|
||||
"raw": "base64-js@0.0.8",
|
||||
"scope": null,
|
||||
"escapedName": "base64-js",
|
||||
"name": "base64-js",
|
||||
"rawSpec": "0.0.8",
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\plist"
|
||||
]
|
||||
],
|
||||
"_from": "base64-js@0.0.8",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/base64-js",
|
||||
"_nodeVersion": "0.10.35",
|
||||
"_npmUser": {
|
||||
"email": "feross@feross.org",
|
||||
"name": "feross"
|
||||
"name": "feross",
|
||||
"email": "feross@feross.org"
|
||||
},
|
||||
"_npmVersion": "2.1.16",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "base64-js",
|
||||
"raw": "base64-js@0.0.8",
|
||||
"rawSpec": "0.0.8",
|
||||
"scope": null,
|
||||
"escapedName": "base64-js",
|
||||
"name": "base64-js",
|
||||
"rawSpec": "0.0.8",
|
||||
"spec": "0.0.8",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/plist"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz",
|
||||
"_shasum": "1101e9544f4a76b1bc3b26d452ca96d7a35e7978",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "base64-js@0.0.8",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/plist",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\plist",
|
||||
"author": {
|
||||
"email": "t.jameson.little@gmail.com",
|
||||
"name": "T. Jameson Little"
|
||||
"name": "T. Jameson Little",
|
||||
"email": "t.jameson.little@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/beatgammit/base64-js/issues"
|
||||
@@ -48,7 +57,7 @@
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "1101e9544f4a76b1bc3b26d452ca96d7a35e7978",
|
||||
"tarball": "http://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz"
|
||||
"tarball": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -78,16 +87,16 @@
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/6..latest",
|
||||
"chrome/4..latest",
|
||||
"firefox/3..latest",
|
||||
"ie/6..latest",
|
||||
"ipad/6",
|
||||
"iphone/6",
|
||||
"safari/5.1..latest",
|
||||
"opera/11.0..latest",
|
||||
"safari/5.1..latest"
|
||||
],
|
||||
"files": "test/*.js"
|
||||
"iphone/6",
|
||||
"ipad/6"
|
||||
]
|
||||
},
|
||||
"version": "0.0.8"
|
||||
}
|
||||
|
||||
92
node_modules/big-integer/BigInteger.js
generated
vendored
92
node_modules/big-integer/BigInteger.js
generated
vendored
@@ -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
|
||||
|
||||
34
node_modules/big-integer/BigInteger.min.js
generated
vendored
34
node_modules/big-integer/BigInteger.min.js
generated
vendored
File diff suppressed because one or more lines are too long
24
node_modules/big-integer/LICENSE
generated
vendored
Normal file
24
node_modules/big-integer/LICENSE
generated
vendored
Normal file
@@ -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>
|
||||
55
node_modules/big-integer/package.json
generated
vendored
55
node_modules/big-integer/package.json
generated
vendored
@@ -1,45 +1,54 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"big-integer@^1.6.7",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser"
|
||||
{
|
||||
"raw": "big-integer@^1.6.7",
|
||||
"scope": null,
|
||||
"escapedName": "big-integer",
|
||||
"name": "big-integer",
|
||||
"rawSpec": "^1.6.7",
|
||||
"spec": ">=1.6.7 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\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",
|
||||
"name": "peterolson"
|
||||
"name": "peterolson",
|
||||
"email": "peter.e.c.olson+npm@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.9.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "big-integer",
|
||||
"raw": "big-integer@^1.6.7",
|
||||
"rawSpec": "^1.6.7",
|
||||
"scope": null,
|
||||
"escapedName": "big-integer",
|
||||
"name": "big-integer",
|
||||
"rawSpec": "^1.6.7",
|
||||
"spec": ">=1.6.7 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bplist-parser"
|
||||
],
|
||||
"_resolved": "http://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/steveng/repo/cordova/cordova-android/node_modules/bplist-parser",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\bplist-parser",
|
||||
"author": {
|
||||
"email": "peter.e.c.olson+npm@gmail.com",
|
||||
"name": "Peter Olson"
|
||||
"name": "Peter Olson",
|
||||
"email": "peter.e.c.olson+npm@gmail.com"
|
||||
},
|
||||
"bin": {},
|
||||
"bugs": {
|
||||
@@ -59,24 +68,24 @@
|
||||
},
|
||||
"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": [
|
||||
"arbitrary",
|
||||
"arithmetic",
|
||||
"math",
|
||||
"big",
|
||||
"bignum",
|
||||
"bigint",
|
||||
"biginteger",
|
||||
"bignum",
|
||||
"integer",
|
||||
"math",
|
||||
"precision"
|
||||
"arbitrary",
|
||||
"precision",
|
||||
"arithmetic"
|
||||
],
|
||||
"license": "Unlicense",
|
||||
"main": "./BigInteger",
|
||||
@@ -96,5 +105,5 @@
|
||||
"scripts": {
|
||||
"test": "karma start my.conf.js"
|
||||
},
|
||||
"version": "1.6.12"
|
||||
"version": "1.6.15"
|
||||
}
|
||||
|
||||
35
node_modules/bplist-parser/package.json
generated
vendored
35
node_modules/bplist-parser/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"bplist-parser@^0.1.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common"
|
||||
{
|
||||
"raw": "bplist-parser@^0.1.0",
|
||||
"scope": null,
|
||||
"escapedName": "bplist-parser",
|
||||
"name": "bplist-parser",
|
||||
"rawSpec": "^0.1.0",
|
||||
"spec": ">=0.1.0 <0.2.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\cordova-common"
|
||||
]
|
||||
],
|
||||
"_from": "bplist-parser@>=0.1.0 <0.2.0",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/bplist-parser",
|
||||
"_nodeVersion": "5.1.0",
|
||||
"_npmUser": {
|
||||
"email": "joe@fernsroth.com",
|
||||
"name": "joeferner"
|
||||
"name": "joeferner",
|
||||
"email": "joe@fernsroth.com"
|
||||
},
|
||||
"_npmVersion": "3.4.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "bplist-parser",
|
||||
"raw": "bplist-parser@^0.1.0",
|
||||
"rawSpec": "^0.1.0",
|
||||
"scope": null,
|
||||
"escapedName": "bplist-parser",
|
||||
"name": "bplist-parser",
|
||||
"rawSpec": "^0.1.0",
|
||||
"spec": ">=0.1.0 <0.2.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
|
||||
"_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "bplist-parser@^0.1.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\cordova-common",
|
||||
"author": {
|
||||
"email": "joe.ferner@nearinfinity.com",
|
||||
"name": "Joe Ferner"
|
||||
"name": "Joe Ferner",
|
||||
"email": "joe.ferner@nearinfinity.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nearinfinity/node-bplist-parser/issues"
|
||||
@@ -50,14 +59,14 @@
|
||||
"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",
|
||||
"keywords": [
|
||||
"bplist",
|
||||
"parser",
|
||||
"plist"
|
||||
"plist",
|
||||
"parser"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "bplistParser.js",
|
||||
|
||||
3
node_modules/brace-expansion/.npmignore
generated
vendored
3
node_modules/brace-expansion/.npmignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
test
|
||||
.gitignore
|
||||
.travis.yml
|
||||
8
node_modules/brace-expansion/example.js
generated
vendored
8
node_modules/brace-expansion/example.js
generated
vendored
@@ -1,8 +0,0 @@
|
||||
var expand = require('./');
|
||||
|
||||
console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html'));
|
||||
console.log(expand('http://www.numericals.com/file{1..100..10}.txt'));
|
||||
console.log(expand('http://www.letters.com/file{a..z..2}.txt'));
|
||||
console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}'));
|
||||
console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}'));
|
||||
|
||||
69
node_modules/brace-expansion/package.json
generated
vendored
69
node_modules/brace-expansion/package.json
generated
vendored
@@ -1,64 +1,73 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"brace-expansion@^1.0.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch"
|
||||
{
|
||||
"raw": "brace-expansion@^1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "brace-expansion",
|
||||
"name": "brace-expansion",
|
||||
"rawSpec": "^1.0.0",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\minimatch"
|
||||
]
|
||||
],
|
||||
"_from": "brace-expansion@>=1.0.0 <2.0.0",
|
||||
"_id": "brace-expansion@1.1.3",
|
||||
"_id": "brace-expansion@1.1.5",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/brace-expansion",
|
||||
"_nodeVersion": "5.5.0",
|
||||
"_nodeVersion": "4.4.5",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-6-west.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168"
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/brace-expansion-1.1.5.tgz_1465989660138_0.34528115345165133"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "julian@juliangruber.com",
|
||||
"name": "juliangruber"
|
||||
"name": "juliangruber",
|
||||
"email": "julian@juliangruber.com"
|
||||
},
|
||||
"_npmVersion": "3.3.12",
|
||||
"_npmVersion": "2.15.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "brace-expansion",
|
||||
"raw": "brace-expansion@^1.0.0",
|
||||
"rawSpec": "^1.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "brace-expansion",
|
||||
"name": "brace-expansion",
|
||||
"rawSpec": "^1.0.0",
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/minimatch"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz",
|
||||
"_shasum": "46bff50115d47fc9ab89854abb87d98078a10991",
|
||||
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz",
|
||||
"_shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "brace-expansion@^1.0.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/minimatch",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\minimatch",
|
||||
"author": {
|
||||
"email": "mail@juliangruber.com",
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/juliangruber/brace-expansion/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": "^0.3.0",
|
||||
"balanced-match": "^0.4.1",
|
||||
"concat-map": "0.0.1"
|
||||
},
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"devDependencies": {
|
||||
"tape": "4.4.0"
|
||||
"tape": "4.5.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "46bff50115d47fc9ab89854abb87d98078a10991",
|
||||
"tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz"
|
||||
"shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526",
|
||||
"tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz"
|
||||
},
|
||||
"gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231",
|
||||
"gitHead": "ff31acab078f1bb696ac4c55ca56ea24e6495fb6",
|
||||
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||
"keywords": [],
|
||||
"license": "MIT",
|
||||
@@ -85,20 +94,20 @@
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"android-browser/4.2..latest",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"ie/8..latest",
|
||||
"firefox/20..latest",
|
||||
"firefox/nightly",
|
||||
"ie/8..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"chrome/25..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest"
|
||||
],
|
||||
"files": "test/*.js"
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "1.1.3"
|
||||
"version": "1.1.5"
|
||||
}
|
||||
|
||||
59
node_modules/concat-map/package.json
generated
vendored
59
node_modules/concat-map/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"concat-map@0.0.1",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/brace-expansion"
|
||||
{
|
||||
"raw": "concat-map@0.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "concat-map",
|
||||
"name": "concat-map",
|
||||
"rawSpec": "0.0.1",
|
||||
"spec": "0.0.1",
|
||||
"type": "version"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\brace-expansion"
|
||||
]
|
||||
],
|
||||
"_from": "concat-map@0.0.1",
|
||||
@@ -11,30 +19,31 @@
|
||||
"_installable": true,
|
||||
"_location": "/concat-map",
|
||||
"_npmUser": {
|
||||
"email": "mail@substack.net",
|
||||
"name": "substack"
|
||||
"name": "substack",
|
||||
"email": "mail@substack.net"
|
||||
},
|
||||
"_npmVersion": "1.3.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "concat-map",
|
||||
"raw": "concat-map@0.0.1",
|
||||
"rawSpec": "0.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "concat-map",
|
||||
"name": "concat-map",
|
||||
"rawSpec": "0.0.1",
|
||||
"spec": "0.0.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/brace-expansion"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "concat-map@0.0.1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/brace-expansion",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\brace-expansion",
|
||||
"author": {
|
||||
"email": "mail@substack.net",
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -51,15 +60,15 @@
|
||||
},
|
||||
"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": [
|
||||
"concat",
|
||||
"concatMap",
|
||||
"map",
|
||||
"functional",
|
||||
"higher-order",
|
||||
"map"
|
||||
"higher-order"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
@@ -80,30 +89,30 @@
|
||||
"test": "tape test/*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": {
|
||||
"chrome": [
|
||||
10,
|
||||
22
|
||||
],
|
||||
"ff": [
|
||||
10,
|
||||
15,
|
||||
3.5
|
||||
],
|
||||
"ie": [
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
],
|
||||
"opera": [
|
||||
12
|
||||
"ff": [
|
||||
3.5,
|
||||
10,
|
||||
15
|
||||
],
|
||||
"chrome": [
|
||||
10,
|
||||
22
|
||||
],
|
||||
"safari": [
|
||||
5.1
|
||||
],
|
||||
"opera": [
|
||||
12
|
||||
]
|
||||
},
|
||||
"files": "test/*.js"
|
||||
}
|
||||
},
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
||||
46
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
46
node_modules/cordova-common/RELEASENOTES.md
generated
vendored
@@ -20,23 +20,45 @@
|
||||
-->
|
||||
# Cordova-common Release Notes
|
||||
|
||||
### 1.3.0 (May 12, 2016)
|
||||
* [CB-11259](https://issues.apache.org/jira/browse/CB-11259): Improving prepare and build logging
|
||||
* [CB-11194](https://issues.apache.org/jira/browse/CB-11194) Improve cordova load time
|
||||
* [CB-1117](https://issues.apache.org/jira/browse/CB-1117) Add `FileUpdater` module to `cordova-common`.
|
||||
* [CB-11131](https://issues.apache.org/jira/browse/CB-11131) Fix `TypeError: message.toUpperCase` is not a function in `CordovaLogger`
|
||||
|
||||
### 1.2.0 (Apr 18, 2016)
|
||||
* [CB-11022](https://issues.apache.org/jira/browse/CB-11022) Save modulesMetadata to both www and platform_www when necessary
|
||||
* [CB-10833](https://issues.apache.org/jira/browse/CB-10833) Deduplicate common logic for plugin installation/uninstallation
|
||||
* [CB-10822](https://issues.apache.org/jira/browse/CB-10822) Manage plugins/modules metadata using PlatformJson
|
||||
* [CB-10940](https://issues.apache.org/jira/browse/CB-10940) Can't add Android platform from path
|
||||
* [CB-10965](https://issues.apache.org/jira/browse/CB-10965) xml helper allows multiple instances to be merge in config.xml
|
||||
|
||||
### 1.1.1 (Mar 18, 2016)
|
||||
* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Update test to reflect merging of [CB-9264](https://issues.apache.org/jira/browse/CB-9264) fix
|
||||
* [CB-10694](https://issues.apache.org/jira/browse/CB-10694) Platform-specific configuration preferences don't override global settings
|
||||
* [CB-9264](https://issues.apache.org/jira/browse/CB-9264) Duplicate entries in `config.xml`
|
||||
* [CB-10791](https://issues.apache.org/jira/browse/CB-10791) Add `adjustLoggerLevel` to `cordova-common.CordovaLogger`
|
||||
* [CB-10662](https://issues.apache.org/jira/browse/CB-10662) Add tests for `ConfigParser.getStaticResources`
|
||||
* [CB-10622](https://issues.apache.org/jira/browse/CB-10622) fix target attribute being ignored for images in `config.xml`.
|
||||
* [CB-10583](https://issues.apache.org/jira/browse/CB-10583) Protect plugin preferences from adding extra Array properties.
|
||||
|
||||
### 1.1.0 (Feb 16, 2016)
|
||||
* CB-10482 Remove references to windows8 from cordova-lib/cli
|
||||
* CB-10430 Adds forwardEvents method to easily connect two EventEmitters
|
||||
* CB-10176 Adds CordovaLogger class, based on logger module from cordova-cli
|
||||
* CB-10052 Expose child process' io streams via promise progress notification
|
||||
* CB-10497 Prefer .bat over .cmd on windows platform
|
||||
* CB-9984 Bumps plist version and fixes failing cordova-common test
|
||||
* [CB-10482](https://issues.apache.org/jira/browse/CB-10482) Remove references to windows8 from cordova-lib/cli
|
||||
* [CB-10430](https://issues.apache.org/jira/browse/CB-10430) Adds forwardEvents method to easily connect two EventEmitters
|
||||
* [CB-10176](https://issues.apache.org/jira/browse/CB-10176) Adds CordovaLogger class, based on logger module from cordova-cli
|
||||
* [CB-10052](https://issues.apache.org/jira/browse/CB-10052) Expose child process' io streams via promise progress notification
|
||||
* [CB-10497](https://issues.apache.org/jira/browse/CB-10497) Prefer .bat over .cmd on windows platform
|
||||
* [CB-9984](https://issues.apache.org/jira/browse/CB-9984) Bumps plist version and fixes failing cordova-common test
|
||||
|
||||
### 1.0.0 (Oct 29, 2015)
|
||||
|
||||
* CB-9890 Documents cordova-common
|
||||
* CB-9598 Correct cordova-lib -> cordova-common in README
|
||||
* [CB-9890](https://issues.apache.org/jira/browse/CB-9890) Documents cordova-common
|
||||
* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Correct cordova-lib -> cordova-common in README
|
||||
* Pick ConfigParser changes from apache@0c3614e
|
||||
* CB-9743 Removes system frameworks handling from ConfigChanges
|
||||
* CB-9598 Cleans out code which has been moved to `cordova-common`
|
||||
* [CB-9743](https://issues.apache.org/jira/browse/CB-9743) Removes system frameworks handling from ConfigChanges
|
||||
* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Cleans out code which has been moved to `cordova-common`
|
||||
* Pick ConfigParser changes from apache@ddb027b
|
||||
* Picking CordovaError changes from apache@a3b1fca
|
||||
* CB-9598 Adds tests and fixtures based on existing cordova-lib ones
|
||||
* CB-9598 Initial implementation for cordova-common
|
||||
* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Adds tests and fixtures based on existing cordova-lib ones
|
||||
* [CB-9598](https://issues.apache.org/jira/browse/CB-9598) Initial implementation for cordova-common
|
||||
|
||||
|
||||
41
node_modules/cordova-common/cordova-common.js
generated
vendored
41
node_modules/cordova-common/cordova-common.js
generated
vendored
@@ -17,27 +17,30 @@
|
||||
under the License.
|
||||
*/
|
||||
|
||||
/* jshint node:true */
|
||||
var addProperty = require('./src/util/addProperty');
|
||||
|
||||
// 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'),
|
||||
module.exports = { };
|
||||
|
||||
ActionStack: require('./src/ActionStack'),
|
||||
CordovaError: require('./src/CordovaError/CordovaError'),
|
||||
CordovaLogger: require('./src/CordovaLogger'),
|
||||
CordovaExternalToolErrorContext: require('./src/CordovaError/CordovaExternalToolErrorContext'),
|
||||
PlatformJson: require('./src/PlatformJson'),
|
||||
ConfigParser: require('./src/ConfigParser/ConfigParser.js'),
|
||||
addProperty(module, 'events', './src/events');
|
||||
addProperty(module, 'superspawn', './src/superspawn');
|
||||
|
||||
PluginInfo: require('./src/PluginInfo/PluginInfo.js'),
|
||||
PluginInfoProvider: require('./src/PluginInfo/PluginInfoProvider.js'),
|
||||
addProperty(module, 'ActionStack', './src/ActionStack');
|
||||
addProperty(module, 'CordovaError', './src/CordovaError/CordovaError');
|
||||
addProperty(module, 'CordovaLogger', './src/CordovaLogger');
|
||||
addProperty(module, 'CordovaExternalToolErrorContext', './src/CordovaError/CordovaExternalToolErrorContext');
|
||||
addProperty(module, 'PlatformJson', './src/PlatformJson');
|
||||
addProperty(module, 'ConfigParser', './src/ConfigParser/ConfigParser');
|
||||
addProperty(module, 'FileUpdater', './src/FileUpdater');
|
||||
|
||||
ConfigChanges: require('./src/ConfigChanges/ConfigChanges.js'),
|
||||
ConfigKeeper: require('./src/ConfigChanges/ConfigKeeper.js'),
|
||||
ConfigFile: require('./src/ConfigChanges/ConfigFile.js'),
|
||||
mungeUtil: require('./src/ConfigChanges/munge-util.js'),
|
||||
addProperty(module, 'PluginInfo', './src/PluginInfo/PluginInfo');
|
||||
addProperty(module, 'PluginInfoProvider', './src/PluginInfo/PluginInfoProvider');
|
||||
|
||||
addProperty(module, 'PluginManager', './src/PluginManager');
|
||||
|
||||
addProperty(module, 'ConfigChanges', './src/ConfigChanges/ConfigChanges');
|
||||
addProperty(module, 'ConfigKeeper', './src/ConfigChanges/ConfigKeeper');
|
||||
addProperty(module, 'ConfigFile', './src/ConfigChanges/ConfigFile');
|
||||
addProperty(module, 'mungeUtil', './src/ConfigChanges/munge-util');
|
||||
|
||||
addProperty(module, 'xmlHelpers', './src/util/xml-helpers');
|
||||
|
||||
xmlHelpers: require('./src/util/xml-helpers')
|
||||
};
|
||||
|
||||
62
node_modules/cordova-common/package.json
generated
vendored
62
node_modules/cordova-common/package.json
generated
vendored
@@ -1,48 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"cordova-common@^1.1.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android"
|
||||
{
|
||||
"raw": "cordova-common@^1.3.0",
|
||||
"scope": null,
|
||||
"escapedName": "cordova-common",
|
||||
"name": "cordova-common",
|
||||
"rawSpec": "^1.3.0",
|
||||
"spec": ">=1.3.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android"
|
||||
]
|
||||
],
|
||||
"_from": "cordova-common@>=1.1.0 <2.0.0",
|
||||
"_id": "cordova-common@1.1.0",
|
||||
"_from": "cordova-common@>=1.3.0 <2.0.0",
|
||||
"_id": "cordova-common@1.3.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/cordova-common",
|
||||
"_nodeVersion": "4.2.3",
|
||||
"_nodeVersion": "5.4.1",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-5-east.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-1.1.0.tgz_1455781889491_0.6937742941081524"
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/cordova-common-1.3.0.tgz_1464130094288_0.48495062021538615"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "kotikov.vladimir@gmail.com",
|
||||
"name": "kotikov.vladimir"
|
||||
"name": "stevegill",
|
||||
"email": "stevengill97@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.14.7",
|
||||
"_npmVersion": "3.9.0",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "cordova-common",
|
||||
"raw": "cordova-common@^1.1.0",
|
||||
"rawSpec": "^1.1.0",
|
||||
"raw": "cordova-common@^1.3.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.1.0 <2.0.0",
|
||||
"escapedName": "cordova-common",
|
||||
"name": "cordova-common",
|
||||
"rawSpec": "^1.3.0",
|
||||
"spec": ">=1.3.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-1.1.0.tgz",
|
||||
"_shasum": "8682721466ee354747ec6241f34f412b7e0ef636",
|
||||
"_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.3.0.tgz",
|
||||
"_shasum": "f75161f6aa7cef5486fd5d69a3b0a1f628334491",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "cordova-common@^1.1.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
"_spec": "cordova-common@^1.3.0",
|
||||
"_where": "d:\\cordova\\cordova-android",
|
||||
"author": {
|
||||
"name": "Apache Software Foundation"
|
||||
},
|
||||
"bugs": {
|
||||
"email": "dev@cordova.apache.org",
|
||||
"url": "https://issues.apache.org/jira/browse/CB"
|
||||
"url": "https://issues.apache.org/jira/browse/CB",
|
||||
"email": "dev@cordova.apache.org"
|
||||
},
|
||||
"contributors": [],
|
||||
"dependencies": {
|
||||
@@ -51,11 +60,12 @@
|
||||
"cordova-registry-mapper": "^1.1.8",
|
||||
"elementtree": "^0.1.6",
|
||||
"glob": "^5.0.13",
|
||||
"minimatch": "^3.0.0",
|
||||
"osenv": "^0.1.3",
|
||||
"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"
|
||||
},
|
||||
@@ -63,12 +73,14 @@
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.3.17",
|
||||
"jasmine-node": "^1.14.5",
|
||||
"jshint": "^2.8.0"
|
||||
"jshint": "^2.8.0",
|
||||
"promise-matchers": "^0.9.6",
|
||||
"rewire": "^2.5.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "8682721466ee354747ec6241f34f412b7e0ef636",
|
||||
"tarball": "http://registry.npmjs.org/cordova-common/-/cordova-common-1.1.0.tgz"
|
||||
"shasum": "f75161f6aa7cef5486fd5d69a3b0a1f628334491",
|
||||
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.3.0.tgz"
|
||||
},
|
||||
"engineStrict": true,
|
||||
"engines": {
|
||||
@@ -115,5 +127,5 @@
|
||||
"jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
|
||||
"test": "npm run jshint && npm run jasmine"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
"version": "1.3.0"
|
||||
}
|
||||
|
||||
46
node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
generated
vendored
46
node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
generated
vendored
@@ -17,13 +17,17 @@
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var bplist = require('bplist-parser');
|
||||
var et = require('elementtree');
|
||||
var glob = require('glob');
|
||||
var plist = require('plist');
|
||||
var modules = {};
|
||||
var addProperty = require('../util/addProperty');
|
||||
|
||||
var plist_helpers = require('../util/plist-helpers');
|
||||
var xml_helpers = require('../util/xml-helpers');
|
||||
// Use delay loading to ensure plist and other node modules to not get loaded
|
||||
// on Android, Windows platforms
|
||||
addProperty(module, 'bplist', 'bplist-parser', modules);
|
||||
addProperty(module, 'et', 'elementtree', modules);
|
||||
addProperty(module, 'glob', 'glob', modules);
|
||||
addProperty(module, 'plist', 'plist', modules);
|
||||
addProperty(module, 'plist_helpers', '../util/plist-helpers', modules);
|
||||
addProperty(module, 'xml_helpers', '../util/xml-helpers', modules);
|
||||
|
||||
/******************************************************************************
|
||||
* ConfigFile class
|
||||
@@ -67,7 +71,7 @@ function ConfigFile_load() {
|
||||
// the same in a future release
|
||||
if (ext == '.xml' || ext == '.appxmanifest') {
|
||||
self.type = 'xml';
|
||||
self.data = xml_helpers.parseElementtreeSync(filepath);
|
||||
self.data = modules.xml_helpers.parseElementtreeSync(filepath);
|
||||
} else {
|
||||
// plist file
|
||||
self.type = 'plist';
|
||||
@@ -76,8 +80,8 @@ function ConfigFile_load() {
|
||||
// Do we still need to support binary plist?
|
||||
// If yes, use plist.parseStringSync() and read the file once.
|
||||
self.data = isBinaryPlist(filepath) ?
|
||||
bplist.parseBuffer(fs.readFileSync(filepath)) :
|
||||
plist.parse(fs.readFileSync(filepath, 'utf8'));
|
||||
modules.bplist.parseBuffer(fs.readFileSync(filepath)) :
|
||||
modules.plist.parse(fs.readFileSync(filepath, 'utf8'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +92,7 @@ ConfigFile.prototype.save = function ConfigFile_save() {
|
||||
} else {
|
||||
// plist
|
||||
var regExp = new RegExp('<string>[ \t\r\n]+?</string>', 'g');
|
||||
fs.writeFileSync(self.filepath, plist.build(self.data).replace(regExp, '<string></string>'));
|
||||
fs.writeFileSync(self.filepath, modules.plist.build(self.data).replace(regExp, '<string></string>'));
|
||||
}
|
||||
self.is_changed = false;
|
||||
};
|
||||
@@ -98,16 +102,16 @@ ConfigFile.prototype.graft_child = function ConfigFile_graft_child(selector, xml
|
||||
var filepath = self.filepath;
|
||||
var result;
|
||||
if (self.type === 'xml') {
|
||||
var xml_to_graft = [et.XML(xml_child.xml)];
|
||||
result = xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after);
|
||||
var xml_to_graft = [modules.et.XML(xml_child.xml)];
|
||||
result = modules.xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after);
|
||||
if ( !result) {
|
||||
throw new Error('grafting xml at selector "' + selector + '" from "' + filepath + '" during config install went bad :(');
|
||||
throw new Error('Unable to graft xml at selector "' + selector + '" from "' + filepath + '" during config install');
|
||||
}
|
||||
} else {
|
||||
// plist file
|
||||
result = plist_helpers.graftPLIST(self.data, xml_child.xml, selector);
|
||||
result = modules.plist_helpers.graftPLIST(self.data, xml_child.xml, selector);
|
||||
if ( !result ) {
|
||||
throw new Error('grafting to plist "' + filepath + '" during config install went bad :(');
|
||||
throw new Error('Unable to graft plist "' + filepath + '" during config install');
|
||||
}
|
||||
}
|
||||
self.is_changed = true;
|
||||
@@ -118,11 +122,11 @@ ConfigFile.prototype.prune_child = function ConfigFile_prune_child(selector, xml
|
||||
var filepath = self.filepath;
|
||||
var result;
|
||||
if (self.type === 'xml') {
|
||||
var xml_to_graft = [et.XML(xml_child.xml)];
|
||||
result = xml_helpers.pruneXML(self.data, xml_to_graft, selector);
|
||||
var xml_to_graft = [modules.et.XML(xml_child.xml)];
|
||||
result = modules.xml_helpers.pruneXML(self.data, xml_to_graft, selector);
|
||||
} else {
|
||||
// plist file
|
||||
result = plist_helpers.prunePLIST(self.data, xml_child.xml, selector);
|
||||
result = modules.plist_helpers.prunePLIST(self.data, xml_child.xml, selector);
|
||||
}
|
||||
if (!result) {
|
||||
var err_msg = 'Pruning at selector "' + selector + '" from "' + filepath + '" went bad.';
|
||||
@@ -140,7 +144,7 @@ function resolveConfigFilePath(project_dir, platform, file) {
|
||||
|
||||
if (file.indexOf('*') > -1) {
|
||||
// handle wildcards in targets using glob.
|
||||
matches = glob.sync(path.join(project_dir, '**', file));
|
||||
matches = modules.glob.sync(path.join(project_dir, '**', file));
|
||||
if (matches.length) filepath = matches[0];
|
||||
|
||||
// [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
|
||||
@@ -167,7 +171,7 @@ function resolveConfigFilePath(project_dir, platform, file) {
|
||||
} else if (platform == 'android') {
|
||||
filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
|
||||
} else {
|
||||
matches = glob.sync(path.join(project_dir, '**', 'config.xml'));
|
||||
matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml'));
|
||||
if (matches.length) filepath = matches[0];
|
||||
}
|
||||
return filepath;
|
||||
@@ -180,7 +184,7 @@ function resolveConfigFilePath(project_dir, platform, file) {
|
||||
// Find out the real name of an iOS project
|
||||
// TODO: glob is slow, need a better way or caching, or avoid using more than once.
|
||||
function getIOSProjectname(project_dir) {
|
||||
var matches = glob.sync(path.join(project_dir, '*.xcodeproj'));
|
||||
var matches = modules.glob.sync(path.join(project_dir, '*.xcodeproj'));
|
||||
var iospath;
|
||||
if (matches.length === 1) {
|
||||
iospath = path.basename(matches[0],'.xcodeproj');
|
||||
|
||||
1
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
1
node_modules/cordova-common/src/ConfigParser/ConfigParser.js
generated
vendored
@@ -186,6 +186,7 @@ ConfigParser.prototype = {
|
||||
staticResources.forEach(function (elt) {
|
||||
var res = {};
|
||||
res.src = elt.attrib.src;
|
||||
res.target = elt.attrib.target || undefined;
|
||||
res.density = elt.attrib['density'] || elt.attrib[that.cdvNamespacePrefix+':density'] || elt.attrib['gap:density'];
|
||||
res.platform = elt.platform || null; // null means icon represents default icon (shared between platforms)
|
||||
res.width = +elt.attrib.width || undefined;
|
||||
|
||||
27
node_modules/cordova-common/src/CordovaLogger.js
generated
vendored
27
node_modules/cordova-common/src/CordovaLogger.js
generated
vendored
@@ -89,7 +89,7 @@ CordovaLogger.prototype.log = function (logLevel, message) {
|
||||
var isVerbose = this.logLevel === 'verbose';
|
||||
var cursor = this.stdoutCursor;
|
||||
|
||||
if(message instanceof Error || logLevel === CordovaLogger.ERROR) {
|
||||
if (message instanceof Error || logLevel === CordovaLogger.ERROR) {
|
||||
message = formatError(message, isVerbose);
|
||||
cursor = this.stderrCursor;
|
||||
}
|
||||
@@ -152,6 +152,23 @@ CordovaLogger.prototype.setLevel = function (logLevel) {
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adjusts the current logger level according to the passed options.
|
||||
*
|
||||
* @param {Object|Array} opts An object or args array with options
|
||||
*
|
||||
* @return {CordovaLogger} Current instance, to allow calls chaining.
|
||||
*/
|
||||
CordovaLogger.prototype.adjustLevel = function (opts) {
|
||||
if (opts.verbose || (Array.isArray(opts) && opts.indexOf('--verbose') !== -1)) {
|
||||
this.setLevel('verbose');
|
||||
} else if (opts.silent || (Array.isArray(opts) && opts.indexOf('--silent') !== -1)) {
|
||||
this.setLevel('error');
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Attaches logger to EventEmitter instance provided.
|
||||
*
|
||||
@@ -179,10 +196,10 @@ CordovaLogger.prototype.subscribe = function (eventEmitter) {
|
||||
function formatError(error, isVerbose) {
|
||||
var message = '';
|
||||
|
||||
if(error instanceof CordovaError) {
|
||||
if (error instanceof CordovaError) {
|
||||
message = error.toString(isVerbose);
|
||||
} else if(error instanceof Error) {
|
||||
if(isVerbose) {
|
||||
} else if (error instanceof Error) {
|
||||
if (isVerbose) {
|
||||
message = error.stack;
|
||||
} else {
|
||||
message = error.message;
|
||||
@@ -192,7 +209,7 @@ function formatError(error, isVerbose) {
|
||||
message = error;
|
||||
}
|
||||
|
||||
if(message.toUpperCase().indexOf('ERROR:') !== 0) {
|
||||
if (typeof message === 'string' && message.toUpperCase().indexOf('ERROR:') !== 0) {
|
||||
// Needed for backward compatibility with external tools
|
||||
message = 'Error: ' + message;
|
||||
}
|
||||
|
||||
422
node_modules/cordova-common/src/FileUpdater.js
generated
vendored
Normal file
422
node_modules/cordova-common/src/FileUpdater.js
generated
vendored
Normal file
@@ -0,0 +1,422 @@
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var shell = require("shelljs");
|
||||
var minimatch = require("minimatch");
|
||||
|
||||
/**
|
||||
* Logging callback used in the FileUpdater methods.
|
||||
* @callback loggingCallback
|
||||
* @param {string} message A message describing a single file update operation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Updates a target file or directory with a source file or directory. (Directory updates are
|
||||
* not recursive.) Stats for target and source items must be passed in. This is an internal
|
||||
* helper function used by other methods in this module.
|
||||
*
|
||||
* @param {?string} sourcePath Source file or directory to be used to update the
|
||||
* destination. If the source is null, then the destination is deleted if it exists.
|
||||
* @param {?fs.Stats} sourceStats An instance of fs.Stats for the source path, or null if
|
||||
* the source does not exist.
|
||||
* @param {string} targetPath Required destination file or directory to be updated. If it does
|
||||
* not exist, it will be created.
|
||||
* @param {?fs.Stats} targetStats An instance of fs.Stats for the target path, or null if
|
||||
* the target does not exist.
|
||||
* @param {Object} [options] Optional additional parameters for the update.
|
||||
* @param {string} [options.rootDir] Optional root directory (such as a project) to which target
|
||||
* and source path parameters are relative; may be omitted if the paths are absolute. The
|
||||
* rootDir is always omitted from any logged paths, to make the logs easier to read.
|
||||
* @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
|
||||
* Otherwise, a file is copied if the source's last-modified time is greather than or
|
||||
* equal to the target's last-modified time, or if the file sizes are different.
|
||||
* @param {loggingCallback} [log] Optional logging callback that takes a string message
|
||||
* describing any file operations that are performed.
|
||||
* @return {boolean} true if any changes were made, or false if the force flag is not set
|
||||
* and everything was up to date
|
||||
*/
|
||||
function updatePathWithStats(sourcePath, sourceStats, targetPath, targetStats, options, log) {
|
||||
var updated = false;
|
||||
|
||||
var rootDir = (options && options.rootDir) || "";
|
||||
var copyAll = (options && options.all) || false;
|
||||
|
||||
var targetFullPath = path.join(rootDir || "", targetPath);
|
||||
|
||||
if (sourceStats) {
|
||||
var sourceFullPath = path.join(rootDir || "", sourcePath);
|
||||
|
||||
if (targetStats) {
|
||||
// The target exists. But if the directory status doesn't match the source, delete it.
|
||||
if (targetStats.isDirectory() && !sourceStats.isDirectory()) {
|
||||
log("rmdir " + targetPath + " (source is a file)");
|
||||
shell.rm("-rf", targetFullPath);
|
||||
targetStats = null;
|
||||
updated = true;
|
||||
} else if (!targetStats.isDirectory() && sourceStats.isDirectory()) {
|
||||
log("delete " + targetPath + " (source is a directory)");
|
||||
shell.rm("-f", targetFullPath);
|
||||
targetStats = null;
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!targetStats) {
|
||||
if (sourceStats.isDirectory()) {
|
||||
// The target directory does not exist, so it should be created.
|
||||
log("mkdir " + targetPath);
|
||||
shell.mkdir("-p", targetFullPath);
|
||||
updated = true;
|
||||
} else if (sourceStats.isFile()) {
|
||||
// The target file does not exist, so it should be copied from the source.
|
||||
log("copy " + sourcePath + " " + targetPath + (copyAll ? "" : " (new file)"));
|
||||
shell.cp("-f", sourceFullPath, targetFullPath);
|
||||
updated = true;
|
||||
}
|
||||
} else if (sourceStats.isFile() && targetStats.isFile()) {
|
||||
// The source and target paths both exist and are files.
|
||||
if (copyAll) {
|
||||
// The caller specified all files should be copied.
|
||||
log("copy " + sourcePath + " " + targetPath);
|
||||
shell.cp("-f", sourceFullPath, targetFullPath);
|
||||
updated = true;
|
||||
} else {
|
||||
// Copy if the source has been modified since it was copied to the target, or if
|
||||
// the file sizes are different. (The latter catches most cases in which something
|
||||
// was done to the file after copying.) Comparison is >= rather than > to allow
|
||||
// for timestamps lacking sub-second precision in some filesystems.
|
||||
if (sourceStats.mtime.getTime() >= targetStats.mtime.getTime() ||
|
||||
sourceStats.size !== targetStats.size) {
|
||||
log("copy " + sourcePath + " " + targetPath + " (updated file)");
|
||||
shell.cp("-f", sourceFullPath, targetFullPath);
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (targetStats) {
|
||||
// The target exists but the source is null, so the target should be deleted.
|
||||
if (targetStats.isDirectory()) {
|
||||
log("rmdir " + targetPath + (copyAll ? "" : " (no source)"));
|
||||
shell.rm("-rf", targetFullPath);
|
||||
} else {
|
||||
log("delete " + targetPath + (copyAll ? "" : " (no source)"));
|
||||
shell.rm("-f", targetFullPath);
|
||||
}
|
||||
updated = true;
|
||||
}
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for updatePath and updatePaths functions. Queries stats for source and target
|
||||
* and ensures target directory exists before copying a file.
|
||||
*/
|
||||
function updatePathInternal(sourcePath, targetPath, options, log) {
|
||||
var rootDir = (options && options.rootDir) || "";
|
||||
var targetFullPath = path.join(rootDir, targetPath);
|
||||
var targetStats = fs.existsSync(targetFullPath) ? fs.statSync(targetFullPath) : null;
|
||||
var sourceStats = null;
|
||||
|
||||
if (sourcePath) {
|
||||
// A non-null source path was specified. It should exist.
|
||||
var sourceFullPath = path.join(rootDir, sourcePath);
|
||||
if (!fs.existsSync(sourceFullPath)) {
|
||||
throw new Error("Source path does not exist: " + sourcePath);
|
||||
}
|
||||
|
||||
sourceStats = fs.statSync(sourceFullPath);
|
||||
|
||||
// Create the target's parent directory if it doesn't exist.
|
||||
var parentDir = path.dirname(targetFullPath);
|
||||
if (!fs.existsSync(parentDir)) {
|
||||
shell.mkdir("-p", parentDir);
|
||||
}
|
||||
}
|
||||
|
||||
return updatePathWithStats(sourcePath, sourceStats, targetPath, targetStats, options, log);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a target file or directory with a source file or directory. (Directory updates are
|
||||
* not recursive.)
|
||||
*
|
||||
* @param {?string} sourcePath Source file or directory to be used to update the
|
||||
* destination. If the source is null, then the destination is deleted if it exists.
|
||||
* @param {string} targetPath Required destination file or directory to be updated. If it does
|
||||
* not exist, it will be created.
|
||||
* @param {Object} [options] Optional additional parameters for the update.
|
||||
* @param {string} [options.rootDir] Optional root directory (such as a project) to which target
|
||||
* and source path parameters are relative; may be omitted if the paths are absolute. The
|
||||
* rootDir is always omitted from any logged paths, to make the logs easier to read.
|
||||
* @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
|
||||
* Otherwise, a file is copied if the source's last-modified time is greather than or
|
||||
* equal to the target's last-modified time, or if the file sizes are different.
|
||||
* @param {loggingCallback} [log] Optional logging callback that takes a string message
|
||||
* describing any file operations that are performed.
|
||||
* @return {boolean} true if any changes were made, or false if the force flag is not set
|
||||
* and everything was up to date
|
||||
*/
|
||||
function updatePath(sourcePath, targetPath, options, log) {
|
||||
if (sourcePath !== null && typeof sourcePath !== "string") {
|
||||
throw new Error("A source path (or null) is required.");
|
||||
}
|
||||
|
||||
if (!targetPath || typeof targetPath !== "string") {
|
||||
throw new Error("A target path is required.");
|
||||
}
|
||||
|
||||
log = log || function(message) { };
|
||||
|
||||
return updatePathInternal(sourcePath, targetPath, options, log);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates files and directories based on a mapping from target paths to source paths. Targets
|
||||
* with null sources in the map are deleted.
|
||||
*
|
||||
* @param {Object} pathMap A dictionary mapping from target paths to source paths.
|
||||
* @param {Object} [options] Optional additional parameters for the update.
|
||||
* @param {string} [options.rootDir] Optional root directory (such as a project) to which target
|
||||
* and source path parameters are relative; may be omitted if the paths are absolute. The
|
||||
* rootDir is always omitted from any logged paths, to make the logs easier to read.
|
||||
* @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
|
||||
* Otherwise, a file is copied if the source's last-modified time is greather than or
|
||||
* equal to the target's last-modified time, or if the file sizes are different.
|
||||
* @param {loggingCallback} [log] Optional logging callback that takes a string message
|
||||
* describing any file operations that are performed.
|
||||
* @return {boolean} true if any changes were made, or false if the force flag is not set
|
||||
* and everything was up to date
|
||||
*/
|
||||
function updatePaths(pathMap, options, log) {
|
||||
if (!pathMap || typeof pathMap !== "object" || Array.isArray(pathMap)) {
|
||||
throw new Error("An object mapping from target paths to source paths is required.");
|
||||
}
|
||||
|
||||
log = log || function(message) { };
|
||||
|
||||
var updated = false;
|
||||
|
||||
// Iterate in sorted order to ensure directories are created before files under them.
|
||||
Object.keys(pathMap).sort().forEach(function (targetPath) {
|
||||
var sourcePath = pathMap[targetPath];
|
||||
updated = updatePathInternal(sourcePath, targetPath, options, log) || updated;
|
||||
});
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a target directory with merged files and subdirectories from source directories.
|
||||
*
|
||||
* @param {string|string[]} sourceDirs Required source directory or array of source directories
|
||||
* to be merged into the target. The directories are listed in order of precedence; files in
|
||||
* directories later in the array supersede files in directories earlier in the array
|
||||
* (regardless of timestamps).
|
||||
* @param {string} targetDir Required destination directory to be updated. If it does not exist,
|
||||
* it will be created. If it exists, newer files from source directories will be copied over,
|
||||
* and files missing in the source directories will be deleted.
|
||||
* @param {Object} [options] Optional additional parameters for the update.
|
||||
* @param {string} [options.rootDir] Optional root directory (such as a project) to which target
|
||||
* and source path parameters are relative; may be omitted if the paths are absolute. The
|
||||
* rootDir is always omitted from any logged paths, to make the logs easier to read.
|
||||
* @param {boolean} [options.all] If true, all files are copied regardless of last-modified times.
|
||||
* Otherwise, a file is copied if the source's last-modified time is greather than or
|
||||
* equal to the target's last-modified time, or if the file sizes are different.
|
||||
* @param {string|string[]} [options.include] Optional glob string or array of glob strings that
|
||||
* are tested against both target and source relative paths to determine if they are included
|
||||
* in the merge-and-update. If unspecified, all items are included.
|
||||
* @param {string|string[]} [options.exclude] Optional glob string or array of glob strings that
|
||||
* are tested against both target and source relative paths to determine if they are excluded
|
||||
* from the merge-and-update. Exclusions override inclusions. If unspecified, no items are
|
||||
* excluded.
|
||||
* @param {loggingCallback} [log] Optional logging callback that takes a string message
|
||||
* describing any file operations that are performed.
|
||||
* @return {boolean} true if any changes were made, or false if the force flag is not set
|
||||
* and everything was up to date
|
||||
*/
|
||||
function mergeAndUpdateDir(sourceDirs, targetDir, options, log) {
|
||||
if (sourceDirs && typeof sourceDirs === "string") {
|
||||
sourceDirs = [ sourceDirs ];
|
||||
} else if (!Array.isArray(sourceDirs)) {
|
||||
throw new Error("A source directory path or array of paths is required.");
|
||||
}
|
||||
|
||||
if (!targetDir || typeof targetDir !== "string") {
|
||||
throw new Error("A target directory path is required.");
|
||||
}
|
||||
|
||||
log = log || function(message) { };
|
||||
|
||||
var rootDir = (options && options.rootDir) || "";
|
||||
|
||||
var include = (options && options.include) || [ "**" ];
|
||||
if (typeof include === "string") {
|
||||
include = [ include ];
|
||||
} else if (!Array.isArray(include)) {
|
||||
throw new Error("Include parameter must be a glob string or array of glob strings.");
|
||||
}
|
||||
|
||||
var exclude = (options && options.exclude) || [];
|
||||
if (typeof exclude === "string") {
|
||||
exclude = [ exclude ];
|
||||
} else if (!Array.isArray(exclude)) {
|
||||
throw new Error("Exclude parameter must be a glob string or array of glob strings.");
|
||||
}
|
||||
|
||||
// Scan the files in each of the source directories.
|
||||
var sourceMaps = [];
|
||||
for (var i in sourceDirs) {
|
||||
var sourceFullPath = path.join(rootDir, sourceDirs[i]);
|
||||
if (!fs.existsSync(sourceFullPath)) {
|
||||
throw new Error("Source directory does not exist: " + sourceDirs[i]);
|
||||
}
|
||||
sourceMaps[i] = mapDirectory(rootDir, sourceDirs[i], include, exclude);
|
||||
}
|
||||
|
||||
// Scan the files in the target directory, if it exists.
|
||||
var targetMap = {};
|
||||
var targetFullPath = path.join(rootDir, targetDir);
|
||||
if (fs.existsSync(targetFullPath)) {
|
||||
targetMap = mapDirectory(rootDir, targetDir, include, exclude);
|
||||
}
|
||||
|
||||
var pathMap = mergePathMaps(sourceMaps, targetMap, targetDir);
|
||||
|
||||
var updated = false;
|
||||
|
||||
// Iterate in sorted order to ensure directories are created before files under them.
|
||||
Object.keys(pathMap).sort().forEach(function (subPath) {
|
||||
var entry = pathMap[subPath];
|
||||
updated = updatePathWithStats(
|
||||
entry.sourcePath,
|
||||
entry.sourceStats,
|
||||
entry.targetPath,
|
||||
entry.targetStats,
|
||||
options,
|
||||
log) || updated;
|
||||
});
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dictionary map of all files and directories under a path.
|
||||
*/
|
||||
function mapDirectory(rootDir, subDir, include, exclude) {
|
||||
var dirMap = { "": { subDir: subDir, stats: fs.statSync(path.join(rootDir, subDir)) } };
|
||||
mapSubdirectory(rootDir, subDir, "", include, exclude, dirMap);
|
||||
return dirMap;
|
||||
|
||||
function mapSubdirectory(rootDir, subDir, relativeDir, include, exclude, dirMap) {
|
||||
var itemMapped = false;
|
||||
var items = fs.readdirSync(path.join(rootDir, subDir, relativeDir));
|
||||
for (var i in items) {
|
||||
var relativePath = path.join(relativeDir, items[i]);
|
||||
|
||||
// Skip any files or directories (and everything under) that match an exclude glob.
|
||||
if (matchGlobArray(relativePath, exclude)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Stats obtained here (required at least to know where to recurse in directories)
|
||||
// are saved for later, where the modified times may also be used. This minimizes
|
||||
// the number of file I/O operations performed.
|
||||
var fullPath = path.join(rootDir, subDir, relativePath);
|
||||
var stats = fs.statSync(fullPath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
// Directories are included if either something under them is included or they
|
||||
// match an include glob.
|
||||
if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) ||
|
||||
matchGlobArray(relativePath, include)) {
|
||||
dirMap[relativePath] = { subDir: subDir, stats: stats };
|
||||
itemMapped = true;
|
||||
}
|
||||
} else if (stats.isFile()) {
|
||||
// Files are included only if they match an include glob.
|
||||
if (matchGlobArray(relativePath, include)) {
|
||||
dirMap[relativePath] = { subDir: subDir, stats: stats };
|
||||
itemMapped = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemMapped;
|
||||
}
|
||||
|
||||
function matchGlobArray(path, globs) {
|
||||
for (var i in globs) {
|
||||
if (minimatch(path, globs[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges together multiple source maps and a target map into a single mapping from
|
||||
* relative paths to objects with target and source paths and stats.
|
||||
*/
|
||||
function mergePathMaps(sourceMaps, targetMap, targetDir) {
|
||||
// Merge multiple source maps together, along with target path info.
|
||||
// Entries in later source maps override those in earlier source maps.
|
||||
// Target stats will be filled in below for targets that exist.
|
||||
var pathMap = {};
|
||||
sourceMaps.forEach(function (sourceMap) {
|
||||
for (var sourceSubPath in sourceMap) {
|
||||
var sourceEntry = sourceMap[sourceSubPath];
|
||||
pathMap[sourceSubPath] = {
|
||||
targetPath: path.join(targetDir, sourceSubPath),
|
||||
targetStats: null,
|
||||
sourcePath: path.join(sourceEntry.subDir, sourceSubPath),
|
||||
sourceStats: sourceEntry.stats
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// Fill in target stats for targets that exist, and create entries
|
||||
// for targets that don't have any corresponding sources.
|
||||
for (var subPath in targetMap) {
|
||||
var entry = pathMap[subPath];
|
||||
if (entry) {
|
||||
entry.targetStats = targetMap[subPath].stats;
|
||||
} else {
|
||||
pathMap[subPath] = {
|
||||
targetPath: path.join(targetDir, subPath),
|
||||
targetStats: targetMap[subPath].stats,
|
||||
sourcePath: null,
|
||||
sourceStats: null
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return pathMap;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updatePath: updatePath,
|
||||
updatePaths: updatePaths,
|
||||
mergeAndUpdateDir: mergeAndUpdateDir
|
||||
};
|
||||
|
||||
124
node_modules/cordova-common/src/PlatformJson.js
generated
vendored
124
node_modules/cordova-common/src/PlatformJson.js
generated
vendored
@@ -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;
|
||||
|
||||
|
||||
18
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
18
node_modules/cordova-common/src/PluginInfo/PluginInfo.js
generated
vendored
@@ -43,18 +43,14 @@ function PluginInfo(dirname) {
|
||||
// <preference> tag
|
||||
// Example: <preference name="API_KEY" />
|
||||
// Used to require a variable to be specified via --variable when installing the plugin.
|
||||
// returns { key : default | null}
|
||||
self.getPreferences = getPreferences;
|
||||
function getPreferences(platform) {
|
||||
var arprefs = _getTags(self._et, 'preference', platform, _parsePreference);
|
||||
|
||||
var prefs= {};
|
||||
for(var i in arprefs)
|
||||
{
|
||||
var pref=arprefs[i];
|
||||
prefs[pref.preference]=pref.default;
|
||||
}
|
||||
// returns { key : default | null}
|
||||
return prefs;
|
||||
return _getTags(self._et, 'preference', platform, _parsePreference)
|
||||
.reduce(function (preferences, pref) {
|
||||
preferences[pref.preference] = pref.default;
|
||||
return preferences;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function _parsePreference(prefTag) {
|
||||
@@ -335,7 +331,7 @@ function PluginInfo(dirname) {
|
||||
///// PluginInfo Constructor logic /////
|
||||
self.filepath = path.join(dirname, 'plugin.xml');
|
||||
if (!fs.existsSync(self.filepath)) {
|
||||
throw new CordovaError('Cannot find plugin.xml for plugin \'' + path.basename(dirname) + '\'. Please try adding it again.');
|
||||
throw new CordovaError('Cannot find plugin.xml for plugin "' + path.basename(dirname) + '". Please try adding it again.');
|
||||
}
|
||||
|
||||
self.dir = dirname;
|
||||
|
||||
152
node_modules/cordova-common/src/PluginManager.js
generated
vendored
Normal file
152
node_modules/cordova-common/src/PluginManager.js
generated
vendored
Normal file
@@ -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);
|
||||
};
|
||||
11
node_modules/cordova-common/src/events.js
generated
vendored
11
node_modules/cordova-common/src/events.js
generated
vendored
@@ -40,9 +40,16 @@ module.exports.forwardEventsTo = function (eventEmitter) {
|
||||
}
|
||||
|
||||
if (!(eventEmitter instanceof EventEmitter))
|
||||
throw new Error('Cordova events could be redirected to another EventEmitter instance only');
|
||||
throw new Error('Cordova events can 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;
|
||||
|
||||
32
node_modules/cordova-common/src/util/addProperty.js
generated
vendored
Normal file
32
node_modules/cordova-common/src/util/addProperty.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
module.exports = function addProperty(module, property, modulePath, obj) {
|
||||
|
||||
obj = obj || module.exports;
|
||||
// Add properties as getter to delay load the modules on first invocation
|
||||
Object.defineProperty(obj, property, {
|
||||
configurable: true,
|
||||
get: function () {
|
||||
var delayLoadedModule = module.require(modulePath);
|
||||
obj[property] = delayLoadedModule;
|
||||
return delayLoadedModule;
|
||||
}
|
||||
});
|
||||
};
|
||||
29
node_modules/cordova-common/src/util/xml-helpers.js
generated
vendored
29
node_modules/cordova-common/src/util/xml-helpers.js
generated
vendored
@@ -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;
|
||||
@@ -209,6 +209,9 @@ function mergeXml(src, dest, platform, clobber) {
|
||||
if (src.text && (clobber || !dest.text)) {
|
||||
dest.text = src.text;
|
||||
}
|
||||
//Handle children
|
||||
src.getchildren().forEach(mergeChild);
|
||||
|
||||
//Handle platform
|
||||
if (platform) {
|
||||
src.findall('platform[@name="' + platform + '"]').forEach(function (platformElement) {
|
||||
@@ -216,8 +219,8 @@ function mergeXml(src, dest, platform, clobber) {
|
||||
});
|
||||
}
|
||||
|
||||
//Handle children
|
||||
src.getchildren().forEach(mergeChild);
|
||||
//Handle duplicate preference tags (by name attribute)
|
||||
removeDuplicatePreferences(dest);
|
||||
|
||||
function mergeChild (srcChild) {
|
||||
var srcTag = srcChild.tag,
|
||||
@@ -254,6 +257,26 @@ function mergeXml(src, dest, platform, clobber) {
|
||||
dest.append(destChild);
|
||||
}
|
||||
}
|
||||
|
||||
function removeDuplicatePreferences(xml) {
|
||||
// reduce preference tags to a hashtable to remove dupes
|
||||
var prefHash = xml.findall('preference[@name][@value]').reduce(function(previousValue, currentValue) {
|
||||
previousValue[ currentValue.attrib.name ] = currentValue.attrib.value;
|
||||
return previousValue;
|
||||
}, {});
|
||||
|
||||
// remove all preferences
|
||||
xml.findall('preference[@name][@value]').forEach(function(pref) {
|
||||
xml.remove(pref);
|
||||
});
|
||||
|
||||
// write new preferences
|
||||
Object.keys(prefHash).forEach(function(key, index) {
|
||||
var element = et.SubElement(xml, 'preference');
|
||||
element.set('name', key);
|
||||
element.set('value', this[key]);
|
||||
}, prefHash);
|
||||
}
|
||||
}
|
||||
|
||||
// Expose for testing.
|
||||
|
||||
27
node_modules/cordova-registry-mapper/package.json
generated
vendored
27
node_modules/cordova-registry-mapper/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"cordova-registry-mapper@^1.1.8",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common"
|
||||
{
|
||||
"raw": "cordova-registry-mapper@^1.1.8",
|
||||
"scope": null,
|
||||
"escapedName": "cordova-registry-mapper",
|
||||
"name": "cordova-registry-mapper",
|
||||
"rawSpec": "^1.1.8",
|
||||
"spec": ">=1.1.8 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\cordova-common"
|
||||
]
|
||||
],
|
||||
"_from": "cordova-registry-mapper@>=1.1.8 <2.0.0",
|
||||
@@ -12,27 +20,28 @@
|
||||
"_location": "/cordova-registry-mapper",
|
||||
"_nodeVersion": "5.4.1",
|
||||
"_npmUser": {
|
||||
"email": "stevengill97@gmail.com",
|
||||
"name": "stevegill"
|
||||
"name": "stevegill",
|
||||
"email": "stevengill97@gmail.com"
|
||||
},
|
||||
"_npmVersion": "3.5.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "cordova-registry-mapper",
|
||||
"raw": "cordova-registry-mapper@^1.1.8",
|
||||
"rawSpec": "^1.1.8",
|
||||
"scope": null,
|
||||
"escapedName": "cordova-registry-mapper",
|
||||
"name": "cordova-registry-mapper",
|
||||
"rawSpec": "^1.1.8",
|
||||
"spec": ">=1.1.8 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz",
|
||||
"_shasum": "e244b9185b8175473bff6079324905115f83dc7c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "cordova-registry-mapper@^1.1.8",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\cordova-common",
|
||||
"author": {
|
||||
"name": "Steve Gill"
|
||||
},
|
||||
@@ -47,7 +56,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",
|
||||
|
||||
33
node_modules/elementtree/package.json
generated
vendored
33
node_modules/elementtree/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"elementtree@^0.1.6",
|
||||
"/Users/steveng/repo/cordova/cordova-android"
|
||||
{
|
||||
"raw": "elementtree@^0.1.6",
|
||||
"scope": null,
|
||||
"escapedName": "elementtree",
|
||||
"name": "elementtree",
|
||||
"rawSpec": "^0.1.6",
|
||||
"spec": ">=0.1.6 <0.2.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android"
|
||||
]
|
||||
],
|
||||
"_from": "elementtree@>=0.1.6 <0.2.0",
|
||||
@@ -11,16 +19,17 @@
|
||||
"_installable": true,
|
||||
"_location": "/elementtree",
|
||||
"_npmUser": {
|
||||
"email": "ryan@trolocsis.com",
|
||||
"name": "rphillips"
|
||||
"name": "rphillips",
|
||||
"email": "ryan@trolocsis.com"
|
||||
},
|
||||
"_npmVersion": "1.3.24",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "elementtree",
|
||||
"raw": "elementtree@^0.1.6",
|
||||
"rawSpec": "^0.1.6",
|
||||
"scope": null,
|
||||
"escapedName": "elementtree",
|
||||
"name": "elementtree",
|
||||
"rawSpec": "^0.1.6",
|
||||
"spec": ">=0.1.6 <0.2.0",
|
||||
"type": "range"
|
||||
},
|
||||
@@ -28,11 +37,11 @@
|
||||
"/",
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
|
||||
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "elementtree@^0.1.6",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
"_where": "d:\\cordova\\cordova-android",
|
||||
"author": {
|
||||
"name": "Rackspace US, Inc."
|
||||
},
|
||||
@@ -61,18 +70,18 @@
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"homepage": "https://github.com/racker/node-elementtree",
|
||||
"keywords": [
|
||||
"elementtree",
|
||||
"parser",
|
||||
"xml",
|
||||
"sax",
|
||||
"parser",
|
||||
"seralization",
|
||||
"xml"
|
||||
"elementtree"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
|
||||
33
node_modules/glob/package.json
generated
vendored
33
node_modules/glob/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"glob@^5.0.13",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common"
|
||||
{
|
||||
"raw": "glob@^5.0.13",
|
||||
"scope": null,
|
||||
"escapedName": "glob",
|
||||
"name": "glob",
|
||||
"rawSpec": "^5.0.13",
|
||||
"spec": ">=5.0.13 <6.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\cordova-common"
|
||||
]
|
||||
],
|
||||
"_from": "glob@>=5.0.13 <6.0.0",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/glob",
|
||||
"_nodeVersion": "4.0.0",
|
||||
"_npmUser": {
|
||||
"email": "isaacs@npmjs.com",
|
||||
"name": "isaacs"
|
||||
"name": "isaacs",
|
||||
"email": "isaacs@npmjs.com"
|
||||
},
|
||||
"_npmVersion": "3.3.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "glob",
|
||||
"raw": "glob@^5.0.13",
|
||||
"rawSpec": "^5.0.13",
|
||||
"scope": null,
|
||||
"escapedName": "glob",
|
||||
"name": "glob",
|
||||
"rawSpec": "^5.0.13",
|
||||
"spec": ">=5.0.13 <6.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cordova-common"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
|
||||
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "glob@^5.0.13",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\cordova-common",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -58,15 +67,15 @@
|
||||
"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": "*"
|
||||
},
|
||||
"files": [
|
||||
"common.js",
|
||||
"glob.js",
|
||||
"sync.js"
|
||||
"sync.js",
|
||||
"common.js"
|
||||
],
|
||||
"gitHead": "3a7e71d453dd80e75b196fd262dd23ed54beeceb",
|
||||
"homepage": "https://github.com/isaacs/node-glob#readme",
|
||||
|
||||
17
node_modules/inflight/.eslintrc
generated
vendored
17
node_modules/inflight/.eslintrc
generated
vendored
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"env" : {
|
||||
"node" : true
|
||||
},
|
||||
"rules" : {
|
||||
"semi": [2, "never"],
|
||||
"strict": 0,
|
||||
"quotes": [1, "single", "avoid-escape"],
|
||||
"no-use-before-define": 0,
|
||||
"curly": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-lonely-if": 1,
|
||||
"no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}],
|
||||
"no-mixed-requires": 0,
|
||||
"space-infix-ops": 0
|
||||
}
|
||||
}
|
||||
64
node_modules/inflight/package.json
generated
vendored
64
node_modules/inflight/package.json
generated
vendored
@@ -1,41 +1,54 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"inflight@^1.0.4",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/glob"
|
||||
{
|
||||
"raw": "inflight@^1.0.4",
|
||||
"scope": null,
|
||||
"escapedName": "inflight",
|
||||
"name": "inflight",
|
||||
"rawSpec": "^1.0.4",
|
||||
"spec": ">=1.0.4 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\glob"
|
||||
]
|
||||
],
|
||||
"_from": "inflight@>=1.0.4 <2.0.0",
|
||||
"_id": "inflight@1.0.4",
|
||||
"_id": "inflight@1.0.5",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/inflight",
|
||||
"_nodeVersion": "0.10.32",
|
||||
"_npmUser": {
|
||||
"email": "ogd@aoaioxxysz.net",
|
||||
"name": "othiym23"
|
||||
"_nodeVersion": "5.10.1",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094"
|
||||
},
|
||||
"_npmVersion": "2.1.3",
|
||||
"_npmUser": {
|
||||
"name": "zkat",
|
||||
"email": "kat@sykosomatic.org"
|
||||
},
|
||||
"_npmVersion": "3.9.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "inflight",
|
||||
"raw": "inflight@^1.0.4",
|
||||
"rawSpec": "^1.0.4",
|
||||
"scope": null,
|
||||
"escapedName": "inflight",
|
||||
"name": "inflight",
|
||||
"rawSpec": "^1.0.4",
|
||||
"spec": ">=1.0.4 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/glob"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz",
|
||||
"_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
|
||||
"_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz",
|
||||
"_shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "inflight@^1.0.4",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\glob",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -47,18 +60,25 @@
|
||||
},
|
||||
"description": "Add callbacks to requests in flight to avoid async duplication",
|
||||
"devDependencies": {
|
||||
"tap": "^0.4.10"
|
||||
"tap": "^1.2.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a",
|
||||
"tarball": "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"
|
||||
"shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a",
|
||||
"tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz"
|
||||
},
|
||||
"gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba",
|
||||
"files": [
|
||||
"inflight.js"
|
||||
],
|
||||
"gitHead": "559e37b4f6327fca797fe8d7fe8ed6d9cae08821",
|
||||
"homepage": "https://github.com/isaacs/inflight",
|
||||
"license": "ISC",
|
||||
"main": "inflight.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "iarna",
|
||||
"email": "me@re-becca.org"
|
||||
},
|
||||
{
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
@@ -68,8 +88,8 @@
|
||||
"email": "ogd@aoaioxxysz.net"
|
||||
},
|
||||
{
|
||||
"name": "iarna",
|
||||
"email": "me@re-becca.org"
|
||||
"name": "zkat",
|
||||
"email": "kat@sykosomatic.org"
|
||||
}
|
||||
],
|
||||
"name": "inflight",
|
||||
@@ -77,10 +97,10 @@
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/inflight.git"
|
||||
"url": "git+https://github.com/npm/inflight.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
"version": "1.0.5"
|
||||
}
|
||||
|
||||
97
node_modules/inflight/test.js
generated
vendored
97
node_modules/inflight/test.js
generated
vendored
@@ -1,97 +0,0 @@
|
||||
var test = require('tap').test
|
||||
var inf = require('./inflight.js')
|
||||
|
||||
|
||||
function req (key, cb) {
|
||||
cb = inf(key, cb)
|
||||
if (cb) setTimeout(function () {
|
||||
cb(key)
|
||||
cb(key)
|
||||
})
|
||||
return cb
|
||||
}
|
||||
|
||||
test('basic', function (t) {
|
||||
var calleda = false
|
||||
var a = req('key', function (k) {
|
||||
t.notOk(calleda)
|
||||
calleda = true
|
||||
t.equal(k, 'key')
|
||||
if (calledb) t.end()
|
||||
})
|
||||
t.ok(a, 'first returned cb function')
|
||||
|
||||
var calledb = false
|
||||
var b = req('key', function (k) {
|
||||
t.notOk(calledb)
|
||||
calledb = true
|
||||
t.equal(k, 'key')
|
||||
if (calleda) t.end()
|
||||
})
|
||||
|
||||
t.notOk(b, 'second should get falsey inflight response')
|
||||
})
|
||||
|
||||
test('timing', function (t) {
|
||||
var expect = [
|
||||
'method one',
|
||||
'start one',
|
||||
'end one',
|
||||
'two',
|
||||
'tick',
|
||||
'three'
|
||||
]
|
||||
var i = 0
|
||||
|
||||
function log (m) {
|
||||
t.equal(m, expect[i], m + ' === ' + expect[i])
|
||||
++i
|
||||
if (i === expect.length)
|
||||
t.end()
|
||||
}
|
||||
|
||||
function method (name, cb) {
|
||||
log('method ' + name)
|
||||
process.nextTick(cb)
|
||||
}
|
||||
|
||||
var one = inf('foo', function () {
|
||||
log('start one')
|
||||
var three = inf('foo', function () {
|
||||
log('three')
|
||||
})
|
||||
if (three) method('three', three)
|
||||
log('end one')
|
||||
})
|
||||
|
||||
method('one', one)
|
||||
|
||||
var two = inf('foo', function () {
|
||||
log('two')
|
||||
})
|
||||
if (two) method('one', two)
|
||||
|
||||
process.nextTick(log.bind(null, 'tick'))
|
||||
})
|
||||
|
||||
test('parameters', function (t) {
|
||||
t.plan(8)
|
||||
|
||||
var a = inf('key', function (first, second, third) {
|
||||
t.equal(first, 1)
|
||||
t.equal(second, 2)
|
||||
t.equal(third, 3)
|
||||
})
|
||||
t.ok(a, 'first returned cb function')
|
||||
|
||||
var b = inf('key', function (first, second, third) {
|
||||
t.equal(first, 1)
|
||||
t.equal(second, 2)
|
||||
t.equal(third, 3)
|
||||
})
|
||||
t.notOk(b, 'second should get falsey inflight response')
|
||||
|
||||
setTimeout(function () {
|
||||
a(1, 2, 3)
|
||||
})
|
||||
})
|
||||
37
node_modules/inherits/package.json
generated
vendored
37
node_modules/inherits/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"inherits@2",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/glob"
|
||||
{
|
||||
"raw": "inherits@2",
|
||||
"scope": null,
|
||||
"escapedName": "inherits",
|
||||
"name": "inherits",
|
||||
"rawSpec": "2",
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\glob"
|
||||
]
|
||||
],
|
||||
"_from": "inherits@>=2.0.0 <3.0.0",
|
||||
@@ -11,27 +19,28 @@
|
||||
"_installable": true,
|
||||
"_location": "/inherits",
|
||||
"_npmUser": {
|
||||
"email": "i@izs.me",
|
||||
"name": "isaacs"
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"_npmVersion": "1.3.8",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "inherits",
|
||||
"raw": "inherits@2",
|
||||
"rawSpec": "2",
|
||||
"scope": null,
|
||||
"escapedName": "inherits",
|
||||
"name": "inherits",
|
||||
"rawSpec": "2",
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/glob"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
|
||||
"_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "inherits@2",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\glob",
|
||||
"browser": "./inherits_browser.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/inherits/issues"
|
||||
@@ -42,18 +51,18 @@
|
||||
"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": [
|
||||
"browser",
|
||||
"browserify",
|
||||
"class",
|
||||
"inheritance",
|
||||
"inherits",
|
||||
"class",
|
||||
"klass",
|
||||
"oop",
|
||||
"object-oriented",
|
||||
"oop"
|
||||
"inherits",
|
||||
"browser",
|
||||
"browserify"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "./inherits.js",
|
||||
|
||||
29
node_modules/lodash/package.json
generated
vendored
29
node_modules/lodash/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"lodash@^3.5.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/xmlbuilder"
|
||||
{
|
||||
"raw": "lodash@^3.5.0",
|
||||
"scope": null,
|
||||
"escapedName": "lodash",
|
||||
"name": "lodash",
|
||||
"rawSpec": "^3.5.0",
|
||||
"spec": ">=3.5.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\xmlbuilder"
|
||||
]
|
||||
],
|
||||
"_from": "lodash@>=3.5.0 <4.0.0",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/lodash",
|
||||
"_nodeVersion": "0.12.5",
|
||||
"_npmUser": {
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"name": "jdalton"
|
||||
"name": "jdalton",
|
||||
"email": "john.david.dalton@gmail.com"
|
||||
},
|
||||
"_npmVersion": "2.13.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "lodash",
|
||||
"raw": "lodash@^3.5.0",
|
||||
"rawSpec": "^3.5.0",
|
||||
"scope": null,
|
||||
"escapedName": "lodash",
|
||||
"name": "lodash",
|
||||
"rawSpec": "^3.5.0",
|
||||
"spec": ">=3.5.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/xmlbuilder"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
|
||||
"_shasum": "5bf45e8e49ba4189e17d482789dfd15bd140b7b6",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "lodash@^3.5.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/xmlbuilder",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\xmlbuilder",
|
||||
"author": {
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"name": "John-David Dalton",
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"url": "http://allyoucanleet.com/"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -74,7 +83,7 @@
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "5bf45e8e49ba4189e17d482789dfd15bd140b7b6",
|
||||
"tarball": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
|
||||
"tarball": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"
|
||||
},
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
|
||||
11
node_modules/minimatch/README.md
generated
vendored
11
node_modules/minimatch/README.md
generated
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
[](http://travis-ci.org/isaacs/minimatch)
|
||||
[](http://travis-ci.org/isaacs/minimatch)
|
||||
|
||||
|
||||
This is the matching library used internally by npm.
|
||||
@@ -37,7 +37,7 @@ See:
|
||||
|
||||
## Minimatch Class
|
||||
|
||||
Create a minimatch object by instanting the `minimatch.Minimatch` class.
|
||||
Create a minimatch object by instantiating the `minimatch.Minimatch` class.
|
||||
|
||||
```javascript
|
||||
var Minimatch = require("minimatch").Minimatch
|
||||
@@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options)
|
||||
|
||||
All other methods are internal, and will be called as necessary.
|
||||
|
||||
## Functions
|
||||
|
||||
The top-level exported function has a `cache` property, which is an LRU
|
||||
cache set to store 100 items. So, calling these methods repeatedly
|
||||
with the same pattern and options will use the same Minimatch object,
|
||||
saving the cost of parsing it multiple times.
|
||||
|
||||
### minimatch(path, pattern, options)
|
||||
|
||||
Main export. Tests a path against the pattern using the options.
|
||||
|
||||
18
node_modules/minimatch/minimatch.js
generated
vendored
18
node_modules/minimatch/minimatch.js
generated
vendored
@@ -235,7 +235,7 @@ function braceExpand (pattern, options) {
|
||||
? this.pattern : pattern
|
||||
|
||||
if (typeof pattern === 'undefined') {
|
||||
throw new Error('undefined pattern')
|
||||
throw new TypeError('undefined pattern')
|
||||
}
|
||||
|
||||
if (options.nobrace ||
|
||||
@@ -261,6 +261,10 @@ function braceExpand (pattern, options) {
|
||||
Minimatch.prototype.parse = parse
|
||||
var SUBPARSE = {}
|
||||
function parse (pattern, isSub) {
|
||||
if (pattern.length > 1024 * 64) {
|
||||
throw new TypeError('pattern is too long')
|
||||
}
|
||||
|
||||
var options = this.options
|
||||
|
||||
// shortcuts
|
||||
@@ -518,7 +522,7 @@ function parse (pattern, isSub) {
|
||||
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
||||
var tail = re.slice(pl.reStart + 3)
|
||||
// maybe some even number of \, then maybe 1 \, followed by a |
|
||||
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
|
||||
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
|
||||
if (!$2) {
|
||||
// the | isn't already escaped, so escape it.
|
||||
$2 = '\\'
|
||||
@@ -615,7 +619,15 @@ function parse (pattern, isSub) {
|
||||
}
|
||||
|
||||
var flags = options.nocase ? 'i' : ''
|
||||
var regExp = new RegExp('^' + re + '$', flags)
|
||||
try {
|
||||
var regExp = new RegExp('^' + re + '$', flags)
|
||||
} catch (er) {
|
||||
// If it was an invalid regular expression, then it can't match
|
||||
// anything. This trick looks for a character after the end of
|
||||
// the string, which is of course impossible, except in multi-line
|
||||
// mode, but it's not a /m regex.
|
||||
return new RegExp('$.')
|
||||
}
|
||||
|
||||
regExp._glob = pattern
|
||||
regExp._src = re
|
||||
|
||||
60
node_modules/minimatch/package.json
generated
vendored
60
node_modules/minimatch/package.json
generated
vendored
@@ -1,41 +1,55 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"minimatch@2 || 3",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/glob"
|
||||
{
|
||||
"raw": "minimatch@^3.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "minimatch",
|
||||
"name": "minimatch",
|
||||
"rawSpec": "^3.0.0",
|
||||
"spec": ">=3.0.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\cordova-common"
|
||||
]
|
||||
],
|
||||
"_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0",
|
||||
"_id": "minimatch@3.0.0",
|
||||
"_from": "minimatch@>=3.0.0 <4.0.0",
|
||||
"_id": "minimatch@3.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/minimatch",
|
||||
"_nodeVersion": "4.0.0",
|
||||
"_npmUser": {
|
||||
"email": "isaacs@npmjs.com",
|
||||
"name": "isaacs"
|
||||
"_nodeVersion": "4.4.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-16-east.internal.npmjs.com",
|
||||
"tmp": "tmp/minimatch-3.0.2.tgz_1466194379770_0.11417287751100957"
|
||||
},
|
||||
"_npmVersion": "3.3.2",
|
||||
"_npmUser": {
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"_npmVersion": "3.9.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "minimatch",
|
||||
"raw": "minimatch@2 || 3",
|
||||
"rawSpec": "2 || 3",
|
||||
"raw": "minimatch@^3.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0",
|
||||
"escapedName": "minimatch",
|
||||
"name": "minimatch",
|
||||
"rawSpec": "^3.0.0",
|
||||
"spec": ">=3.0.0 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cordova-common",
|
||||
"/glob"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz",
|
||||
"_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83",
|
||||
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz",
|
||||
"_shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "minimatch@2 || 3",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob",
|
||||
"_spec": "minimatch@^3.0.0",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\cordova-common",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -47,12 +61,12 @@
|
||||
"description": "a glob matcher in javascript",
|
||||
"devDependencies": {
|
||||
"standard": "^3.7.2",
|
||||
"tap": "^1.2.0"
|
||||
"tap": "^5.6.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83",
|
||||
"tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz"
|
||||
"shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a",
|
||||
"tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
@@ -60,7 +74,7 @@
|
||||
"files": [
|
||||
"minimatch.js"
|
||||
],
|
||||
"gitHead": "270dbea567f0af6918cb18103e98c612aa717a20",
|
||||
"gitHead": "81edb7c763abd31ba981c87ec5e835f178786be0",
|
||||
"homepage": "https://github.com/isaacs/minimatch#readme",
|
||||
"license": "ISC",
|
||||
"main": "minimatch.js",
|
||||
@@ -81,5 +95,5 @@
|
||||
"posttest": "standard minimatch.js test/*.js",
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
"version": "3.0.2"
|
||||
}
|
||||
|
||||
29
node_modules/nopt/package.json
generated
vendored
29
node_modules/nopt/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"nopt@^3.0.1",
|
||||
"/Users/steveng/repo/cordova/cordova-android"
|
||||
{
|
||||
"raw": "nopt@^3.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "nopt",
|
||||
"name": "nopt",
|
||||
"rawSpec": "^3.0.1",
|
||||
"spec": ">=3.0.1 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android"
|
||||
]
|
||||
],
|
||||
"_from": "nopt@>=3.0.1 <4.0.0",
|
||||
@@ -12,30 +20,31 @@
|
||||
"_location": "/nopt",
|
||||
"_nodeVersion": "4.2.1",
|
||||
"_npmUser": {
|
||||
"email": "ogd@aoaioxxysz.net",
|
||||
"name": "othiym23"
|
||||
"name": "othiym23",
|
||||
"email": "ogd@aoaioxxysz.net"
|
||||
},
|
||||
"_npmVersion": "2.14.10",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "nopt",
|
||||
"raw": "nopt@^3.0.1",
|
||||
"rawSpec": "^3.0.1",
|
||||
"scope": null,
|
||||
"escapedName": "nopt",
|
||||
"name": "nopt",
|
||||
"rawSpec": "^3.0.1",
|
||||
"spec": ">=3.0.1 <4.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
|
||||
"_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "nopt@^3.0.1",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android",
|
||||
"_where": "d:\\cordova\\cordova-android",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bin": {
|
||||
@@ -54,7 +63,7 @@
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9",
|
||||
"tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz"
|
||||
"tarball": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz"
|
||||
},
|
||||
"gitHead": "10a750c9bb99c1950160353459e733ac2aa18cb6",
|
||||
"homepage": "https://github.com/npm/nopt#readme",
|
||||
|
||||
31
node_modules/once/package.json
generated
vendored
31
node_modules/once/package.json
generated
vendored
@@ -1,8 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"once@^1.3.0",
|
||||
"/Users/steveng/repo/cordova/cordova-android/node_modules/glob"
|
||||
{
|
||||
"raw": "once@^1.3.0",
|
||||
"scope": null,
|
||||
"escapedName": "once",
|
||||
"name": "once",
|
||||
"rawSpec": "^1.3.0",
|
||||
"spec": ">=1.3.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"d:\\cordova\\cordova-android\\node_modules\\glob"
|
||||
]
|
||||
],
|
||||
"_from": "once@>=1.3.0 <2.0.0",
|
||||
@@ -12,16 +20,17 @@
|
||||
"_location": "/once",
|
||||
"_nodeVersion": "4.0.0",
|
||||
"_npmUser": {
|
||||
"email": "i@izs.me",
|
||||
"name": "isaacs"
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"_npmVersion": "3.3.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "once",
|
||||
"raw": "once@^1.3.0",
|
||||
"rawSpec": "^1.3.0",
|
||||
"scope": null,
|
||||
"escapedName": "once",
|
||||
"name": "once",
|
||||
"rawSpec": "^1.3.0",
|
||||
"spec": ">=1.3.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
@@ -29,14 +38,14 @@
|
||||
"/glob",
|
||||
"/inflight"
|
||||
],
|
||||
"_resolved": "http://registry.npmjs.org/once/-/once-1.3.3.tgz",
|
||||
"_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz",
|
||||
"_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "once@^1.3.0",
|
||||
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob",
|
||||
"_where": "d:\\cordova\\cordova-android\\node_modules\\glob",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
@@ -54,7 +63,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"
|
||||
@@ -62,8 +71,8 @@
|
||||
"gitHead": "2ad558657e17fafd24803217ba854762842e4178",
|
||||
"homepage": "https://github.com/isaacs/once#readme",
|
||||
"keywords": [
|
||||
"function",
|
||||
"once",
|
||||
"function",
|
||||
"one",
|
||||
"single"
|
||||
],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user