Compare commits

..

5 Commits

190 changed files with 3275 additions and 6575 deletions

5
.gitignore vendored
View File

@@ -42,7 +42,7 @@ Desktop.ini
npm-debug.log
node_modules/jshint
node_modules/promise-matchers
node_modules/jasmine
node_modules/jasmine-node
node_modules/rewire
node_modules/istanbul
node_modules/.bin/cake
@@ -53,7 +53,7 @@ node_modules/.bin/esparse
node_modules/.bin/esvalidate
node_modules/.bin/handlebars
node_modules/.bin/istanbul
node_modules/.bin/jasmine
node_modules/.bin/jasmine-node
node_modules/.bin/js-yaml
node_modules/.bin/jshint
node_modules/.bin/mkdirp
@@ -128,6 +128,5 @@ node_modules/which/
node_modules/window-size/
node_modules/wordwrap/
node_modules/yargs/
node_modules/jasmine-core/
node_modules/fs.realpath/
/coverage

View File

@@ -5,4 +5,3 @@ proguard-project.txt
spec
appveyor.yml
framework/build
ic_launcher.png

View File

@@ -5,7 +5,6 @@ jdk:
before_install:
- nvm install 6
- node --version
- gradle --version
install:
- npm install
- npm install -g codecov

View File

@@ -20,28 +20,6 @@
-->
## Release Notes for Cordova (Android) ##
### 6.2.1 (Apr 02, 2017)
* [CB-12621](https://issues.apache.org/jira/browse/CB-12621) reverted elementtree dep to 0.1.6
### 6.2.0 (Mar 28, 2017)
* [CB-12614](https://issues.apache.org/jira/browse/CB-12614) Adding headers to tests
* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Prepare copy `resource-files` from `config.xml`
* [CB-12605](https://issues.apache.org/jira/browse/CB-12605) Fix a requirements check failure on **Windows**
* [CB-12595](https://issues.apache.org/jira/browse/CB-12595) This should find an **Android Studio** installation and use the sweet gradle center found inside
* [CB-12546](https://issues.apache.org/jira/browse/CB-12546) leverage `avdmanager` if `android` warns it is no longer useful, which happens in **Android SDK Tools 25.3.1**. Explicitly set the `CWD` of the spawned emulator process to workaround a recent google android sdk bug. Rename `android_sdk_version.js` to `android_sdk.js`, to better reflect its contents. Have `create.js` copy over the `android_sdk_version` batch file.
* [CB-12524](https://issues.apache.org/jira/browse/CB-12524) Fix for missing gradle template error. This now fetches the template from inside of the **Android Studio** directory, and falls back to a locally installed Gradle instance
* [CB-12465](https://issues.apache.org/jira/browse/CB-12465) Writing new JUnit Test Instrumentation to replace tests and retire problmatic tests
### 6.1.2 (Jan 26, 2017)
* **Security** Change to `https` by default
* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated tests to work with jasmine (promise matcher tests commented out for now)
* created directories and corresponding images for `xxhdpi` and `xxxhdpi`, both drawables and `mipmaps`
### 6.1.1 (Jan 03, 2017)
* [CB-12159](https://issues.apache.org/jira/browse/CB-12159) **Android** Keystore password prompt won't show up
* [CB-12169](https://issues.apache.org/jira/browse/CB-12169) Check for build directory before running a clean
* Fixed `AndroidStudio` tests to actually run, removed `app/src/main/assets/` as a requirement and added `app/src/main/res` instead, added placeholder for `build/` folder, Removed dupe `gitignore`
### 6.1.0 (Nov 02, 2016)
* [CB-12108](https://issues.apache.org/jira/browse/CB-12108) Updating gradle files to work with the latest version of Android Studio
* [CB-12102](https://issues.apache.org/jira/browse/CB-12102) Bump travis to build to API 25

View File

@@ -1 +1 @@
6.2.2
6.1.0

View File

@@ -19,10 +19,10 @@
under the License.
*/
var android_sdk = require('./templates/cordova/lib/android_sdk');
var android_sdk_version = require('./lib/android_sdk_version');
android_sdk.print_newest_available_sdk_target().done(null, function(err) {
console.error(err);
android_sdk_version.run().done(null, function(err) {
console.log(err);
process.exit(2);
});

View File

@@ -19,7 +19,7 @@
under the License.
*/
var check_reqs = require('./templates/cordova/lib/check_reqs');
var check_reqs = require('./lib/check_reqs');
check_reqs.run().done(
function success() {

64
bin/lib/android_sdk_version.js Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/env node
/*
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 child_process = require('child_process'),
Q = require('q');
var get_highest_sdk = function(results){
var reg = /\d+/;
var apiLevels = [];
for(var i=0;i<results.length;i++){
apiLevels[i] = parseInt(results[i].match(reg)[0]);
}
apiLevels.sort(function(a,b){return b-a;});
console.log(apiLevels[0]);
};
var get_sdks = function() {
var d = Q.defer();
child_process.exec('android list targets', function(err, stdout, stderr) {
if (err) d.reject(stderr);
else d.resolve(stdout);
});
return d.promise.then(function(output) {
var reg = /android-\d+/gi;
var results = output.match(reg);
if(results.length===0){
return Q.reject(new Error('No android sdks installed.'));
}else{
get_highest_sdk(results);
}
return Q();
}, function(stderr) {
if (stderr.match(/command\snot\sfound/) || stderr.match(/'android' is not recognized/)) {
return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.'));
} else {
return Q.reject(new Error('An error occurred while listing Android targets'));
}
});
};
module.exports.run = function() {
return Q.all([get_sdks()]);
};

View File

@@ -26,12 +26,10 @@ var shelljs = require('shelljs'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
os = require('os'),
REPO_ROOT = path.join(__dirname, '..', '..', '..', '..'),
PROJECT_ROOT = path.join(__dirname, '..', '..');
ROOT = path.join(__dirname, '..', '..');
var CordovaError = require('cordova-common').CordovaError;
var superspawn = require('cordova-common').superspawn;
var android_sdk = require('./android_sdk');
var isWindows = process.platform == 'win32';
function forgivingWhichSync(cmd) {
try {
@@ -52,16 +50,7 @@ function tryCommand(cmd, errMsg, catchStderr) {
return d.promise;
}
module.exports.isWindows = function() {
return (os.platform() == 'win32');
};
module.exports.isDarwin = function() {
return (os.platform() == 'darwin');
};
// Get valid target from framework/project.properties if run from this repo
// Otherwise get target from project.properties file within a generated cordova-android project
// Get valid target from framework/project.properties
module.exports.get_target = function() {
function extractFromFile(filePath) {
var target = shelljs.grep(/\btarget=/, filePath);
@@ -70,83 +59,38 @@ module.exports.get_target = function() {
}
return target.split('=')[1].trim();
}
var repo_file = path.join(REPO_ROOT, 'framework', 'project.properties');
if (fs.existsSync(repo_file)) {
return extractFromFile(repo_file);
if (fs.existsSync(path.join(ROOT, 'framework', 'project.properties'))) {
return extractFromFile(path.join(ROOT, 'framework', 'project.properties'));
}
var project_file = path.join(PROJECT_ROOT, 'project.properties');
if (fs.existsSync(project_file)) {
// if no target found, we're probably in a project and project.properties is in PROJECT_ROOT.
return extractFromFile(project_file);
if (fs.existsSync(path.join(ROOT, 'project.properties'))) {
// if no target found, we're probably in a project and project.properties is in ROOT.
return extractFromFile(path.join(ROOT, 'project.properties'));
}
throw new Error('Could not find android target in either ' + repo_file + ' nor ' + project_file);
throw new Error('Could not find android target. File missing: ' + path.join(ROOT, 'project.properties'));
};
// Returns a promise. Called only by build and clean commands.
module.exports.check_ant = function() {
return superspawn.spawn('ant', ['-version'])
.then(function(output) {
return tryCommand('ant -version', 'Failed to run "ant -version", make sure you have ant installed and added to your PATH.')
.then(function (output) {
// Parse Ant version from command output
return /version ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
}).catch(function(err) {
throw new CordovaError('Failed to run `ant -version`. Make sure you have `ant` on your $PATH.');
});
};
module.exports.get_gradle_wrapper = function() {
var androidStudioPath;
var i = 0;
var foundStudio = false;
var program_dir;
if (module.exports.isDarwin()) {
program_dir = fs.readdirSync('/Applications');
while (i < program_dir.length && !foundStudio) {
if (program_dir[i].startsWith('Android Studio')) {
//TODO: Check for a specific Android Studio version, make sure it's not Canary
androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle');
foundStudio = true;
} else { ++i; }
}
} else if (module.exports.isWindows()) {
var androidPath = path.join(process.env['ProgramFiles'], 'Android') + '/';
if (fs.existsSync(androidPath)) {
program_dir = fs.readdirSync(androidPath);
while (i < program_dir.length && !foundStudio) {
if (program_dir[i].startsWith('Android Studio')) {
foundStudio = true;
androidStudioPath = path.join(process.env['ProgramFiles'], 'Android', program_dir[i], 'gradle');
} else { ++i; }
}
}
}
if (androidStudioPath !== null && fs.existsSync(androidStudioPath)) {
var dirs = fs.readdirSync(androidStudioPath);
if(dirs[0].split('-')[0] == 'gradle') {
return path.join(androidStudioPath, dirs[0], 'bin', 'gradle');
}
} else {
//OK, let's try to check for Gradle!
return forgivingWhichSync('gradle');
}
};
// Returns a promise. Called only by build and clean commands.
module.exports.check_gradle = function() {
var sdkDir = process.env['ANDROID_HOME'];
var d = Q.defer();
if (!sdkDir)
return Q.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' +
'Might need to install Android SDK or set up \'ANDROID_HOME\' env variable.'));
var gradlePath = module.exports.get_gradle_wrapper();
if (gradlePath.length !== 0)
d.resolve(gradlePath);
else
d.reject(new CordovaError('Could not find an installed version of Gradle either in Android Studio,\n' +
'or on your system to install the gradle wrapper. Please include gradle \n' +
'in your path, or install Android Studio'));
return d.promise;
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
if (!fs.existsSync(wrapperDir)) {
return Q.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.\n' +
'Looked here: ' + wrapperDir));
}
return Q.when();
};
// Returns a promise.
@@ -161,15 +105,12 @@ module.exports.check_java = function() {
}
} else {
if (javacPath) {
var msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting setting it manually.';
// OS X has a command for finding JAVA_HOME.
var find_java = '/usr/libexec/java_home';
var default_java_error_msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting setting it manually.';
if (fs.existsSync(find_java)) {
return superspawn.spawn(find_java)
if (fs.existsSync('/usr/libexec/java_home')) {
return tryCommand('/usr/libexec/java_home', msg)
.then(function(stdout) {
process.env['JAVA_HOME'] = stdout.trim();
}).catch(function(err) {
throw new CordovaError(default_java_error_msg);
});
} else {
// See if we can derive it from javac's location.
@@ -178,10 +119,10 @@ module.exports.check_java = function() {
if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
process.env['JAVA_HOME'] = maybeJavaHome;
} else {
throw new CordovaError(default_java_error_msg);
throw new CordovaError(msg);
}
}
} else if (module.exports.isWindows()) {
} else if (isWindows) {
// Try to auto-detect java in the default install paths.
var oldSilent = shelljs.config.silent;
shelljs.config.silent = true;
@@ -201,29 +142,28 @@ module.exports.check_java = function() {
}
}
}).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) {
//Let's check for at least Java 8, and keep it future proof so we can support Java 10
var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
return match && match[1];
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) {
//Let's check for at least Java 8, and keep it future proof so we can support Java 10
var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
return match && match[1];
});
});
});
};
// Returns a promise.
module.exports.check_android = function() {
return Q().then(function() {
var androidCmdPath = forgivingWhichSync('android');
var adbInPath = forgivingWhichSync('adb');
var avdmanagerInPath = forgivingWhichSync('avdmanager');
var adbInPath = !!forgivingWhichSync('adb');
var hasAndroidHome = !!process.env['ANDROID_HOME'] && fs.existsSync(process.env['ANDROID_HOME']);
function maybeSetAndroidHome(value) {
if (!hasAndroidHome && fs.existsSync(value)) {
@@ -231,10 +171,8 @@ module.exports.check_android = function() {
process.env['ANDROID_HOME'] = value;
}
}
// First ensure ANDROID_HOME is set
// If we have no hints (nothing in PATH), try a few default locations
if (!hasAndroidHome && !androidCmdPath && !adbInPath && !avdmanagerInPath) {
if (module.exports.isWindows()) {
if (!hasAndroidHome && !androidCmdPath) {
if (isWindows) {
// Android Studio 1.0 installer
maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'sdk'));
maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'sdk'));
@@ -244,7 +182,7 @@ module.exports.check_android = function() {
// Stand-alone installer
maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-sdk'));
maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-sdk'));
} else if (module.exports.isDarwin()) {
} else if (process.platform == 'darwin') {
// Android Studio 1.0 installer
maybeSetAndroidHome(path.join(process.env['HOME'], 'Library', 'Android', 'sdk'));
// Android Studio pre-1.0 installer
@@ -259,43 +197,27 @@ module.exports.check_android = function() {
maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk'));
}
}
if (!hasAndroidHome) {
// If we dont have ANDROID_HOME, but we do have some tools on the PATH, try to infer from the tooling PATH.
var parentDir, grandParentDir;
if (androidCmdPath) {
parentDir = path.dirname(androidCmdPath);
grandParentDir = path.dirname(parentDir);
if (path.basename(parentDir) == 'tools' || fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) {
maybeSetAndroidHome(grandParentDir);
} else {
throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' +
'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' +
'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools directory.');
}
}
if (adbInPath) {
parentDir = path.dirname(adbInPath);
grandParentDir = path.dirname(parentDir);
if (path.basename(parentDir) == 'platform-tools') {
maybeSetAndroidHome(grandParentDir);
} else {
throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' +
'Detected \'adb\' command at ' + parentDir + ' but no \'platform-tools\' directory found near.\n' +
'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'platform-tools directory.');
}
}
if (avdmanagerInPath) {
parentDir = path.dirname(avdmanagerInPath);
grandParentDir = path.dirname(parentDir);
if (path.basename(parentDir) == 'bin' && path.basename(grandParentDir) == 'tools') {
maybeSetAndroidHome(path.dirname(grandParentDir));
} else {
throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' +
'Detected \'avdmanager\' command at ' + parentDir + ' but no \'tools' + path.sep + 'bin\' directory found near.\n' +
'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools' + path.sep + 'bin directory.');
}
if (hasAndroidHome && !androidCmdPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools');
}
if (androidCmdPath && !hasAndroidHome) {
var parentDir = path.dirname(androidCmdPath);
var grandParentDir = path.dirname(parentDir);
if (path.basename(parentDir) == 'tools') {
process.env['ANDROID_HOME'] = path.dirname(parentDir);
hasAndroidHome = true;
} else if (fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) {
process.env['ANDROID_HOME'] = grandParentDir;
hasAndroidHome = true;
} else {
throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' +
'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' +
'Try reinstall Android SDK or update your PATH to include path to valid SDK directory.');
}
}
if (hasAndroidHome && !adbInPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools');
}
if (!process.env['ANDROID_HOME']) {
throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' +
'Failed to find \'android\' command in your \'PATH\'. Try update your \'PATH\' to include path to valid SDK directory.');
@@ -304,27 +226,13 @@ module.exports.check_android = function() {
throw new CordovaError('\'ANDROID_HOME\' environment variable is set to non-existent path: ' + process.env['ANDROID_HOME'] +
'\nTry update it manually to point to valid SDK directory.');
}
// Next let's make sure relevant parts of the SDK tooling is in our PATH
if (hasAndroidHome && !androidCmdPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools');
}
if (hasAndroidHome && !adbInPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools');
}
if (hasAndroidHome && !avdmanagerInPath) {
process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools', 'bin');
}
return hasAndroidHome;
});
};
// TODO: is this actually needed?
module.exports.getAbsoluteAndroidCmd = function () {
var cmd = forgivingWhichSync('android');
if (cmd.length === 0) {
cmd = forgivingWhichSync('sdkmanager');
}
if (module.exports.isWindows()) {
if (process.platform === 'win32') {
return '"' + cmd + '"';
}
return cmd.replace(/(\s)/g, '\\$1');
@@ -336,17 +244,20 @@ module.exports.check_android_target = function(originalError) {
// android-L
// Google Inc.:Google APIs:20
// Google Inc.:Glass Development Kit Preview:20
var desired_api_level = module.exports.get_target();
return android_sdk.list_targets()
.then(function(targets) {
if (targets.indexOf(desired_api_level) >= 0) {
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) {
var targets = output.split('\n');
if (targets.indexOf(valid_target) >= 0) {
return targets;
}
var androidCmd = module.exports.getAbsoluteAndroidCmd();
var msg = 'Please install Android target / API level: "' + desired_api_level + '".\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 API level ' + desired_api_level + '\n' +
'1. "SDK Platform" for ' + valid_target + '\n' +
'2. "Android SDK Platform-tools (latest)\n' +
'3. "Android SDK Build-tools" (latest)';
if (originalError) {
@@ -367,6 +278,7 @@ module.exports.run = function() {
throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
}
if (!values[1]) {
throw new CordovaError('Requirements check failed for Android SDK');
}

View File

@@ -23,7 +23,7 @@ var shell = require('shelljs'),
Q = require('q'),
path = require('path'),
fs = require('fs'),
check_reqs = require('./../templates/cordova/lib/check_reqs'),
check_reqs = require('./check_reqs'),
ROOT = path.join(__dirname, '..', '..');
var MIN_SDK_VERSION = 16;
@@ -134,29 +134,20 @@ function copyBuildRules(projectPath) {
var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
shell.cp('-f', path.join(srcDir, 'build.gradle'), projectPath);
shell.cp('-f', path.join(srcDir, 'wrapper.gradle'), projectPath);
}
function copyScripts(projectPath) {
var bin = path.join(ROOT, 'bin');
var srcScriptsDir = path.join(bin, 'templates', 'cordova');
var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'cordova');
var destScriptsDir = path.join(projectPath, 'cordova');
// Delete old scripts directory if this is an update.
shell.rm('-rf', destScriptsDir);
// Copy in the new ones.
shell.cp('-r', srcScriptsDir, projectPath);
shell.cp('-r', path.join(ROOT, 'node_modules'), destScriptsDir);
shell.cp(path.join(bin, 'check_reqs*'), destScriptsDir);
shell.cp(path.join(bin, 'android_sdk_version*'), destScriptsDir);
var check_reqs = path.join(destScriptsDir, 'check_reqs');
var android_sdk_version = path.join(destScriptsDir, 'android_sdk_version');
// TODO: the two files being edited on-the-fly here are shared between
// platform and project-level commands. the below `sed` is updating the
// `require` path for the two libraries. if there's a better way to share
// modules across both the repo and generated projects, we should make sure
// to remove/update this.
shell.sed('-i', /templates\/cordova\//, '', android_sdk_version);
shell.sed('-i', /templates\/cordova\//, '', check_reqs);
shell.cp(path.join(ROOT, 'bin', 'check_reqs*'), destScriptsDir);
shell.cp(path.join(ROOT, 'bin', 'lib', 'check_reqs.js'), path.join(projectPath, 'cordova', 'lib', 'check_reqs.js'));
shell.cp(path.join(ROOT, 'bin', 'android_sdk_version'), path.join(destScriptsDir, 'android_sdk_version'));
shell.cp(path.join(ROOT, 'bin', 'lib', 'android_sdk_version.js'), path.join(projectPath, 'cordova', 'lib', 'android_sdk_version.js'));
}
/**

View File

@@ -72,7 +72,6 @@ function Api(platform, platformRootDir, events) {
defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
strings: path.join(self.root, 'res/values/strings.xml'),
manifest: path.join(self.root, 'AndroidManifest.xml'),
build: path.join(self.root, 'build'),
// NOTE: Due to platformApi spec we need to return relative paths here
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
cordovaJsSrc: 'cordova-js-src'
@@ -242,12 +241,11 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
// Do some basic argument parsing
var opts = {};
// Skip cleaning prepared files when not invoking via cordova CLI.
// Skip cleaning prepared files when not invoking via cordova CLI.
opts.noPrepare = true;
if(!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
if(!(AndroidStudio.isAndroidStudioProject(self.root)))
return self.clean(opts);
}
})
.then(function () {
return PluginManager.get(self.platform, self.locations, project)
@@ -398,8 +396,6 @@ Api.prototype.clean = function(cleanOptions) {
});
};
/**
* Performs a requirements check for current platform. Each platform defines its
* own set of requirements, which should be resolved before platform can be

View File

@@ -197,14 +197,5 @@ AndroidProject.prototype.getUninstaller = function (type) {
return pluginHandlers.getUninstaller(type);
};
/*
* This checks if an Android project is clean or has old build artifacts
*/
AndroidProject.prototype.isClean = function() {
var build_path = path.join(this.projectDir, 'build');
//If the build directory doesn't exist, it's clean
return !(fs.existsSync(build_path));
};
module.exports = AndroidProject;

View File

@@ -1,135 +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 Q = require('q'),
superspawn = require('cordova-common').superspawn;
var suffix_number_regex = /(\d+)$/;
// Used for sorting Android targets, example strings to sort:
// android-19
// android-L
// Google Inc.:Google APIs:20
// Google Inc.:Glass Development Kit Preview:20
// The idea is to sort based on largest "suffix" number - meaning the bigger
// the number at the end, the more recent the target, the closer to the
// start of the array.
function sort_by_largest_numerical_suffix(a, b) {
var suffix_a = a.match(suffix_number_regex);
var suffix_b = b.match(suffix_number_regex);
if (suffix_a && suffix_b) {
// If the two targets being compared have suffixes, return less than
// zero, or greater than zero, based on which suffix is larger.
return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1);
} else {
// If no suffix numbers were detected, leave the order as-is between
// elements a and b.
return 0;
}
}
module.exports.print_newest_available_sdk_target = function() {
return module.exports.list_targets()
.then(function(targets) {
targets.sort(sort_by_largest_numerical_suffix);
console.log(targets[0]);
});
};
module.exports.version_string_to_api_level = {
'4.0': 14,
'4.0.3': 15,
'4.1': 16,
'4.2': 17,
'4.3': 18,
'4.4': 19,
'4.4W': 20,
'5.0': 21,
'5.1': 22,
'6.0': 23,
'7.0': 24,
'7.1.1': 25
};
module.exports.list_targets_with_android = function() {
return superspawn.spawn('android', ['list', 'targets'])
.then(function(stdout) {
var target_out = stdout.split('\n');
var targets = [];
for (var i = target_out.length - 1; i >= 0; i--) {
if(target_out[i].match(/id:/)) {
targets.push(target_out[i].match(/"(.+)"/)[1]);
}
}
return targets;
});
};
module.exports.list_targets_with_sdkmanager = function() {
return superspawn.spawn('sdkmanager', ['--list'])
.then(function(stdout) {
var parsing_installed_packages = false;
var lines = stdout.split('\n');
var targets = [];
for (var i = 0, l = lines.length; i < l; i++) {
var line = lines[i];
if (line.match(/Installed packages/)) {
parsing_installed_packages = true;
} else if (line.match(/Available Packages/) || line.match(/Available Updates/)) {
// we are done working through installed packages, exit
break;
}
if (parsing_installed_packages) {
// Match stock android platform
if (line.match(/platforms;android-\d+/)) {
targets.push(line.match(/(android-\d+)/)[1]);
}
// Match Google APIs
if (line.match(/addon-google_apis-google-\d+/)) {
var description = lines[i + 1];
// munge description to match output from old android sdk tooling
var api_level = description.match(/Android (\d+)/); //[1];
if (api_level) {
targets.push('Google Inc.:Google APIs:' + api_level[1]);
}
}
// TODO: match anything else?
}
}
return targets;
});
};
module.exports.list_targets = function() {
return module.exports.list_targets_with_android()
.catch(function(err) {
// there's a chance `android` no longer works.
// lets see if `sdkmanager` is available and we can figure it out
var avail_regex = /"?android"? command is no longer available/;
if (err.code && ((err.stdout && err.stdout.match(avail_regex)) || (err.stderr && err.stderr.match(avail_regex)))) {
return module.exports.list_targets_with_sdkmanager();
} else throw err;
}).then(function(targets) {
if (targets.length === 0) {
return Q.reject(new Error('No android targets (SDKs) installed!'));
}
return targets;
});
};

View File

@@ -65,21 +65,6 @@ GradleBuilder.prototype.getArgs = function(cmd, opts) {
return args;
};
/*
* This returns a promise
*/
GradleBuilder.prototype.runGradleWrapper = function(gradle_cmd) {
var gradlePath = path.join(this.root, 'gradlew');
var wrapperGradle = path.join(this.root, 'wrapper.gradle');
if(fs.existsSync(gradlePath)) {
//Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows
} else {
return spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], {stdio: 'inherit'});
}
};
// Makes the project buildable, minus the gradle wrapper.
GradleBuilder.prototype.prepBuildFiles = function() {
// Update the version of build.gradle in each dependent library.
@@ -174,15 +159,17 @@ GradleBuilder.prototype.prepBuildFiles = function() {
GradleBuilder.prototype.prepEnv = function(opts) {
var self = this;
return check_reqs.check_gradle()
.then(function(gradlePath) {
return self.runGradleWrapper(gradlePath);
}).then(function() {
return self.prepBuildFiles();
}).then(function() {
// We now copy the gradle out of the framework
// This is a dirty patch to get the build working
/*
var wrapperDir = path.join(self.root, 'CordovaLib');
.then(function() {
return self.prepBuildFiles();
}).then(function() {
// Copy the gradle wrapper on each build so that:
// A) we don't require the Android SDK at project creation time, and
// B) we always use the SDK's latest version of it.
// check_reqs ensures that this is set.
/*jshint -W069 */
var sdkDir = process.env['ANDROID_HOME'];
/*jshint +W069 */
var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper');
if (process.platform == 'win32') {
shell.rm('-f', path.join(self.root, 'gradlew.bat'));
shell.cp(path.join(wrapperDir, 'gradlew.bat'), self.root);
@@ -193,13 +180,13 @@ GradleBuilder.prototype.prepEnv = function(opts) {
shell.rm('-rf', path.join(self.root, 'gradle', 'wrapper'));
shell.mkdir('-p', path.join(self.root, 'gradle'));
shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(self.root, 'gradle'));
*/
// If the gradle distribution URL is set, make sure it points to version we want.
// If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with.
// 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'] || 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip';
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.14.1-all.zip';
/*jshint +W069 */
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath);

View File

@@ -27,15 +27,11 @@ var path = require('path');
var Adb = require('./Adb');
var AndroidManifest = require('./AndroidManifest');
var events = require('cordova-common').events;
var superspawn = require('cordova-common').superspawn;
var spawn = require('cordova-common').superspawn.spawn;
var CordovaError = require('cordova-common').CordovaError;
var shelljs = require('shelljs');
var android_sdk = require('./android_sdk');
var check_reqs = require('./check_reqs');
var Q = require('q');
var os = require('os');
var fs = require('fs');
var child_process = require('child_process');
// constants
@@ -46,77 +42,18 @@ var NUM_INSTALL_RETRIES = 3;
var CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds
var EXEC_KILL_SIGNAL = 'SIGKILL';
function forgivingWhichSync(cmd) {
try {
return fs.realpathSync(shelljs.which(cmd));
} catch (e) {
return '';
}
}
module.exports.list_images_using_avdmanager = function () {
return superspawn.spawn('avdmanager', ['list', 'avd'])
.then(function(output) {
var response = output.split('\n');
var emulator_list = [];
for (var i = 1; i < response.length; i++) {
// To return more detailed information use img_obj
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(/Target:\s/)) {
i++;
if (response[i + 1].match(/ABI:\s/)) {
img_obj['abi'] = response[i + 1].split('ABI: ')[1].replace('\r', '');
}
// This next conditional just aims to match the old output of `android list avd`
// We do so so that we don't have to change the logic when parsing for the
// best emulator target to spawn (see below in `best_image`)
// This allows us to transitionally support both `android` and `avdmanager` binaries,
// depending on what SDK version the user has
if (response[i + 1].match(/Based\son:\s/)) {
img_obj['target'] = response[i + 1].split('Based on:')[1];
if (img_obj['target'].match(/Tag\/ABI:\s/)) {
img_obj['target'] = img_obj['target'].split('Tag/ABI:')[0].replace('\r', '').trim();
if (img_obj['target'].indexOf('(') > -1) {
img_obj['target'] = img_obj['target'].substr(0, img_obj['target'].indexOf('(') - 1).trim();
}
}
var version_string = img_obj['target'].replace(/Android\s+/, '');
var api_level = android_sdk.version_string_to_api_level[version_string];
if (api_level) {
img_obj['target'] += ' (API level ' + api_level + ')';
}
}
}
if (response[i + 1].match(/Skin:\s/)) {
i++;
img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', '');
}
emulator_list.push(img_obj);
}
/* To just return a list of names use this
if (response[i].match(/Name:\s/)) {
emulator_list.push(response[i].split('Name: ')[1].replace('\r', '');
}*/
}
return emulator_list;
});
};
module.exports.list_images_using_android = function() {
return superspawn.spawn('android', ['list', 'avds'])
/**
* Returns a Promise for a list of emulator images in the form of objects
* {
name : <emulator_name>,
path : <path_to_emulator_image>,
target : <api_target>,
abi : <cpu>,
skin : <skin>
}
*/
module.exports.list_images = function() {
return spawn('android', ['list', 'avds'])
.then(function(output) {
var response = output.split('\n');
var emulator_list = [];
@@ -159,39 +96,6 @@ module.exports.list_images_using_android = function() {
});
};
/**
* Returns a Promise for a list of emulator images in the form of objects
* {
name : <emulator_name>,
device : <device>,
path : <path_to_emulator_image>,
target : <api_target>,
abi : <cpu>,
skin : <skin>
}
*/
module.exports.list_images = function() {
if (forgivingWhichSync('android')) {
return module.exports.list_images_using_android()
.catch(function(err) {
// try to use `avdmanager` in case `android` reports it is no longer available.
// this likely means the target machine is using a newer version of
// the android sdk, and possibly `avdmanager` is available.
if (err.code == 1 && err.stdout.indexOf('android command is no longer available')) {
return module.exports.list_images_using_avdmanager();
} else {
throw err;
}
});
} else if (forgivingWhichSync('avdmanager')) {
return module.exports.list_images_using_avdmanager();
} else {
return Q().then(function() {
throw new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?');
});
}
};
/**
* Will return the closest avd to the projects target
* or undefined if no avds exist.
@@ -205,7 +109,8 @@ module.exports.best_image = function() {
var closest = 9999;
var best = images[0];
var project_target = check_reqs.get_target().replace('android-', '');
// Loading check_reqs at run-time to avoid test-time vs run-time directory structure difference issue
var project_target = require('./check_reqs').get_target().replace('android-', '');
for (var i in images) {
var target = images[i].target;
if(target) {
@@ -229,7 +134,7 @@ module.exports.list_started = function() {
// Returns a promise.
module.exports.list_targets = function() {
return superspawn.spawn('android', ['list', 'targets'], {cwd: os.tmpdir()})
return spawn('android', ['list', 'targets'], {cwd: os.tmpdir()})
.then(function(output) {
var target_out = output.split('\n');
var targets = [];
@@ -284,7 +189,8 @@ module.exports.start = function(emulator_ID, boot_timeout) {
return best.name;
}
var androidCmd = check_reqs.getAbsoluteAndroidCmd();
// Loading check_reqs at run-time to avoid test-time vs run-time directory structure difference issue
var androidCmd = require('./check_reqs').getAbsoluteAndroidCmd();
return Q.reject(new CordovaError('No emulator images (avds) found.\n' +
'1. Download desired System Image by running: ' + androidCmd + ' sdk\n' +
'2. Create an AVD by running: ' + androidCmd + ' avd\n' +
@@ -293,13 +199,10 @@ module.exports.start = function(emulator_ID, boot_timeout) {
}).then(function(emulatorId) {
return self.get_available_port()
.then(function (port) {
// Figure out the directory the emulator binary runs in, and set the cwd to that directory.
// Workaround for https://code.google.com/p/android/issues/detail?id=235461
var emulator_dir = path.dirname(shelljs.which('emulator'));
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, cwd: emulator_dir })
.spawn('emulator', args, { stdio: 'inherit', detached: true })
.unref();
// wait for emulator to start
@@ -391,7 +294,7 @@ module.exports.wait_for_boot = function(emulator_id, time_remaining) {
module.exports.create_image = function(name, target) {
console.log('Creating new avd named ' + name);
if (target) {
return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', target])
return spawn('android', ['create', 'avd', '--name', name, '--target', target])
.then(null, function(error) {
console.error('ERROR : Failed to create emulator image : ');
console.error(' Do you have the latest android targets including ' + target + '?');
@@ -399,7 +302,7 @@ module.exports.create_image = function(name, target) {
});
} else {
console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.');
return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]])
return spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]])
.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.');

View File

@@ -22,7 +22,7 @@
var devices = require('./device');
// Usage support for when args are given
require('./check_reqs').check_android().then(function() {
require('../lib/check_reqs').check_android().then(function() {
devices.list().done(function(device_list) {
device_list && device_list.forEach(function(dev) {
console.log(dev);

View File

@@ -22,7 +22,7 @@
var emulators = require('./emulator');
// Usage support for when args are given
require('./check_reqs').check_android().then(function() {
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);

View File

@@ -22,7 +22,7 @@
var emulators = require('./emulator');
// Usage support for when args are given
require('./check_reqs').check_android().then(function() {
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);

View File

@@ -48,7 +48,6 @@ module.exports.prepare = function (cordovaProject, options) {
.then(function () {
updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res));
updateFileResources(cordovaProject, path.relative(cordovaProject.root, self.locations.root));
})
.then(function () {
events.emit('verbose', 'Prepared android project successfully');
@@ -73,7 +72,6 @@ module.exports.clean = function (options) {
cleanWww(projectRoot, self.locations);
cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res));
cleanFileResources(projectRoot, projectConfig, path.relative(projectRoot, self.locations.root));
});
};
@@ -403,44 +401,6 @@ function mapImageResources(rootDir, subDir, type, resourceName) {
return pathMap;
}
function updateFileResources(cordovaProject, platformDir) {
var files = cordovaProject.projectConfig.getFileResources('android');
// if there are resource-file elements in config.xml
if (files.length === 0) {
events.emit('verbose', 'This app does not have additional resource files defined');
return;
}
var resourceMap = {};
files.forEach(function(res) {
var targetPath = path.join(platformDir, res.target);
resourceMap[targetPath] = res.src;
});
events.emit('verbose', 'Updating resource files at ' + platformDir);
FileUpdater.updatePaths(
resourceMap, { rootDir: cordovaProject.root }, logFileOp);
}
function cleanFileResources(projectRoot, projectConfig, platformDir) {
var files = projectConfig.getFileResources('android');
if (files.length > 0) {
events.emit('verbose', 'Cleaning resource files at ' + platformDir);
var resourceMap = {};
files.forEach(function(res) {
var filePath = path.join(platformDir, res.target);
resourceMap[filePath] = null;
});
FileUpdater.updatePaths(
resourceMap, { rootDir: projectRoot, all: true}, logFileOp);
}
}
/**
* Gets and validates 'AndroidLaunchMode' prepference from config.xml. Returns
* preference value and warns if it doesn't seems to be valid

View File

@@ -20,7 +20,7 @@
*/
// Coho updates this line:
var VERSION = "6.2.2";
var VERSION = "6.1.0";
module.exports.version = VERSION;

View File

@@ -1,5 +1,5 @@
// Platform: android
// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
// a3732cb71d9b1dd590338e8cf44196f366d46da3
/*
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 = '6.2.2';
var PLATFORM_VERSION_BUILD_LABEL = '6.1.0';
// 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: /Users/jbowser/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: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
/**
@@ -886,7 +886,7 @@ module.exports = channel;
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -1649,7 +1649,7 @@ exports.reset();
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
// file: /Users/jbowser/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.
@@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {
});
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
define("cordova/plugin/android/app", function(require, exports, module) {
var exec = require('cordova/exec');

View File

@@ -30,7 +30,7 @@ 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:2.2.3'
classpath 'com.android.tools.build:gradle:2.2.1'
}
}
@@ -264,7 +264,7 @@ def promptForReleaseKeyPassword() {
gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().each() { task ->
if (task.name == 'validateReleaseSigning' || task.name == 'validateSigningRelease') {
if (task.name == 'validateReleaseSigning') {
promptForReleaseKeyPassword()
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1 +0,0 @@
//This file is intentionally just a comment

View File

@@ -16,32 +16,28 @@
under the License.
*/
buildscript {
repositories {
mavenCentral()
jcenter();
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
}
}
apply plugin: 'com.android.library'
ext {
apply from: 'cordova.gradle'
cdvCompileSdkVersion = privateHelpers.getProjectTarget()
cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = 'org.apache.cordova'
version = '6.2.2'
android {
compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion
@@ -63,73 +59,4 @@ android {
assets.srcDirs = ['assets']
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
}
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'Cordova'
url 'https://cordova.apache.org'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'stevengill'
name 'Steve Gill'
}
}
scm {
connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android'
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
pkg {
repo = 'maven'
name = 'cordova-android'
userOrg = 'cordova'
licenses = ['Apache-2.0']
vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git'
websiteUrl = 'https://cordova.apache.org'
issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB'
publicDownloadNumbers = true
licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap']
version {
name = '6.2.2'
released = new Date()
vcsTag = '6.2.2'
}
}
}

View File

@@ -1,6 +0,0 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

View File

@@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback;
* are not expected to implement it.
*/
public interface CordovaWebView {
public static final String CORDOVA_VERSION = "6.2.2";
public static final String CORDOVA_VERSION = "6.1.0";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

View File

@@ -488,34 +488,6 @@ public class NativeToJsMessageQueue {
encodeAsMessageHelper(sb, pluginResult);
}
void buildJsMessage(StringBuilder sb) {
switch (pluginResult.getMessageType()) {
case PluginResult.MESSAGE_TYPE_MULTIPART:
int size = pluginResult.getMultipartMessagesSize();
for (int i=0; i<size; i++) {
PluginResult subresult = pluginResult.getMultipartMessage(i);
JsMessage submessage = new JsMessage(subresult, jsPayloadOrCallbackId);
submessage.buildJsMessage(sb);
if (i < (size-1)) {
sb.append(",");
}
}
break;
case PluginResult.MESSAGE_TYPE_BINARYSTRING:
sb.append("atob('")
.append(pluginResult.getMessage())
.append("')");
break;
case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
sb.append("cordova.require('cordova/base64').toArrayBuffer('")
.append(pluginResult.getMessage())
.append("')");
break;
default:
sb.append(pluginResult.getMessage());
}
}
void encodeAsJsMessage(StringBuilder sb) {
if (pluginResult == null) {
sb.append(jsPayloadOrCallbackId);
@@ -523,16 +495,29 @@ public class NativeToJsMessageQueue {
int status = pluginResult.getStatus();
boolean success = (status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal());
sb.append("cordova.callbackFromNative('")
.append(jsPayloadOrCallbackId)
.append("',")
.append(success)
.append(",")
.append(status)
.append(",[");
buildJsMessage(sb);
.append(jsPayloadOrCallbackId)
.append("',")
.append(success)
.append(",")
.append(status)
.append(",[");
switch (pluginResult.getMessageType()) {
case PluginResult.MESSAGE_TYPE_BINARYSTRING:
sb.append("atob('")
.append(pluginResult.getMessage())
.append("')");
break;
case PluginResult.MESSAGE_TYPE_ARRAYBUFFER:
sb.append("cordova.require('cordova/base64').toArrayBuffer('")
.append(pluginResult.getMessage())
.append("')");
break;
default:
sb.append(pluginResult.getMessage());
}
sb.append("],")
.append(pluginResult.getKeepCallback())
.append(");");
.append(pluginResult.getKeepCallback())
.append(");");
}
}
}

1
node_modules/abbrev/abbrev.js generated vendored
View File

@@ -1,3 +1,4 @@
module.exports = exports = abbrev.abbrev = abbrev
abbrev.monkeyPatch = monkeyPatch

31
node_modules/abbrev/package.json generated vendored
View File

@@ -14,19 +14,20 @@
]
],
"_from": "abbrev@>=1.0.0 <2.0.0",
"_id": "abbrev@1.1.0",
"_id": "abbrev@1.0.9",
"_inCache": true,
"_installable": true,
"_location": "/abbrev",
"_nodeVersion": "8.0.0-pre",
"_nodeVersion": "4.4.4",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195"
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/abbrev-1.0.9.tgz_1466016055839_0.7825860097073019"
},
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
"_npmVersion": "4.3.0",
"_npmVersion": "3.9.1",
"_phantomChildren": {},
"_requested": {
"raw": "abbrev@1",
@@ -38,10 +39,11 @@
"type": "range"
},
"_requiredBy": [
"/istanbul",
"/nopt"
],
"_resolved": "http://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz",
"_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
"_resolved": "http://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",
@@ -55,17 +57,17 @@
"dependencies": {},
"description": "Like ruby's abbrev module, but in js",
"devDependencies": {
"tap": "^10.1"
"tap": "^5.7.2"
},
"directories": {},
"dist": {
"shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f",
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz"
"shasum": "91b4792588a7738c25f35dd6f63752a2f8776135",
"tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz"
},
"files": [
"abbrev.js"
],
"gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0",
"gitHead": "c386cd9dbb1d8d7581718c54d4ba944cc9298d6f",
"homepage": "https://github.com/isaacs/abbrev-js#readme",
"license": "ISC",
"main": "abbrev.js",
@@ -83,10 +85,7 @@
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
},
"scripts": {
"postpublish": "git push origin --all; git push origin --tags",
"postversion": "npm publish",
"preversion": "npm test",
"test": "tap test.js --100"
"test": "tap test.js --cov"
},
"version": "1.1.0"
"version": "1.0.9"
}

1
node_modules/ansi/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "ansi@>=0.3.1 <0.4.0",
"_id": "ansi@0.3.1",
"_inCache": true,
"_installable": true,
"_location": "/ansi",
"_nodeVersion": "5.3.0",
"_npmUser": {

View File

@@ -16,6 +16,7 @@
"_from": "balanced-match@>=0.4.1 <0.5.0",
"_id": "balanced-match@0.4.2",
"_inCache": true,
"_installable": true,
"_location": "/balanced-match",
"_nodeVersion": "4.4.7",
"_npmOperationalInternal": {

View File

@@ -16,6 +16,7 @@
"_from": "base64-js@0.0.8",
"_id": "base64-js@0.0.8",
"_inCache": true,
"_installable": true,
"_location": "/base64-js",
"_nodeVersion": "0.10.35",
"_npmUser": {

17
node_modules/big-integer/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/.travis.yml
/.npmignore
/.gitignore
/spec
/benchmark
/big-integer*.tgz
/my.conf.js
/node_modules
/*.csproj*
/*.sh
/*.suo
/bin
/coverage
/*.bat
/obj
/Properties
/Web.*

View File

@@ -467,7 +467,6 @@ var bigInt = (function (undefined) {
guess, xlen, highx, highy, check;
while (a_l) {
part.unshift(a[--a_l]);
trim(part);
if (compareAbs(part, b) < 0) {
result.push(0);
continue;
@@ -834,13 +833,9 @@ var bigInt = (function (undefined) {
newT = lastT.subtract(q.multiply(newT));
newR = lastR.subtract(q.multiply(newR));
}
if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
if (t.compare(0) === -1) {
t = t.add(n);
}
if (this.isNegative()) {
return t.negate();
}
return t;
}
SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
@@ -981,7 +976,7 @@ var bigInt = (function (undefined) {
b = parseValue(b);
return a.greater(b) ? a : b;
}
function min(a, b) {
function min(a,b) {
a = parseValue(a);
b = parseValue(b);
return a.lesser(b) ? a : b;

File diff suppressed because one or more lines are too long

24
node_modules/big-integer/LICENSE generated vendored
View File

@@ -1,24 +0,0 @@
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>

View File

@@ -14,19 +14,20 @@
]
],
"_from": "big-integer@>=1.6.7 <2.0.0",
"_id": "big-integer@1.6.19",
"_id": "big-integer@1.6.16",
"_inCache": true,
"_installable": true,
"_location": "/big-integer",
"_nodeVersion": "6.9.4",
"_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/big-integer-1.6.19.tgz_1491096256363_0.04815615131519735"
"host": "packages-16-east.internal.npmjs.com",
"tmp": "tmp/big-integer-1.6.16.tgz_1473665148825_0.5824211346916854"
},
"_npmUser": {
"name": "peterolson",
"email": "peter.e.c.olson+npm@gmail.com"
},
"_npmVersion": "3.10.10",
"_npmVersion": "2.15.5",
"_phantomChildren": {},
"_requested": {
"raw": "big-integer@^1.6.7",
@@ -40,8 +41,8 @@
"_requiredBy": [
"/bplist-parser"
],
"_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.19.tgz",
"_shasum": "4a5e915e3188c8708f254b356196f28542acc1e0",
"_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz",
"_shasum": "0ca30b58013db46b10084a09242ca1d8954724cc",
"_shrinkwrap": null,
"_spec": "big-integer@^1.6.7",
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser",
@@ -67,13 +68,13 @@
},
"directories": {},
"dist": {
"shasum": "4a5e915e3188c8708f254b356196f28542acc1e0",
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.19.tgz"
"shasum": "0ca30b58013db46b10084a09242ca1d8954724cc",
"tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz"
},
"engines": {
"node": ">=0.6"
},
"gitHead": "f0f751478d6623a84a5ed9618d94937829bbd015",
"gitHead": "09b50ab4e701a2ec4d403fa3ecf12ae327227190",
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
"keywords": [
"math",
@@ -104,5 +105,5 @@
"scripts": {
"test": "karma start my.conf.js"
},
"version": "1.6.19"
"version": "1.6.16"
}

View File

@@ -16,6 +16,7 @@
"_from": "bplist-parser@>=0.1.0 <0.2.0",
"_id": "bplist-parser@0.1.1",
"_inCache": true,
"_installable": true,
"_location": "/bplist-parser",
"_nodeVersion": "5.1.0",
"_npmUser": {

View File

@@ -16,6 +16,7 @@
"_from": "brace-expansion@>=1.0.0 <2.0.0",
"_id": "brace-expansion@1.1.6",
"_inCache": true,
"_installable": true,
"_location": "/brace-expansion",
"_nodeVersion": "4.4.7",
"_npmOperationalInternal": {

View File

@@ -16,6 +16,7 @@
"_from": "concat-map@0.0.1",
"_id": "concat-map@0.0.1",
"_inCache": true,
"_installable": true,
"_location": "/concat-map",
"_npmUser": {
"name": "substack",

View File

@@ -1,3 +1,2 @@
fixtures
coverage
jasmine.json

View File

@@ -20,16 +20,6 @@
-->
# Cordova-common Release Notes
### 2.0.1 (Mar 09, 2017)
* [CB-12557](https://issues.apache.org/jira/browse/CB-12557) add both stdout and stderr properties to the error object passed to superspawn reject handler.
### 2.0.0 (Jan 17, 2017)
* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Add `resource-file` parsing to `config.xml`
* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated `jshint` and updated tests to work with `jasmine@2` instead of `jasmine-node`
* [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Add reference attrib to `resource-file` for **Windows**
* Move windows-specific logic to `cordova-windows`
* [CB-12189](https://issues.apache.org/jira/browse/CB-12189) Add implementation attribute to framework
### 1.5.1 (Oct 12, 2016)
* [CB-12002](https://issues.apache.org/jira/browse/CB-12002) Add `getAllowIntents()` to `ConfigParser`
* [CB-11998](https://issues.apache.org/jira/browse/CB-11998) `cordova platform add` error with `cordova-common@1.5.0`

View File

@@ -2,48 +2,49 @@
"_args": [
[
{
"raw": "cordova-common@^2.0.1",
"raw": "cordova-common@^1.5.0",
"scope": null,
"escapedName": "cordova-common",
"name": "cordova-common",
"rawSpec": "^2.0.1",
"spec": ">=2.0.1 <3.0.0",
"rawSpec": "^1.5.0",
"spec": ">=1.5.0 <2.0.0",
"type": "range"
},
"/Users/steveng/repo/cordova/cordova-android"
]
],
"_from": "cordova-common@>=2.0.1 <3.0.0",
"_id": "cordova-common@2.0.1",
"_from": "cordova-common@>=1.5.0 <2.0.0",
"_id": "cordova-common@1.5.1",
"_inCache": true,
"_installable": true,
"_location": "/cordova-common",
"_nodeVersion": "6.9.4",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/cordova-common-2.0.1.tgz_1489432932737_0.5238456283695996"
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/cordova-common-1.5.1.tgz_1476725179180_0.39604957425035536"
},
"_npmUser": {
"name": "filmaj",
"email": "maj.fil@gmail.com"
"name": "stevegill",
"email": "stevengill97@gmail.com"
},
"_npmVersion": "3.10.10",
"_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
"raw": "cordova-common@^2.0.1",
"raw": "cordova-common@^1.5.0",
"scope": null,
"escapedName": "cordova-common",
"name": "cordova-common",
"rawSpec": "^2.0.1",
"spec": ">=2.0.1 <3.0.0",
"rawSpec": "^1.5.0",
"spec": ">=1.5.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/"
],
"_resolved": "http://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz",
"_shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
"_resolved": "file:cordova-dist/tools/cordova-common-1.5.1.tgz",
"_shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3",
"_shrinkwrap": null,
"_spec": "cordova-common@^2.0.1",
"_spec": "cordova-common@^1.5.0",
"_where": "/Users/steveng/repo/cordova/cordova-android",
"author": {
"name": "Apache Software Foundation"
@@ -70,17 +71,18 @@
},
"description": "Apache Cordova tools and platforms shared routines",
"devDependencies": {
"istanbul": "^0.4.5",
"jasmine": "^2.5.2",
"istanbul": "^0.3.17",
"jasmine-node": "^1.14.5",
"jshint": "^2.8.0",
"promise-matchers": "^0.9.6",
"rewire": "^2.5.1"
},
"directories": {},
"dist": {
"shasum": "99af318d7cb8988047cfe37bb9f25ea881d52815",
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.1.tgz"
"shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3",
"tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.5.1.tgz"
},
"engineStrict": true,
"engines": {
"node": ">=0.9.9"
},
@@ -91,10 +93,6 @@
"name": "bowserj",
"email": "bowserj@apache.org"
},
{
"name": "filmaj",
"email": "maj.fil@gmail.com"
},
{
"name": "kotikov.vladimir",
"email": "kotikov.vladimir@gmail.com"
@@ -124,10 +122,10 @@
"url": "git://git-wip-us.apache.org/repos/asf/cordova-common.git"
},
"scripts": {
"cover": "istanbul cover --root src --print detail jasmine",
"jasmine": "jasmine --captureExceptions --color",
"jshint": "jshint src && jshint spec",
"cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec",
"jasmine": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
"jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
"test": "npm run jshint && npm run jasmine"
},
"version": "2.0.1"
"version": "1.5.1"
}

View File

@@ -1,21 +1,21 @@
/**
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.
*/
/*
*
* Copyright 2013 Anis Kadri
*
* Licensed 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.
*
*/
/*
* This module deals with shared configuration / dependency "stuff". That is:
@@ -31,8 +31,11 @@
/* jshint sub:true */
var path = require('path'),
var fs = require('fs'),
path = require('path'),
et = require('elementtree'),
semver = require('semver'),
events = require('../events'),
ConfigKeeper = require('./ConfigKeeper'),
CordovaLogger = require('../CordovaLogger');
@@ -106,6 +109,18 @@ function remove_plugin_changes(pluginInfo, is_top_level) {
var munge = mungeutil.decrement_munge(global_munge, config_munge);
for (var file in munge.files) {
// CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
if (self.platform == 'windows' && file == 'package.appxmanifest' &&
!fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
// New windows template separate manifest files for Windows10, Windows8.1 and WP8.1
var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
/* jshint loopfunc:true */
substs.forEach(function(subst) {
events.emit('verbose', 'Applying munge to ' + subst);
self.apply_file_munge(subst, munge.files[file], true);
});
/* jshint loopfunc:false */
}
self.apply_file_munge(file, munge.files[file], /* remove = */ true);
}
@@ -235,6 +250,18 @@ function munge_helper(should_increment, self, platform_config, config_munge) {
}
for (var file in munge.files) {
// CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
if (self.platform == 'windows' && file == 'package.appxmanifest' &&
!fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
/* jshint loopfunc:true */
substs.forEach(function(subst) {
events.emit('verbose', 'Applying munge to ' + subst);
self.apply_file_munge(subst, munge.files[file]);
});
/* jshint loopfunc:false */
}
self.apply_file_munge(file, munge.files[file]);
}
@@ -306,6 +333,92 @@ function generate_plugin_config_munge(pluginInfo, vars, edit_config_changes) {
Array.prototype.push.apply(changes, edit_config_changes);
}
// Demux 'package.appxmanifest' into relevant platform-specific appx manifests.
// Only spend the cycles if there are version-specific plugin settings
if (self.platform === 'windows' &&
changes.some(function(change) {
return ((typeof change.versions !== 'undefined') ||
(typeof change.deviceTarget !== 'undefined'));
}))
{
var manifests = {
'windows': {
'8.1.0': 'package.windows.appxmanifest',
'10.0.0': 'package.windows10.appxmanifest'
},
'phone': {
'8.1.0': 'package.phone.appxmanifest',
'10.0.0': 'package.windows10.appxmanifest'
},
'all': {
'8.1.0': ['package.windows.appxmanifest', 'package.phone.appxmanifest'],
'10.0.0': 'package.windows10.appxmanifest'
}
};
var oldChanges = changes;
changes = [];
oldChanges.forEach(function(change, changeIndex) {
// Only support semver/device-target demux for package.appxmanifest
// Pass through in case something downstream wants to use it
if (change.target !== 'package.appxmanifest') {
changes.push(change);
return;
}
var hasVersion = (typeof change.versions !== 'undefined');
var hasTargets = (typeof change.deviceTarget !== 'undefined');
// No semver/device-target for this config-file, pass it through
if (!(hasVersion || hasTargets)) {
changes.push(change);
return;
}
var targetDeviceSet = hasTargets ? change.deviceTarget : 'all';
if (['windows', 'phone', 'all'].indexOf(targetDeviceSet) === -1) {
// target-device couldn't be resolved, fix it up here to a valid value
targetDeviceSet = 'all';
}
var knownWindowsVersionsForTargetDeviceSet = Object.keys(manifests[targetDeviceSet]);
// at this point, 'change' targets package.appxmanifest and has a version attribute
knownWindowsVersionsForTargetDeviceSet.forEach(function(winver) {
// This is a local function that creates the new replacement representing the
// mutation. Used to save code further down.
var createReplacement = function(manifestFile, originalChange) {
var replacement = {
target: manifestFile,
parent: originalChange.parent,
after: originalChange.after,
xmls: originalChange.xmls,
versions: originalChange.versions,
deviceTarget: originalChange.deviceTarget
};
return replacement;
};
// version doesn't satisfy, so skip
if (hasVersion && !semver.satisfies(winver, change.versions)) {
return;
}
var versionSpecificManifests = manifests[targetDeviceSet][winver];
if (versionSpecificManifests.constructor === Array) {
// e.g. all['8.1.0'] === ['pkg.windows.appxmanifest', 'pkg.phone.appxmanifest']
versionSpecificManifests.forEach(function(manifestFile) {
changes.push(createReplacement(manifestFile, change));
});
}
else {
// versionSpecificManifests is actually a single string
changes.push(createReplacement(versionSpecificManifests, change));
}
});
});
}
changes.forEach(function(change) {
change.xmls.forEach(function(xml) {
// 1. stringify each xml

View File

@@ -256,30 +256,6 @@ ConfigParser.prototype = {
return this.getStaticResources(platform, 'splash');
},
/**
* Returns all resource-files for a specific platform.
* @param {string} platform Platform name
* @return {Resource[]} Array of resource file objects.
*/
getFileResources: function(platform) {
var fileResources = [];
if (platform) { // platform specific resources
fileResources = this.doc.findall('platform[@name=\'' + platform + '\']/resource-file').map(function(tag) {
return {
platform: platform,
src: tag.attrib.src,
target: tag.attrib.target,
versions: tag.attrib.versions,
deviceTarget: tag.attrib['device-target'],
arch: tag.attrib.arch
};
});
}
return fileResources;
},
/**
* Returns all hook scripts for the hook type specified.
* @param {String} hook The hook type.

View File

@@ -225,8 +225,7 @@ function PluginInfo(dirname) {
target: tag.attrib.target,
versions: tag.attrib.versions,
deviceTarget: tag.attrib['device-target'],
arch: tag.attrib.arch,
reference: tag.attrib.reference
arch: tag.attrib.arch
};
});
return resourceFiles;
@@ -324,8 +323,7 @@ function PluginInfo(dirname) {
versions: el.attrib.versions,
targetDir: el.attrib['target-dir'],
deviceTarget: el.attrib['device-target'] || el.attrib.target,
arch: el.attrib.arch,
implementation: el.attrib.implementation
arch: el.attrib.arch
};
return ret;
});

View File

@@ -167,12 +167,6 @@ exports.spawn = function(cmd, args, opts) {
errMsg += ' Error output:\n' + capturedErr.trim();
}
var err = new Error(errMsg);
if (capturedErr) {
err.stderr = capturedErr;
}
if (capturedOut) {
err.stdout = capturedOut;
}
err.code = code;
d.reject(err);
}

View File

@@ -1,21 +1,21 @@
/**
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.
*/
/*
*
* Copyright 2013 Brett Rudd
*
* Licensed 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.
*
*/
// contains PLIST utility functions
var __ = require('underscore');

View File

@@ -1,21 +1,21 @@
/**
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.
*/
/*
*
* Copyright 2013 Anis Kadri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
/* jshint sub:true, laxcomma:true */

View File

@@ -16,6 +16,7 @@
"_from": "cordova-registry-mapper@>=1.1.8 <2.0.0",
"_id": "cordova-registry-mapper@1.1.15",
"_inCache": true,
"_installable": true,
"_location": "/cordova-registry-mapper",
"_nodeVersion": "5.4.1",
"_npmUser": {

View File

@@ -2,20 +2,21 @@
"_args": [
[
{
"raw": "elementtree@0.1.6",
"raw": "elementtree@^0.1.6",
"scope": null,
"escapedName": "elementtree",
"name": "elementtree",
"rawSpec": "0.1.6",
"spec": "0.1.6",
"type": "version"
"rawSpec": "^0.1.6",
"spec": ">=0.1.6 <0.2.0",
"type": "range"
},
"/Users/steveng/repo/cordova/cordova-android"
]
],
"_from": "elementtree@0.1.6",
"_from": "elementtree@>=0.1.6 <0.2.0",
"_id": "elementtree@0.1.6",
"_inCache": true,
"_installable": true,
"_location": "/elementtree",
"_npmUser": {
"name": "rphillips",
@@ -24,13 +25,13 @@
"_npmVersion": "1.3.24",
"_phantomChildren": {},
"_requested": {
"raw": "elementtree@0.1.6",
"raw": "elementtree@^0.1.6",
"scope": null,
"escapedName": "elementtree",
"name": "elementtree",
"rawSpec": "0.1.6",
"spec": "0.1.6",
"type": "version"
"rawSpec": "^0.1.6",
"spec": ">=0.1.6 <0.2.0",
"type": "range"
},
"_requiredBy": [
"/",
@@ -39,7 +40,7 @@
"_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"_shrinkwrap": null,
"_spec": "elementtree@0.1.6",
"_spec": "elementtree@^0.1.6",
"_where": "/Users/steveng/repo/cordova/cordova-android",
"author": {
"name": "Rackspace US, Inc."

4
node_modules/glob/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "glob@>=5.0.13 <6.0.0",
"_id": "glob@5.0.15",
"_inCache": true,
"_installable": true,
"_location": "/glob",
"_nodeVersion": "4.0.0",
"_npmUser": {
@@ -34,7 +35,8 @@
"type": "range"
},
"_requiredBy": [
"/cordova-common"
"/cordova-common",
"/istanbul"
],
"_resolved": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz",
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",

2
node_modules/inflight/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "inflight@>=1.0.4 <2.0.0",
"_id": "inflight@1.0.6",
"_inCache": true,
"_installable": true,
"_location": "/inflight",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
@@ -38,6 +39,7 @@
"type": "range"
},
"_requiredBy": [
"/cli/glob",
"/glob"
],
"_resolved": "http://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",

6
node_modules/inherits/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "inherits@>=2.0.0 <3.0.0",
"_id": "inherits@2.0.3",
"_inCache": true,
"_installable": true,
"_location": "/inherits",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
@@ -38,7 +39,10 @@
"type": "range"
},
"_requiredBy": [
"/glob"
"/cli/glob",
"/fileset/glob",
"/glob",
"/readable-stream"
],
"_resolved": "http://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"_shasum": "633c2c83e3da42a502f52466022480f4208261de",

1
node_modules/lodash/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "lodash@>=3.5.0 <4.0.0",
"_id": "lodash@3.10.1",
"_inCache": true,
"_installable": true,
"_location": "/lodash",
"_nodeVersion": "0.12.5",
"_npmUser": {

View File

@@ -16,6 +16,7 @@
"_from": "minimatch@>=3.0.0 <4.0.0",
"_id": "minimatch@3.0.3",
"_inCache": true,
"_installable": true,
"_location": "/minimatch",
"_nodeVersion": "4.4.4",
"_npmOperationalInternal": {
@@ -38,8 +39,10 @@
"type": "range"
},
"_requiredBy": [
"/cli/glob",
"/cordova-common",
"/glob"
"/glob",
"/jshint"
],
"_resolved": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz",
"_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774",

4
node_modules/nopt/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "nopt@>=3.0.1 <4.0.0",
"_id": "nopt@3.0.6",
"_inCache": true,
"_installable": true,
"_location": "/nopt",
"_nodeVersion": "4.2.1",
"_npmUser": {
@@ -34,7 +35,8 @@
"type": "range"
},
"_requiredBy": [
"/"
"/",
"/istanbul"
],
"_resolved": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
"_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9",

5
node_modules/once/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "once@>=1.3.0 <2.0.0",
"_id": "once@1.4.0",
"_inCache": true,
"_installable": true,
"_location": "/once",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
@@ -38,8 +39,10 @@
"type": "range"
},
"_requiredBy": [
"/cli/glob",
"/glob",
"/inflight"
"/inflight",
"/istanbul"
],
"_resolved": "http://registry.npmjs.org/once/-/once-1.4.0.tgz",
"_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1",

View File

@@ -16,6 +16,7 @@
"_from": "os-homedir@>=1.0.0 <2.0.0",
"_id": "os-homedir@1.0.2",
"_inCache": true,
"_installable": true,
"_location": "/os-homedir",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {

View File

@@ -16,6 +16,7 @@
"_from": "os-tmpdir@>=1.0.0 <2.0.0",
"_id": "os-tmpdir@1.0.2",
"_inCache": true,
"_installable": true,
"_location": "/os-tmpdir",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {

27
node_modules/osenv/package.json generated vendored
View File

@@ -14,19 +14,16 @@
]
],
"_from": "osenv@>=0.1.3 <0.2.0",
"_id": "osenv@0.1.4",
"_id": "osenv@0.1.3",
"_inCache": true,
"_installable": true,
"_location": "/osenv",
"_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/osenv-0.1.4.tgz_1481655889868_0.3980878754518926"
},
"_nodeVersion": "2.2.1",
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
"email": "isaacs@npmjs.com"
},
"_npmVersion": "3.10.9",
"_npmVersion": "3.0.0",
"_phantomChildren": {},
"_requested": {
"raw": "osenv@^0.1.3",
@@ -40,8 +37,8 @@
"_requiredBy": [
"/cordova-common"
],
"_resolved": "http://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz",
"_shasum": "42fe6d5953df06c8064be6f176c3d05aaaa34644",
"_resolved": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz",
"_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
"_shrinkwrap": null,
"_spec": "osenv@^0.1.3",
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/cordova-common",
@@ -59,16 +56,16 @@
},
"description": "Look up environment settings specific to different operating systems",
"devDependencies": {
"tap": "^8.0.1"
"tap": "^1.2.0"
},
"directories": {
"test": "test"
},
"dist": {
"shasum": "42fe6d5953df06c8064be6f176c3d05aaaa34644",
"tarball": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz"
"shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
"tarball": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz"
},
"gitHead": "ef718f0d20e38d45ec452b7faeefc692d3cd1062",
"gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4",
"homepage": "https://github.com/npm/osenv#readme",
"keywords": [
"environment",
@@ -109,5 +106,5 @@
"scripts": {
"test": "tap test/*.js"
},
"version": "0.1.4"
"version": "0.1.3"
}

10
node_modules/osenv/test/unix.js generated vendored
View File

@@ -2,13 +2,13 @@
// pretending to be another platform is too hacky, since it breaks
// how the underlying system looks up module paths and runs
// child processes, and all that stuff is cached.
var tap = require('tap')
if (process.platform === 'win32') {
tap.plan(0, 'Skip unix tests, this is not unix')
process.exit(0)
console.log('TAP Version 13\n' +
'1..0\n' +
'# Skip unix tests, this is not unix\n')
return
}
var tap = require('tap')
// like unix, but funny
process.env.USER = 'sirUser'

View File

@@ -16,6 +16,7 @@
"_from": "path-is-absolute@>=1.0.0 <2.0.0",
"_id": "path-is-absolute@1.0.1",
"_inCache": true,
"_installable": true,
"_location": "/path-is-absolute",
"_nodeVersion": "6.6.0",
"_npmOperationalInternal": {
@@ -38,6 +39,7 @@
"type": "range"
},
"_requiredBy": [
"/cli/glob",
"/glob"
],
"_resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",

1
node_modules/plist/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "plist@>=1.2.0 <2.0.0",
"_id": "plist@1.2.0",
"_inCache": true,
"_installable": true,
"_location": "/plist",
"_nodeVersion": "5.0.0",
"_npmUser": {

View File

@@ -16,6 +16,7 @@
"_from": "properties-parser@>=0.2.3 <0.3.0",
"_id": "properties-parser@0.2.3",
"_inCache": true,
"_installable": true,
"_location": "/properties-parser",
"_npmUser": {
"name": "xavi",

6
node_modules/q/CHANGES.md generated vendored
View File

@@ -1,9 +1,3 @@
## 1.5.0
- Q.any gives an error message from the last rejected promise
- Throw if callback supplied to "finally" is invalid (@grahamrhay)
- Long stack trace improvements, can now construct long stack traces
across rethrows.
## 1.4.1

2
node_modules/q/LICENSE generated vendored
View File

@@ -1,4 +1,4 @@
Copyright 20092017 Kristopher Michael Kowal. All rights reserved.
Copyright 20092014 Kristopher Michael Kowal. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the

19
node_modules/q/README.md generated vendored
View File

@@ -1,10 +1,17 @@
[![Build Status](https://secure.travis-ci.org/kriskowal/q.svg?branch=master)](http://travis-ci.org/kriskowal/q)
[![CDNJS](https://img.shields.io/cdnjs/v/q.js.svg)](https://cdnjs.com/libraries/q.js)
[![Build Status](https://secure.travis-ci.org/kriskowal/q.png?branch=master)](http://travis-ci.org/kriskowal/q)
<a href="http://promises-aplus.github.com/promises-spec">
<img src="http://kriskowal.github.io/q/q.png" align="right" alt="Q logo" />
<img src="http://kriskowal.github.io/q/q.png"
align="right" alt="Q logo" />
</a>
*This is Q version 1, from the `v1` branch in Git. This documentation applies to
the latest of both the version 1 and version 0.9 release trains. These releases
are stable. There will be no further releases of 0.9 after 0.9.7 which is nearly
equivalent to version 1.0.0. All further releases of `q@~1.0` will be backward
compatible. The version 2 release train introduces significant and
backward-incompatible changes and is experimental at this time.*
If a function cannot return a value or throw an exception without
blocking, it can return a promise instead. A promise is an object
that represents the return value or the thrown exception that the
@@ -73,7 +80,7 @@ The Q module can be loaded as:
the [q](https://npmjs.org/package/q) package
- An AMD module
- A [component](https://github.com/component/component) as ``microjs/q``
- Using [bower](http://bower.io/) as `q#^1.4.1`
- Using [bower](http://bower.io/) as `q#1.0.1`
- Using [NuGet](http://nuget.org/) as [Q](https://nuget.org/packages/q)
Q can exchange promises with jQuery, Dojo, When.js, WinJS, and more.
@@ -379,7 +386,7 @@ return funcs.reduce(Q.when, Q(initialVal));
### Handling Errors
One sometimes-unintuitive aspect of promises is that if you throw an
One sometimes-unintuive aspect of promises is that if you throw an
exception in the fulfillment handler, it will not be caught by the error
handler.
@@ -869,6 +876,6 @@ You can view the results of the Q test suite [in your browser][tests]!
## License
Copyright 20092017 Kristopher Michael Kowal and contributors
Copyright 20092015 Kristopher Michael Kowal and contributors
MIT License (enclosed)

30
node_modules/q/package.json generated vendored
View File

@@ -14,19 +14,16 @@
]
],
"_from": "q@>=1.4.1 <2.0.0",
"_id": "q@1.5.0",
"_id": "q@1.4.1",
"_inCache": true,
"_installable": true,
"_location": "/q",
"_nodeVersion": "6.9.5",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/q-1.5.0.tgz_1490148893963_0.4695124195422977"
},
"_nodeVersion": "1.8.1",
"_npmUser": {
"name": "kriskowal",
"email": "kris.kowal@cixar.com"
},
"_npmVersion": "3.10.10",
"_npmVersion": "2.8.3",
"_phantomChildren": {},
"_requested": {
"raw": "q@^1.4.1",
@@ -41,8 +38,8 @@
"/",
"/cordova-common"
],
"_resolved": "http://registry.npmjs.org/q/-/q-1.5.0.tgz",
"_shasum": "dd01bac9d06d30e6f219aecb8253ee9ebdc308f1",
"_resolved": "http://registry.npmjs.org/q/-/q-1.4.1.tgz",
"_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e",
"_shrinkwrap": null,
"_spec": "q@^1.4.1",
"_where": "/Users/steveng/repo/cordova/cordova-android",
@@ -88,8 +85,8 @@
"test": "./spec"
},
"dist": {
"shasum": "dd01bac9d06d30e6f219aecb8253ee9ebdc308f1",
"tarball": "https://registry.npmjs.org/q/-/q-1.5.0.tgz"
"shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e",
"tarball": "https://registry.npmjs.org/q/-/q-1.4.1.tgz"
},
"engines": {
"node": ">=0.6.0",
@@ -100,7 +97,7 @@
"q.js",
"queue.js"
],
"gitHead": "4fecabe07ff9f3683a3d4548e7f81c2aba693326",
"gitHead": "d373079d3620152e3d60e82f27265a09ee0e81bd",
"homepage": "https://github.com/kriskowal/q",
"keywords": [
"q",
@@ -116,7 +113,10 @@
"browser",
"node"
],
"license": "MIT",
"license": {
"type": "MIT",
"url": "http://github.com/kriskowal/q/raw/master/LICENSE"
},
"main": "q.js",
"maintainers": [
{
@@ -148,8 +148,8 @@
"lint": "jshint q.js",
"minify": "grunt",
"prepublish": "grunt",
"test": "npm ls -s && jasmine-node spec && promises-aplus-tests spec/aplus-adapter && npm run -s lint",
"test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter",
"test-browser": "opener spec/q-spec.html"
},
"version": "1.5.0"
"version": "1.4.1"
}

53
node_modules/q/q.js generated vendored
View File

@@ -1,8 +1,8 @@
// vim:ts=4:sts=4:sw=4:
/*!
*
* Copyright 2009-2017 Kris Kowal under the terms of the MIT
* license found at https://github.com/kriskowal/q/blob/v1/LICENSE
* Copyright 2009-2012 Kris Kowal under the terms of the MIT
* license found at http://github.com/kriskowal/q/raw/master/LICENSE
*
* With parts by Tyler Close
* Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
@@ -190,7 +190,7 @@ var nextTick =(function () {
// `setTimeout`. In this case `setImmediate` is preferred because
// it is faster. Browserify's `process.toString()` yields
// "[object Object]", while in a real Node environment
// `process.toString()` yields "[object process]".
// `process.nextTick()` yields "[object process]".
isNodeJS = true;
requestTick = function () {
@@ -327,11 +327,6 @@ var object_create = Object.create || function (prototype) {
return new Type();
};
var object_defineProperty = Object.defineProperty || function (obj, prop, descriptor) {
obj[prop] = descriptor.value;
return obj;
};
var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
var object_keys = Object.keys || function (object) {
@@ -382,20 +377,19 @@ function makeStackTraceLong(error, promise) {
promise.stack &&
typeof error === "object" &&
error !== null &&
error.stack
error.stack &&
error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
) {
var stacks = [];
for (var p = promise; !!p; p = p.source) {
if (p.stack && (!error.__minimumStackCounter__ || error.__minimumStackCounter__ > p.stackCounter)) {
object_defineProperty(error, "__minimumStackCounter__", {value: p.stackCounter, configurable: true});
if (p.stack) {
stacks.unshift(p.stack);
}
}
stacks.unshift(error.stack);
var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
var stack = filterStackString(concatedStacks);
object_defineProperty(error, "stack", {value: stack, configurable: true});
error.stack = filterStackString(concatedStacks);
}
}
@@ -522,14 +516,6 @@ Q.nextTick = nextTick;
*/
Q.longStackSupport = false;
/**
* The counter is used to determine the stopping point for building
* long stack traces. In makeStackTraceLong we walk backwards through
* the linked list of promises, only stacks which were created before
* the rejection are concatenated.
*/
var longStackCounter = 1;
// enable long stacks if Q_DEBUG is set
if (typeof process === "object" && process && process.env && process.env.Q_DEBUG) {
Q.longStackSupport = true;
@@ -602,7 +588,6 @@ function defer() {
// At the same time, cut off the first line; it's always just
// "[object Promise]\n", as per the `toString`.
promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
promise.stackCounter = longStackCounter++;
}
}
@@ -612,12 +597,7 @@ function defer() {
function become(newPromise) {
resolvedPromise = newPromise;
if (Q.longStackSupport && hasStacks) {
// Only hold a reference to the new promise if long stacks
// are enabled to reduce memory usage
promise.source = newPromise;
}
promise.source = newPromise;
array_reduce(messages, function (undefined, message) {
Q.nextTick(function () {
@@ -745,7 +725,7 @@ Promise.prototype.join = function (that) {
// TODO: "===" should be Object.is or equiv
return x;
} else {
throw new Error("Q can't join: not the same: " + x + " " + y);
throw new Error("Can't join: not the same: " + x + " " + y);
}
});
};
@@ -1642,12 +1622,13 @@ function any(promises) {
function onFulfilled(result) {
deferred.resolve(result);
}
function onRejected(err) {
function onRejected() {
pendingCount--;
if (pendingCount === 0) {
err.message = ("Q can't get fulfillment value from any promise, all " +
"promises were rejected. Last error message: " + err.message);
deferred.reject(err);
deferred.reject(new Error(
"Can't get fulfillment value from any promise, all " +
"promises were rejected."
));
}
}
function onProgress(progress) {
@@ -1771,9 +1752,6 @@ Q["finally"] = function (object, callback) {
Promise.prototype.fin = // XXX legacy
Promise.prototype["finally"] = function (callback) {
if (!callback || typeof callback.apply !== "function") {
throw new Error("Q can't apply finally callback");
}
callback = Q(callback);
return this.then(function (value) {
return callback.fcall().then(function () {
@@ -1937,9 +1915,6 @@ Promise.prototype.nfcall = function (/*...args*/) {
*/
Q.nfbind =
Q.denodeify = function (callback /*...args*/) {
if (callback === undefined) {
throw new Error("Q can't wrap an undefined function");
}
var baseArgs = array_slice(arguments, 1);
return function () {
var nodeArgs = baseArgs.concat(array_slice(arguments));

1
node_modules/sax/package.json generated vendored
View File

@@ -18,6 +18,7 @@
"_from": "sax@0.3.5",
"_id": "sax@0.3.5",
"_inCache": true,
"_installable": true,
"_location": "/sax",
"_nodeVersion": "v0.6.7-pre",
"_npmUser": {

1
node_modules/semver/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "semver@>=5.0.1 <6.0.0",
"_id": "semver@5.3.0",
"_inCache": true,
"_installable": true,
"_location": "/semver",
"_nodeVersion": "4.4.4",
"_npmOperationalInternal": {

1
node_modules/shelljs/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "shelljs@>=0.5.3 <0.6.0",
"_id": "shelljs@0.5.3",
"_inCache": true,
"_installable": true,
"_location": "/shelljs",
"_nodeVersion": "1.2.0",
"_npmUser": {

View File

@@ -16,6 +16,7 @@
"_from": "underscore@>=1.8.3 <2.0.0",
"_id": "underscore@1.8.3",
"_inCache": true,
"_installable": true,
"_location": "/underscore",
"_npmUser": {
"name": "jashkenas",
@@ -33,7 +34,8 @@
"type": "range"
},
"_requiredBy": [
"/cordova-common"
"/cordova-common",
"/jasmine-node"
],
"_resolved": "http://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
"_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",

1
node_modules/unorm/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "unorm@>=1.3.3 <2.0.0",
"_id": "unorm@1.4.1",
"_inCache": true,
"_installable": true,
"_location": "/unorm",
"_npmUser": {
"name": "walling",

View File

@@ -16,6 +16,7 @@
"_from": "util-deprecate@1.0.2",
"_id": "util-deprecate@1.0.2",
"_inCache": true,
"_installable": true,
"_location": "/util-deprecate",
"_nodeVersion": "4.1.2",
"_npmUser": {

1
node_modules/wrappy/package.json generated vendored
View File

@@ -16,6 +16,7 @@
"_from": "wrappy@>=1.0.0 <2.0.0",
"_id": "wrappy@1.0.2",
"_inCache": true,
"_installable": true,
"_location": "/wrappy",
"_nodeVersion": "5.10.1",
"_npmOperationalInternal": {

View File

@@ -16,6 +16,7 @@
"_from": "xmlbuilder@4.0.0",
"_id": "xmlbuilder@4.0.0",
"_inCache": true,
"_installable": true,
"_location": "/xmlbuilder",
"_npmUser": {
"name": "oozcitak",

48
node_modules/xmldom/dom-parser.js generated vendored
View File

@@ -2,7 +2,7 @@ function DOMParser(options){
this.options = options ||{locator:{}};
}
DOMParser.prototype.parseFromString = function(source,mimeType){
DOMParser.prototype.parseFromString = function(source,mimeType){
var options = this.options;
var sax = new XMLReader();
var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
@@ -25,9 +25,9 @@ DOMParser.prototype.parseFromString = function(source,mimeType){
if(source){
sax.parse(source,defaultNSMap,entityMap);
}else{
sax.errorHandler.error("invalid doc source");
sax.errorHandler.error("invalid document source");
}
return domBuilder.doc;
return domBuilder.document;
}
function buildErrorHandler(errorImpl,domBuilder,locator){
if(!errorImpl){
@@ -77,13 +77,13 @@ function position(locator,node){
*/
DOMHandler.prototype = {
startDocument : function() {
this.doc = new DOMImplementation().createDocument(null, null, null);
this.document = new DOMImplementation().createDocument(null, null, null);
if (this.locator) {
this.doc.documentURI = this.locator.systemId;
this.document.documentURI = this.locator.systemId;
}
},
startElement:function(namespaceURI, localName, qName, attrs) {
var doc = this.doc;
var doc = this.document;
var el = doc.createElementNS(namespaceURI, qName||localName);
var len = attrs.length;
appendElement(this, el);
@@ -95,22 +95,24 @@ DOMHandler.prototype = {
var value = attrs.getValue(i);
var qName = attrs.getQName(i);
var attr = doc.createAttributeNS(namespaceURI, qName);
this.locator &&position(attrs.getLocator(i),attr);
if( attr.getOffset){
position(attr.getOffset(1),attr)
}
attr.value = attr.nodeValue = value;
el.setAttributeNode(attr)
}
},
endElement:function(namespaceURI, localName, qName) {
var current = this.currentElement
var tagName = current.tagName;
this.currentElement = current.parentNode;
var tagName = current.tagName;
this.currentElement = current.parentNode;
},
startPrefixMapping:function(prefix, uri) {
},
endPrefixMapping:function(prefix) {
},
processingInstruction:function(target, data) {
var ins = this.doc.createProcessingInstruction(target, data);
var ins = this.document.createProcessingInstruction(target, data);
this.locator && position(this.locator,ins)
appendElement(this, ins);
},
@@ -119,17 +121,13 @@ DOMHandler.prototype = {
characters:function(chars, start, length) {
chars = _toString.apply(this,arguments)
//console.log(chars)
if(chars){
if(this.currentElement && chars){
if (this.cdata) {
var charNode = this.doc.createCDATASection(chars);
} else {
var charNode = this.doc.createTextNode(chars);
}
if(this.currentElement){
var charNode = this.document.createCDATASection(chars);
this.currentElement.appendChild(charNode);
} else {
var charNode = this.document.createTextNode(chars);
this.currentElement.appendChild(charNode);
}else if(/^\s*$/.test(chars)){
this.doc.appendChild(charNode);
//process xml
}
this.locator && position(this.locator,charNode)
}
@@ -137,7 +135,7 @@ DOMHandler.prototype = {
skippedEntity:function(name) {
},
endDocument:function() {
this.doc.normalize();
this.document.normalize();
},
setDocumentLocator:function (locator) {
if(this.locator = locator){// && !('lineNumber' in locator)){
@@ -147,7 +145,7 @@ DOMHandler.prototype = {
//LexicalHandler
comment:function(chars, start, length) {
chars = _toString.apply(this,arguments)
var comm = this.doc.createComment(chars);
var comm = this.document.createComment(chars);
this.locator && position(this.locator,comm)
appendElement(this, comm);
},
@@ -161,7 +159,7 @@ DOMHandler.prototype = {
},
startDTD:function(name, publicId, systemId) {
var impl = this.doc.implementation;
var impl = this.document.implementation;
if (impl && impl.createDocumentType) {
var dt = impl.createDocumentType(name, publicId, systemId);
this.locator && position(this.locator,dt)
@@ -237,15 +235,15 @@ function _toString(chars,start,length){
/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
function appendElement (hander,node) {
if (!hander.currentElement) {
hander.doc.appendChild(node);
hander.document.appendChild(node);
} else {
hander.currentElement.appendChild(node);
}
}//appendChild and setAttributeNS are preformance key
//if(typeof require == 'function'){
if(typeof require == 'function'){
var XMLReader = require('./sax').XMLReader;
var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
exports.XMLSerializer = require('./dom').XMLSerializer ;
exports.DOMParser = DOMParser;
//}
}

161
node_modules/xmldom/dom.js generated vendored
View File

@@ -110,9 +110,9 @@ NodeList.prototype = {
item: function(index) {
return this[index] || null;
},
toString:function(isHTML,nodeFilter){
toString:function(){
for(var buf = [], i = 0;i<this.length;i++){
serializeToString(this[i],buf,isHTML,nodeFilter);
serializeToString(this[i],buf);
}
return buf.join('');
}
@@ -170,7 +170,6 @@ function _addNamedNode(el,list,newAttr,oldAttr){
}
}
function _removeNamedNode(el,list,attr){
//console.log('remove attr:'+attr)
var i = _findNodeIndex(list,attr);
if(i>=0){
var lastIndex = list.length-1
@@ -186,7 +185,7 @@ function _removeNamedNode(el,list,attr){
}
}
}else{
throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
throw DOMException(NOT_FOUND_ERR,new Error())
}
}
NamedNodeMap.prototype = {
@@ -196,11 +195,9 @@ NamedNodeMap.prototype = {
// if(key.indexOf(':')>0 || key == 'xmlns'){
// return null;
// }
//console.log()
var i = this.length;
while(i--){
var attr = this[i];
//console.log(attr.nodeName,key)
if(attr.nodeName == key){
return attr;
}
@@ -382,7 +379,7 @@ Node.prototype = {
}
}
}
el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
el = el.nodeType == 2?el.ownerDocument : el.parentNode;
}
return null;
},
@@ -397,7 +394,7 @@ Node.prototype = {
return map[prefix] ;
}
}
el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
el = el.nodeType == 2?el.ownerDocument : el.parentNode;
}
return null;
},
@@ -582,7 +579,7 @@ Document.prototype = {
}
return newChild;
}
if(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){
if(this.documentElement == null && newChild.nodeType == 1){
this.documentElement = newChild;
}
@@ -602,7 +599,7 @@ Document.prototype = {
getElementById : function(id){
var rtv = null;
_visitNode(this.documentElement,function(node){
if(node.nodeType == ELEMENT_NODE){
if(node.nodeType == 1){
if(node.getAttribute('id') == id){
rtv = node;
return true;
@@ -751,7 +748,6 @@ Element.prototype = {
return this.attributes.setNamedItemNS(newAttr);
},
removeAttributeNode : function(oldAttr){
//console.log(this == oldAttr.ownerElement)
return this.attributes.removeNamedItem(oldAttr.nodeName);
},
//get real attribute name,and remove it by removeAttributeNode
@@ -796,7 +792,6 @@ Element.prototype = {
}
});
return ls;
});
}
};
@@ -828,7 +823,10 @@ CharacterData.prototype = {
},
appendChild:function(newChild){
throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
//if(!(newChild instanceof CharacterData)){
throw new Error(ExceptionMessage[3])
//}
return Node.prototype.appendChild.apply(this,arguments)
},
deleteData: function(offset, count) {
this.replaceData(offset,count,"");
@@ -910,132 +908,39 @@ function ProcessingInstruction() {
ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
_extends(ProcessingInstruction,Node);
function XMLSerializer(){}
XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
return nodeSerializeToString.call(node,isHtml,nodeFilter);
XMLSerializer.prototype.serializeToString = function(node,attributeSorter){
return node.toString(attributeSorter);
}
Node.prototype.toString = nodeSerializeToString;
function nodeSerializeToString(isHtml,nodeFilter){
Node.prototype.toString =function(attributeSorter){
var buf = [];
var refNode = this.nodeType == 9?this.documentElement:this;
var prefix = refNode.prefix;
var uri = refNode.namespaceURI;
if(uri && prefix == null){
//console.log(prefix)
var prefix = refNode.lookupPrefix(uri);
if(prefix == null){
//isHTML = true;
var visibleNamespaces=[
{namespace:uri,prefix:null}
//{namespace:uri,prefix:''}
]
}
}
serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
//console.log('###',this.nodeType,uri,prefix,buf.join(''))
serializeToString(this,buf,attributeSorter);
return buf.join('');
}
function needNamespaceDefine(node,isHTML, visibleNamespaces) {
var prefix = node.prefix||'';
var uri = node.namespaceURI;
if (!prefix && !uri){
return false;
}
if (prefix === "xml" && uri === "http://www.w3.org/XML/1998/namespace"
|| uri == 'http://www.w3.org/2000/xmlns/'){
return false;
}
var i = visibleNamespaces.length
//console.log('@@@@',node.tagName,prefix,uri,visibleNamespaces)
while (i--) {
var ns = visibleNamespaces[i];
// get namespace prefix
//console.log(node.nodeType,node.tagName,ns.prefix,prefix)
if (ns.prefix == prefix){
return ns.namespace != uri;
}
}
//console.log(isHTML,uri,prefix=='')
//if(isHTML && prefix ==null && uri == 'http://www.w3.org/1999/xhtml'){
// return false;
//}
//node.flag = '11111'
//console.error(3,true,node.flag,node.prefix,node.namespaceURI)
return true;
}
function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
if(nodeFilter){
node = nodeFilter(node);
if(node){
if(typeof node == 'string'){
buf.push(node);
return;
}
}else{
return;
}
//buf.sort.apply(attrs, attributeSorter);
}
function serializeToString(node,buf,attributeSorter,isHTML){
switch(node.nodeType){
case ELEMENT_NODE:
if (!visibleNamespaces) visibleNamespaces = [];
var startVisibleNamespaces = visibleNamespaces.length;
var attrs = node.attributes;
var len = attrs.length;
var child = node.firstChild;
var nodeName = node.tagName;
isHTML = (htmlns === node.namespaceURI) ||isHTML
buf.push('<',nodeName);
for(var i=0;i<len;i++){
// add namespaces for attributes
var attr = attrs.item(i);
if (attr.prefix == 'xmlns') {
visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
}else if(attr.nodeName == 'xmlns'){
visibleNamespaces.push({ prefix: '', namespace: attr.value });
}
if(attributeSorter){
buf.sort.apply(attrs, attributeSorter);
}
for(var i=0;i<len;i++){
var attr = attrs.item(i);
if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
var prefix = attr.prefix||'';
var uri = attr.namespaceURI;
var ns = prefix ? ' xmlns:' + prefix : " xmlns";
buf.push(ns, '="' , uri , '"');
visibleNamespaces.push({ prefix: prefix, namespace:uri });
}
serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
serializeToString(attrs.item(i),buf,attributeSorter,isHTML);
}
// add namespace for current node
if (needNamespaceDefine(node,isHTML, visibleNamespaces)) {
var prefix = node.prefix||'';
var uri = node.namespaceURI;
var ns = prefix ? ' xmlns:' + prefix : " xmlns";
buf.push(ns, '="' , uri , '"');
visibleNamespaces.push({ prefix: prefix, namespace:uri });
}
if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
if(child || isHTML && !/^(?:meta|link|img|br|hr|input|button)$/i.test(nodeName)){
buf.push('>');
//if is cdata child node
if(isHTML && /^script$/i.test(nodeName)){
while(child){
if(child.data){
buf.push(child.data);
}else{
serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
}
child = child.nextSibling;
if(child){
buf.push(child.data);
}
}else
{
}else{
while(child){
serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
serializeToString(child,buf,attributeSorter,isHTML);
child = child.nextSibling;
}
}
@@ -1043,14 +948,12 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
}else{
buf.push('/>');
}
// remove added visible namespaces
//visibleNamespaces.length = startVisibleNamespaces;
return;
case DOCUMENT_NODE:
case DOCUMENT_FRAGMENT_NODE:
var child = node.firstChild;
while(child){
serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
serializeToString(child,buf,attributeSorter,isHTML);
child = child.nextSibling;
}
return;
@@ -1195,8 +1098,8 @@ try{
},
set:function(data){
switch(this.nodeType){
case ELEMENT_NODE:
case DOCUMENT_FRAGMENT_NODE:
case 1:
case 11:
while(this.firstChild){
this.removeChild(this.firstChild);
}
@@ -1207,7 +1110,7 @@ try{
default:
//TODO:
this.data = data;
this.value = data;
this.value = value;
this.nodeValue = data;
}
}
@@ -1215,8 +1118,8 @@ try{
function getTextContent(node){
switch(node.nodeType){
case ELEMENT_NODE:
case DOCUMENT_FRAGMENT_NODE:
case 1:
case 11:
var buf = [];
node = node.firstChild;
while(node){
@@ -1238,7 +1141,7 @@ try{
}catch(e){//ie8
}
//if(typeof require == 'function'){
if(typeof require == 'function'){
exports.DOMImplementation = DOMImplementation;
exports.XMLSerializer = XMLSerializer;
//}
}

19
node_modules/xmldom/package.json generated vendored
View File

@@ -14,14 +14,11 @@
]
],
"_from": "xmldom@>=0.1.0 <0.2.0",
"_id": "xmldom@0.1.27",
"_id": "xmldom@0.1.22",
"_inCache": true,
"_installable": true,
"_location": "/xmldom",
"_nodeVersion": "5.5.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/xmldom-0.1.27.tgz_1480305406093_0.9070004557725042"
},
"_npmUser": {
"name": "jindw",
"email": "jindw@xidea.org"
@@ -40,8 +37,8 @@
"_requiredBy": [
"/plist"
],
"_resolved": "http://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz",
"_shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9",
"_resolved": "http://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz",
"_shasum": "10de4e5e964981f03c8cc72fadc08d14b6c3aa26",
"_shrinkwrap": null,
"_spec": "xmldom@0.1.x",
"_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/plist",
@@ -78,13 +75,13 @@
},
"directories": {},
"dist": {
"shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9",
"tarball": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz"
"shasum": "10de4e5e964981f03c8cc72fadc08d14b6c3aa26",
"tarball": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz"
},
"engines": {
"node": ">=0.1"
},
"gitHead": "b53aa82a36160d85faab394035dcd1784764537f",
"gitHead": "29a83b315aef56c156602286b2d884a3b4c2521f",
"homepage": "https://github.com/jindw/xmldom",
"keywords": [
"w3c",
@@ -135,5 +132,5 @@
"scripts": {
"test": "proof platform win32 && proof test */*/*.t.js || t/test"
},
"version": "0.1.27"
"version": "0.1.22"
}

215
node_modules/xmldom/sax.js generated vendored
View File

@@ -2,21 +2,21 @@
//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
//[5] Name ::= NameStartChar (NameChar)*
var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\u00B7\u0300-\u036F\\u203F-\u2040]");
var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
//S_TAG, S_ATTR, S_EQ, S_V
//S_ATTR_S, S_E, S_S, S_C
var S_TAG = 0;//tag name offerring
var S_ATTR = 1;//attr name offerring
var S_ATTR_SPACE=2;//attr name end and space offer
var S_ATTR_S=2;//attr name end and space offer
var S_EQ = 3;//=space?
var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
var S_ATTR_END = 5;//attr value end and no space(quot end)
var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)
var S_TAG_CLOSE = 7;//closed el<el />
var S_V = 4;//attr value(no quot value only)
var S_E = 5;//attr value end and no space(quot end)
var S_S = 6;//(attr value end || tag end ) && (space offer)
var S_C = 7;//closed el<el />
function XMLReader(){
@@ -33,7 +33,7 @@ XMLReader.prototype = {
}
}
function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
function fixedFromCharCode(code) {
function fixedFromCharCode(code) {
// String.prototype.fromCharCode does not supports
// > 2 bytes unicode chars directly
if (code > 0xffff) {
@@ -76,7 +76,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
}
var lineStart = 0;
var lineEnd = 0;
var linePattern = /.*(?:\r\n?|\n)|.*$/g
var linePattern = /.+(?:\r\n?|\n)|.*$/g
var locator = domBuilder.locator;
var parseStack = [{currentNSMap:defaultNSMapCopy}]
@@ -87,7 +87,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
var tagStart = source.indexOf('<',start);
if(tagStart<0){
if(!source.substr(start).match(/^\s*$/)){
var doc = domBuilder.doc;
var doc = domBuilder.document;
var text = doc.createTextNode(source.substr(start));
doc.appendChild(text);
domBuilder.currentElement = text;
@@ -102,36 +102,16 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
var end = source.indexOf('>',tagStart+3);
var tagName = source.substring(tagStart+2,end);
var config = parseStack.pop();
if(end<0){
tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
//console.error('#@@@@@@'+tagName)
errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
end = tagStart+1+tagName.length;
}else if(tagName.match(/\s</)){
tagName = tagName.replace(/[\s<].*/,'');
errorHandler.error("end tag name: "+tagName+' maybe not complete');
end = tagStart+1+tagName.length;
}
//console.error(parseStack.length,parseStack)
//console.error(config);
var localNSMap = config.localNSMap;
var endMatch = config.tagName == tagName;
var endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()
if(endIgnoreCaseMach){
domBuilder.endElement(config.uri,config.localName,tagName);
if(localNSMap){
for(var prefix in localNSMap){
domBuilder.endPrefixMapping(prefix) ;
}
}
if(!endMatch){
errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
}
}else{
parseStack.push(config)
if(config.tagName != tagName){
errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
}
domBuilder.endElement(config.uri,config.localName,tagName);
if(localNSMap){
for(var prefix in localNSMap){
domBuilder.endPrefixMapping(prefix) ;
}
}
end++;
break;
// end elment
@@ -144,40 +124,33 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
end = parseDCC(source,tagStart,domBuilder,errorHandler);
break;
default:
locator&&position(tagStart);
var el = new ElementAttributes();
var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
//elStartEnd
var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
var end = parseElementStartPart(source,tagStart,el,entityReplacer,errorHandler);
var len = el.length;
if(locator){
if(len){
//attribute position fixed
for(var i = 0;i<len;i++){
var a = el[i];
position(a.offset);
a.offset = copyLocator(locator,{});
}
}
position(end);
}
if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
el.closed = true;
if(!entityMap.nbsp){
errorHandler.warning('unclosed xml attribute');
}
}
if(locator && len){
var locator2 = copyLocator(locator,{});
//try{//attribute position fixed
for(var i = 0;i<len;i++){
var a = el[i];
position(a.offset);
a.locator = copyLocator(locator,{});
}
//}catch(e){console.error('@@@@@'+e)}
domBuilder.locator = locator2
if(appendElement(el,domBuilder,currentNSMap)){
parseStack.push(el)
}
domBuilder.locator = locator;
}else{
if(appendElement(el,domBuilder,currentNSMap)){
parseStack.push(el)
}
}
appendElement(el,domBuilder,parseStack);
if(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){
@@ -187,10 +160,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
}
}
}catch(e){
errorHandler.error('element parse error: '+e)
//errorHandler.error('element parse error: '+e);
errorHandler.error('element parse error: '+e);
end = -1;
//throw e;
}
if(end>start){
start = end;
@@ -210,7 +181,7 @@ function copyLocator(f,t){
* @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
* @return end of the elementStartPart(end of elementEndPart for selfClosed el)
*/
function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){
function parseElementStartPart(source,start,el,entityReplacer,errorHandler){
var attrName;
var value;
var p = ++start;
@@ -222,7 +193,7 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
if(s === S_ATTR){//attrName
attrName = source.slice(start,p);
s = S_EQ;
}else if(s === S_ATTR_SPACE){
}else if(s === S_ATTR_S){
s = S_EQ;
}else{
//fatalError: equal must after attrName or space after attrName
@@ -231,30 +202,25 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
break;
case '\'':
case '"':
if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE
){//equal
if(s === S_ATTR){
errorHandler.warning('attribute value must after "="')
attrName = source.slice(start,p)
}
if(s === S_EQ){//equal
start = p+1;
p = source.indexOf(c,start)
if(p>0){
value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
el.add(attrName,value,start-1);
s = S_ATTR_END;
s = S_E;
}else{
//fatalError: no end quot match
throw new Error('attribute value no end \''+c+'\' match');
}
}else if(s == S_ATTR_NOQUOT_VALUE){
}else if(s == S_V){
value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
//console.log(attrName,value,start,p)
el.add(attrName,value,start);
//console.dir(el)
errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
start = p+1;
s = S_ATTR_END
s = S_E
}else{
//fatalError: no equal before
throw new Error('attribute value must after "="');
@@ -264,14 +230,14 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));
case S_ATTR_END:
case S_TAG_SPACE:
case S_TAG_CLOSE:
s =S_TAG_CLOSE;
case S_E:
case S_S:
case S_C:
s = S_C;
el.closed = true;
case S_ATTR_NOQUOT_VALUE:
case S_V:
case S_ATTR:
case S_ATTR_SPACE:
case S_ATTR_S:
break;
//case S_EQ:
default:
@@ -281,36 +247,30 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
case ''://end document
//throw new Error('unexpected end of input')
errorHandler.error('unexpected end of input');
if(s == S_TAG){
el.setTagName(source.slice(start,p));
}
return p;
case '>':
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));
case S_ATTR_END:
case S_TAG_SPACE:
case S_TAG_CLOSE:
case S_E:
case S_S:
case S_C:
break;//normal
case S_ATTR_NOQUOT_VALUE://Compatible state
case S_V://Compatible state
case S_ATTR:
value = source.slice(start,p);
if(value.slice(-1) === '/'){
el.closed = true;
value = value.slice(0,-1)
}
case S_ATTR_SPACE:
if(s === S_ATTR_SPACE){
case S_ATTR_S:
if(s === S_ATTR_S){
value = attrName;
}
if(s == S_ATTR_NOQUOT_VALUE){
if(s == S_V){
errorHandler.warning('attribute "'+value+'" missed quot(")!!');
el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start)
}else{
if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){
errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
}
errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
el.add(value,value,start)
}
break;
@@ -327,68 +287,64 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));//tagName
s = S_TAG_SPACE;
s = S_S;
break;
case S_ATTR:
attrName = source.slice(start,p)
s = S_ATTR_SPACE;
s = S_ATTR_S;
break;
case S_ATTR_NOQUOT_VALUE:
case S_V:
var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
errorHandler.warning('attribute "'+value+'" missed quot(")!!');
el.add(attrName,value,start)
case S_ATTR_END:
s = S_TAG_SPACE;
case S_E:
s = S_S;
break;
//case S_TAG_SPACE:
//case S_S:
//case S_EQ:
//case S_ATTR_SPACE:
//case S_ATTR_S:
// void();break;
//case S_TAG_CLOSE:
//case S_C:
//ignore warning
}
}else{//not space
//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
//S_TAG, S_ATTR, S_EQ, S_V
//S_ATTR_S, S_E, S_S, S_C
switch(s){
//case S_TAG:void();break;
//case S_ATTR:void();break;
//case S_ATTR_NOQUOT_VALUE:void();break;
case S_ATTR_SPACE:
var tagName = el.tagName;
if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){
errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
}
//case S_V:void();break;
case S_ATTR_S:
errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!')
el.add(attrName,attrName,start);
start = p;
s = S_ATTR;
break;
case S_ATTR_END:
case S_E:
errorHandler.warning('attribute space is required"'+attrName+'"!!')
case S_TAG_SPACE:
case S_S:
s = S_ATTR;
start = p;
break;
case S_EQ:
s = S_ATTR_NOQUOT_VALUE;
s = S_V;
start = p;
break;
case S_TAG_CLOSE:
case S_C:
throw new Error("elements closed character '/' and '>' must be connected to");
}
}
}//end outer switch
//console.log('p++',p)
}
p++;
}
}
/**
* @return true if has new namespace define
* @return end of the elementStartPart(end of elementEndPart for selfClosed el)
*/
function appendElement(el,domBuilder,currentNSMap){
function appendElement(el,domBuilder,parseStack){
var tagName = el.tagName;
var localNSMap = null;
//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
var i = el.length;
while(i--){
var a = el[i];
@@ -427,7 +383,7 @@ function appendElement(el,domBuilder,currentNSMap){
if(prefix === 'xml'){
a.uri = 'http://www.w3.org/XML/1998/namespace';
}if(prefix !== 'xmlns'){
a.uri = currentNSMap[prefix || '']
a.uri = currentNSMap[prefix]
//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
}
@@ -456,8 +412,7 @@ function appendElement(el,domBuilder,currentNSMap){
}else{
el.currentNSMap = currentNSMap;
el.localNSMap = localNSMap;
//parseStack.push(el);
return true;
parseStack.push(el);
}
}
function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
@@ -487,11 +442,7 @@ function fixSelfClosed(source,elStartEnd,tagName,closeMap){
var pos = closeMap[tagName];
if(pos == null){
//console.log(tagName)
pos = source.lastIndexOf('</'+tagName+'>')
if(pos<elStartEnd){//忘记闭合
pos = source.lastIndexOf('</'+tagName)
}
closeMap[tagName] =pos
pos = closeMap[tagName] = source.lastIndexOf('</'+tagName+'>')
}
return pos<elStartEnd;
//}
@@ -582,7 +533,7 @@ ElementAttributes.prototype = {
},
length:0,
getLocalName:function(i){return this[i].localName},
getLocator:function(i){return this[i].locator},
getOffset:function(i){return this[i].offset},
getQName:function(i){return this[i].qName},
getURI:function(i){return this[i].uri},
getValue:function(i){return this[i].value}
@@ -629,5 +580,7 @@ function split(source,start){
}
}
exports.XMLReader = XMLReader;
if(typeof require == 'function'){
exports.XMLReader = XMLReader;
}

View File

@@ -1,6 +1,6 @@
{
"name": "cordova-android",
"version": "6.2.2",
"version": "6.1.0",
"description": "cordova-android release",
"bin": {
"create": "bin/create"
@@ -16,16 +16,16 @@
"apache"
],
"scripts": {
"test": "npm run jshint && jasmine",
"cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
"test-build": "jasmine --captureExceptions --color spec/e2e/*.spec.js",
"jshint": "jshint bin && jshint spec"
"test": "npm run jshint && jasmine-node --color spec/unit",
"cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
"test-build": "jasmine-node --captureExceptions --color spec/e2e",
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
},
"author": "Apache Software Foundation",
"license": "Apache-2.0",
"dependencies": {
"cordova-common": "^2.0.1",
"elementtree": "0.1.6",
"cordova-common": "^1.5.0",
"elementtree": "^0.1.6",
"nopt": "^3.0.1",
"properties-parser": "^0.2.3",
"q": "^1.4.1",
@@ -41,7 +41,7 @@
],
"devDependencies": {
"istanbul": "^0.4.2",
"jasmine": "^2.5.2",
"jasmine-node": "^1.14.5",
"jshint": "^2.6.0",
"promise-matchers": "~0",
"rewire": "^2.1.3"

View File

@@ -35,42 +35,42 @@ function createAndBuild(projectname, projectid, done) {
describe('create', function() {
it('Test#001 : create project with ascii name, no spaces', function(done) {
it('create project with ascii name, no spaces', function(done) {
var projectname = 'testcreate';
var projectid = 'com.test.create.app1';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#002 : create project with ascii name, and spaces', function(done) {
it('create project with ascii name, and spaces', function(done) {
var projectname = 'test create';
var projectid = 'com.test.create.app2';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#003 : create project with unicode name, no spaces', function(done) {
it('create project with unicode name, no spaces', function(done) {
var projectname = '応応応応用用用用';
var projectid = 'com.test.create.app3';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#004 : create project with unicode name, and spaces', function(done) {
it('create project with unicode name, and spaces', function(done) {
var projectname = '応応応応 用用用用';
var projectid = 'com.test.create.app4';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#005 : create project with ascii+unicode name, no spaces', function(done) {
it('create project with ascii+unicode name, no spaces', function(done) {
var projectname = '応応応応hello用用用用';
var projectid = 'com.test.create.app5';
createAndBuild(projectname, projectid, done);
}, CREATE_TIMEOUT);
it('Test#006 : create project with ascii+unicode name, and spaces', function(done) {
it('create project with ascii+unicode name, and spaces', function(done) {
var projectname = '応応応応 hello 用用用用';
var projectid = 'com.test.create.app6';

View File

@@ -24,7 +24,7 @@ var PLUGIN_ADD_TIMEOUT = 90000;
describe('plugin add', function() {
it('Test#001 : create project and add a plugin with framework', function(done) {
it('create project and add a plugin with framework', function(done) {
var projectname = 'testpluginframework';
var projectid = 'com.test.plugin.framework';
var fakePluginPath = path.join(__dirname, 'fixtures/cordova-plugin-fake');

View File

@@ -56,7 +56,7 @@ function testUpdate(projectname, projectid, createfrom, updatefrom, doBuild, don
describe('preparing fixtures', function () {
it('Test#001 : cloning old platform', function (done) {
it('cloning old platform', function (done) {
var command = util.format('git clone %s --depth=1 --branch %s %s',
PLATFORM_GIT_URL, platformOld.version, platformOld.path);
shell.rm('-rf', platformOld.path);
@@ -70,7 +70,7 @@ describe('preparing fixtures', function () {
describe('update', function() {
it('Test#002 : should update major version and build the project', function(done) {
it('should update major version and build the project', function(done) {
var projectname = 'testupdate';
var projectid = 'com.test.update.app1';
@@ -78,11 +78,19 @@ describe('update', function() {
}, UPDATE_TIMEOUT);
it('should downgrade major version and build the project', function(done) {
var projectname = 'testupdate';
var projectid = 'com.test.update.app2';
testUpdate(projectname, projectid, platformEdge, platformOld, true, done);
}, UPDATE_TIMEOUT);
// TODO: After next Android release, add tests for minor/patch version update
});
describe('cleanup', function () {
it('Test#004 : remove cloned old platform', function() {
it('remove cloned old platform', function() {
shell.rm('-rf', platformOld.path);
});

View File

@@ -1,7 +0,0 @@
Available Android Virtual Devices:
Name: QWR
Device: Nexus 5 (Google)
Path: /Users/shazron/.android/avd/QWR.avd
Target: Android 7.1.1 (API level 25)
Tag/ABI: google_apis/x86_64
Skin: 1080x1920

View File

@@ -1,116 +0,0 @@
Available Android targets:
----------
id: 1 or "android-20"
Name: Android 4.4W.2
Type: Platform
API level: 20
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : no ABIs.
----------
id: 2 or "android-21"
Name: Android 5.0.1
Type: Platform
API level: 21
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86, default/x86_64
----------
id: 3 or "android-22"
Name: Android 5.1.1
Type: Platform
API level: 22
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86, default/x86_64
----------
id: 4 or "android-MNC"
Name: Android M (Preview)
Type: Platform
API level: MNC
Revision: 1
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : no ABIs.
----------
id: 5 or "android-23"
Name: Android 6.0
Type: Platform
API level: 23
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/x86, default/x86_64
----------
id: 6 or "android-N"
Name: Android N (Preview)
Type: Platform
API level: N
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : no ABIs.
----------
id: 7 or "android-24"
Name: Android 7.0
Type: Platform
API level: 24
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/x86, default/x86, default/x86_64
----------
id: 8 or "android-25"
Name: Android 7.1.1
Type: Platform
API level: 25
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/x86, google_apis/x86, google_apis/x86_64
----------
id: 9 or "Google Inc.:Google APIs:21"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 5.0.1 (API level 21)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64
----------
id: 10 or "Google Inc.:Google APIs:22"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 5.1.1 (API level 22)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64
----------
id: 11 or "Google Inc.:Google APIs:23"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 6.0 (API level 23)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64

View File

@@ -1,22 +0,0 @@
Available Android Virtual Devices:
Name: nexus5-5.1
Device: Nexus 5 (Google)
Path: /Users/maj/.android/avd/nexus5-5.1.avd
Target: Google APIs
Based on: Android 5.1 (Lollipop) Tag/ABI: google_apis/x86_64
Skin: 1080x1920
Sdcard: 128M
---------
Name: Pixel_API_25
Device: pixel (Google)
Path: /Users/maj/.android/avd/Pixel_API_25.avd
Target: Google APIs
Based on: Android 7.1.1 (Nougat) Tag/ABI: google_apis/x86_64
Skin: pixel
Sdcard: 100M
---------
Name: stock51
Path: /Users/maj/.android/avd/stock51.avd
Target: Default
Based on: Android 5.1 (Lollipop) Tag/ABI: default/x86_64
Sdcard: 128M

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
{
"spec_dir": "spec",
"spec_files": [
"unit/**/*[sS]pec.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@@ -23,7 +23,7 @@ var android_project = path.join(__dirname, '../fixtures/android_project');
describe('AndroidProject class', function() {
describe('getPackageName method', function() {
it('Test#001 : should return an android project\'s proper package name', function() {
it('should return an android project\'s proper package name', function() {
expect(AndroidProject.getProjectFile(android_project).getPackageName())
.toEqual('com.alunny.childapp');
});

View File

@@ -39,11 +39,11 @@ describe('addPlugin method', function () {
beforeEach(function() {
var pluginManager = jasmine.createSpyObj('pluginManager', ['addPlugin']);
pluginManager.addPlugin.and.returnValue(Q());
spyOn(common.PluginManager, 'get').and.returnValue(pluginManager);
pluginManager.addPlugin.andReturn(Q());
spyOn(common.PluginManager, 'get').andReturn(pluginManager);
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write', 'isClean']);
spyOn(AndroidProject, 'getProjectFile').and.returnValue(projectSpy);
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write']);
spyOn(AndroidProject, 'getProjectFile').andReturn(projectSpy);
oldClean = Api.__get__('Api.prototype.clean');
Api.__set__('Api.prototype.clean', Q);
@@ -51,14 +51,14 @@ describe('addPlugin method', function () {
fail = jasmine.createSpy('fail');
gradleBuilder = jasmine.createSpyObj('gradleBuilder', ['prepBuildFiles']);
spyOn(builders, 'getBuilder').and.returnValue(gradleBuilder);
spyOn(builders, 'getBuilder').andReturn(gradleBuilder);
});
afterEach(function () {
Api.__set__('Api.prototype.clean', oldClean);
});
it('Test#001 : should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
it('should call gradleBuilder.prepBuildFiles for every plugin with frameworks', function(done) {
api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake')))
.catch(fail)
.fin(function () {
@@ -68,7 +68,7 @@ describe('addPlugin method', function () {
});
});
it('Test#002 : shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
it('shouldn\'t trigger gradleBuilder.prepBuildFiles for plugins without android frameworks', function(done) {
api.addPlugin(new PluginInfo(path.join(FIXTURES, 'cordova-plugin-fake-ios-frameworks')))
.catch(fail)
.fin(function () {

View File

@@ -1,122 +0,0 @@
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
/* jshint laxcomma:true */
var android_sdk = require("../../bin/templates/cordova/lib/android_sdk");
var superspawn = require("cordova-common").superspawn;
var fs = require("fs");
var path = require("path");
var Q = require("q");
describe("android_sdk", function () {
describe("list_targets_with_android", function() {
it("should parse and return results from `android list targets` command", function(done) {
var deferred = Q.defer();
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "android_list_targets.txt"), "utf-8"));
return android_sdk.list_targets_with_android()
.then(function(list) {
[ "Google Inc.:Google APIs:23",
"Google Inc.:Google APIs:22",
"Google Inc.:Google APIs:21",
"android-25",
"android-24",
"android-N",
"android-23",
"android-MNC",
"android-22",
"android-21",
"android-20" ].forEach(function(target) {
expect(list).toContain(target);
});
}).fail(function(err) {
console.log(err);
expect(err).toBeUndefined();
}).fin(function() {
done();
});
});
});
describe("list_targets_with_sdkmanager", function() {
it("should parse and return results from `sdkmanager --list` command", function(done) {
var deferred = Q.defer();
spyOn(superspawn, "spawn").and.returnValue(deferred.promise);
deferred.resolve(fs.readFileSync(path.join("spec", "fixtures", "sdkmanager_list.txt"), "utf-8"));
return android_sdk.list_targets_with_sdkmanager()
.then(function(list) {
[ "Google Inc.:Google APIs:19",
"Google Inc.:Google APIs:21",
"Google Inc.:Google APIs:22",
"Google Inc.:Google APIs:23",
"Google Inc.:Google APIs:24",
"android-19",
"android-21",
"android-22",
"android-23",
"android-24",
"android-25" ].forEach(function(target) {
expect(list).toContain(target);
});
}).fail(function(err) {
console.log(err);
expect(err).toBeUndefined();
}).fin(function() {
done();
});
});
});
describe("list_targets", function() {
it("should parse Android SDK installed target information with `android` command first", function() {
var deferred = Q.defer();
var android_spy = spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
android_sdk.list_targets();
expect(android_spy).toHaveBeenCalled();
});
it("should parse Android SDK installed target information with `avdmanager` command if list_targets_with_android fails due to `android` command being obsolete", function(done) {
var deferred = Q.defer();
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
deferred.reject({
code: 1,
stdout: "The android command is no longer available."
});
var twoferred = Q.defer();
twoferred.resolve(["target1"]);
var sdkmanager_spy = spyOn(android_sdk, "list_targets_with_sdkmanager").and.returnValue(twoferred.promise);
return android_sdk.list_targets()
.then(function(targets) {
expect(sdkmanager_spy).toHaveBeenCalled();
expect(targets[0]).toEqual("target1");
done();
});
});
it("should throw an error if no Android targets were found.", function(done) {
var deferred = Q.defer();
spyOn(android_sdk, "list_targets_with_android").and.returnValue(deferred.promise);
deferred.resolve([]);
return android_sdk.list_targets()
.then(function(targets) {
done.fail();
}).catch(function(err) {
expect(err).toBeDefined();
expect(err.message).toContain("No android targets (SDKs) installed!");
done();
});
});
});
});

Some files were not shown because too many files have changed in this diff Show More