Update cordova build

Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
Chris Cromer 2019-03-09 14:12:15 -03:00
parent 27c42a55c8
commit a090519a7a
32 changed files with 1104 additions and 436 deletions

View File

@ -36,5 +36,6 @@
<allow-intent href="itms-apps:*" /> <allow-intent href="itms-apps:*" />
</platform> </platform>
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" /> <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<engine name="android" spec="^7.1.1" /> <engine name="android" spec="^7.1.4" />
<engine name="browser" spec="^5.0.4" />
</widget> </widget>

View File

@ -20,6 +20,29 @@
--> -->
## Release Notes for Cordova (Android) ## ## Release Notes for Cordova (Android) ##
### 7.1.4 (Nov 22, 2018)
* Update android-versions to `1.4.0`, with added support for Android Pie ([#573](https://github.com/apache/cordova-android/pull/573))
* Output current package name if package name can't be validated ([#567](https://github.com/apache/cordova-android/pull/567))
* Resolve issue with plugin `target-dir="*app*"` subdirs ([#572](https://github.com/apache/cordova-android/pull/572))
### 7.1.3 (Nov 19, 2018)
* [GH-495](https://github.com/apache/cordova-android/pull/495) Incorrect default sdk version issue fix
* [GH-496](https://github.com/apache/cordova-android/pull/496) update comments in `build.gradle`
* [GH-539](https://github.com/apache/cordova-android/pull/539) Fix dest overwrite, in case of of plugin `source-file` element with `target-dir` that does not need remapping
* [GH-540](https://github.com/apache/cordova-android/issues/540) support plugin `source-file` element with any app `target-dir` value
* [GH-547](https://github.com/apache/cordova-android/issues/547) Compatibility of old plugins with non-Java `source-file` entries (individual files)
* [GH-551](https://github.com/apache/cordova-android/pull/551) add missing cast for cdvMinSdkVersion to `build.gradle`
* [GH-552](https://github.com/apache/cordova-android/issues/552) check for `build-extras.gradle` in the parent app directory
### 7.1.2 (Nov 08, 2018)
* [CB-14127](https://issues.apache.org/jira/browse/CB-14127): Always put the Google repo above jcenter
* [CB-14165](https://issues.apache.org/jira/browse/CB-14165): Emulator: handle "device still connecting" error (#457)
* [CB-14125](https://issues.apache.org/jira/browse/CB-14125): Increase old plugin compatibility
* [CB-13830](https://issues.apache.org/jira/browse/CB-13830): Add handlers for plugins that use non-Java source files, such as Camera
* [CB-14038](https://issues.apache.org/jira/browse/CB-14038): fix false positive detecting project type
### 7.1.1 (Jul 11, 2018) ### 7.1.1 (Jul 11, 2018)
* Fix unsafe property access in run.js (#445) * Fix unsafe property access in run.js (#445)
* Emit log event instead of logging directly (#452) * Emit log event instead of logging directly (#452)

View File

@ -1 +1 @@
7.1.1 7.1.4

View File

@ -194,7 +194,7 @@ function validatePackageName (package_name) {
var msg = 'Error validating package name. '; var msg = 'Error validating package name. ';
if (!/^[a-zA-Z][a-zA-Z0-9_]+(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(package_name)) { if (!/^[a-zA-Z][a-zA-Z0-9_]+(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(package_name)) {
return Q.reject(new CordovaError(msg + 'Package name must look like: com.company.Name')); return Q.reject(new CordovaError(msg + 'Must look like: `com.company.Name`. Currently is: `' + package_name + '`'));
} }
// Class is a reserved word // Class is a reserved word

View File

@ -248,7 +248,7 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
}).then(function () { }).then(function () {
if (plugin.getFrameworks(this.platform).length === 0) return; if (plugin.getFrameworks(this.platform).length === 0) return;
selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>'); selfEvents.emit('verbose', 'Updating build files since android plugin contained <framework>');
// This should pick the correct builder, not just get gradle // This should pick the correct builder, not just get gradle
require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles(); require('./lib/builders/builders').getBuilder(this.builder).prepBuildFiles();
}.bind(this)) }.bind(this))
// CB-11022 Return truthy value to prevent running prepare after // CB-11022 Return truthy value to prevent running prepare after

View File

@ -6,37 +6,6 @@
/* jshint esnext: false */ /* jshint esnext: false */
var path = require('path');
var fs = require('fs');
var CordovaError = require('cordova-common').CordovaError;
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) { module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res']; return true;
var androidStudioFiles = ['app', 'app/src/main'];
// assume it is an AS project and not an Eclipse project
var isEclipse = false;
var isAS = true;
if (!fs.existsSync(root)) {
throw new CordovaError('AndroidStudio.js:inAndroidStudioProject root does not exist: ' + root);
}
// if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function (file) {
if (fs.existsSync(path.join(root, file))) {
isEclipse = true;
}
});
// if it is NOT an eclipse project, check that all required files exist
if (!isEclipse) {
androidStudioFiles.forEach(function (file) {
if (!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false;
}
});
}
return (!isEclipse && isAS);
}; };

View File

@ -215,28 +215,28 @@ StudioBuilder.prototype.prepBuildFiles = function () {
StudioBuilder.prototype.prepEnv = function (opts) { StudioBuilder.prototype.prepEnv = function (opts) {
var self = this; var self = this;
return check_reqs.check_gradle() return check_reqs.check_gradle()
.then(function (gradlePath) { .then(function (gradlePath) {
return self.runGradleWrapper(gradlePath); return self.runGradleWrapper(gradlePath);
}).then(function () { }).then(function () {
return self.prepBuildFiles(); return self.prepBuildFiles();
}).then(function () { }).then(function () {
// If the gradle distribution URL is set, make sure it points to version we want. // 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. // 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. // For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/; var distributionUrlRegex = /distributionUrl.*zip/;
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip'; var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip';
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties'); var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath); shell.chmod('u+w', gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath); shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);
var propertiesFile = opts.buildType + SIGNING_PROPERTIES; var propertiesFile = opts.buildType + SIGNING_PROPERTIES;
var propertiesFilePath = path.join(self.root, propertiesFile); var propertiesFilePath = path.join(self.root, propertiesFile);
if (opts.packageInfo) { if (opts.packageInfo) {
fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties()); fs.writeFileSync(propertiesFilePath, TEMPLATE + opts.packageInfo.toProperties());
} else if (isAutoGenerated(propertiesFilePath)) { } else if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath); shell.rm('-f', propertiesFilePath);
} }
}); });
}; };
/* /*
@ -248,33 +248,33 @@ StudioBuilder.prototype.build = function (opts) {
var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts); var args = this.getArgs(opts.buildType === 'debug' ? 'debug' : 'release', opts);
return spawn(wrapper, args, {stdio: 'pipe'}) return spawn(wrapper, args, {stdio: 'pipe'})
.progress(function (stdio) { .progress(function (stdio) {
if (stdio.stderr) { if (stdio.stderr) {
/* /*
* Workaround for the issue with Java printing some unwanted information to * Workaround for the issue with Java printing some unwanted information to
* stderr instead of stdout. * stderr instead of stdout.
* This function suppresses 'Picked up _JAVA_OPTIONS' message from being * This function suppresses 'Picked up _JAVA_OPTIONS' message from being
* printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for * printed to stderr. See https://issues.apache.org/jira/browse/CB-9971 for
* explanation. * explanation.
*/ */
var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString()); var suppressThisLine = /^Picked up _JAVA_OPTIONS: /i.test(stdio.stderr.toString());
if (suppressThisLine) { if (suppressThisLine) {
return; return;
}
process.stderr.write(stdio.stderr);
} else {
process.stdout.write(stdio.stdout);
} }
process.stderr.write(stdio.stderr); }).catch(function (error) {
} else { if (error.toString().indexOf('failed to find target with hash string') >= 0) {
process.stdout.write(stdio.stdout); return check_reqs.check_android_target(error).then(function () {
} // If due to some odd reason - check_android_target succeeds
}).catch(function (error) { // we should still fail here.
if (error.toString().indexOf('failed to find target with hash string') >= 0) { return Q.reject(error);
return check_reqs.check_android_target(error).then(function () { });
// If due to some odd reason - check_android_target succeeds }
// we should still fail here. return Q.reject(error);
return Q.reject(error); });
});
}
return Q.reject(error);
});
}; };
StudioBuilder.prototype.clean = function (opts) { StudioBuilder.prototype.clean = function (opts) {
@ -284,16 +284,16 @@ StudioBuilder.prototype.clean = function (opts) {
return Q().then(function () { return Q().then(function () {
return spawn(wrapper, args, {stdio: 'inherit'}); return spawn(wrapper, args, {stdio: 'inherit'});
}) })
.then(function () { .then(function () {
shell.rm('-rf', path.join(builder.root, 'out')); shell.rm('-rf', path.join(builder.root, 'out'));
['debug', 'release'].forEach(function (config) { ['debug', 'release'].forEach(function (config) {
var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES); var propertiesFilePath = path.join(builder.root, config + SIGNING_PROPERTIES);
if (isAutoGenerated(propertiesFilePath)) { if (isAutoGenerated(propertiesFilePath)) {
shell.rm('-f', propertiesFilePath); shell.rm('-f', propertiesFilePath);
} }
});
}); });
});
}; };
module.exports = StudioBuilder; module.exports = StudioBuilder;

View File

@ -344,7 +344,8 @@ module.exports.wait_for_emulator = function (port) {
}, function (error) { }, function (error) {
if ((error && error.message && if ((error && error.message &&
(error.message.indexOf('not found') > -1)) || (error.message.indexOf('not found') > -1)) ||
(error.message.indexOf('device offline') > -1)) { (error.message.indexOf('device offline') > -1) ||
(error.message.indexOf('device still connecting') > -1)) {
// emulator not yet started, continue waiting // emulator not yet started, continue waiting
return self.wait_for_emulator(port); return self.wait_for_emulator(port);
} else { } else {

View File

@ -34,15 +34,7 @@ var handlers = {
// a later plugins release. This is for legacy plugins to work with Cordova. // a later plugins release. This is for legacy plugins to work with Cordova.
if (options && options.android_studio === true) { if (options && options.android_studio === true) {
// If a Java file is using the new directory structure, don't penalize it dest = getInstallDestination(obj);
if (!obj.targetDir.includes('app/src/main')) {
if (obj.src.endsWith('.java')) {
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.src.endsWith('.xml')) {
// We are making a huge assumption here that XML files will be going to res/xml or values/xml
dest = path.join('app/src/main', obj.targetDir, path.basename(obj.src));
}
}
} }
if (options && options.force) { if (options && options.force) {
@ -55,10 +47,16 @@ var handlers = {
var dest = path.join(obj.targetDir, path.basename(obj.src)); var dest = path.join(obj.targetDir, path.basename(obj.src));
if (options && options.android_studio === true) { if (options && options.android_studio === true) {
dest = path.join('app/src/main/java', obj.targetDir.substring(4), path.basename(obj.src)); dest = getInstallDestination(obj);
} }
deleteJava(project.projectDir, dest); // TODO: Add Koltin extension to uninstall, since they are handled like Java files
if (obj.src.endsWith('java')) {
deleteJava(project.projectDir, dest);
} else {
// Just remove the file, not the whole parent directory
removeFile(project.projectDir, dest);
}
} }
}, },
'lib-file': { 'lib-file': {
@ -318,3 +316,30 @@ function removeFileAndParents (baseDir, destFile, stopper) {
function generateAttributeError (attribute, element, id) { function generateAttributeError (attribute, element, id) {
return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id; return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
} }
function getInstallDestination (obj) {
var APP_MAIN_PREFIX = 'app/src/main';
if (obj.targetDir.startsWith('app')) {
// If any source file is using the new app directory structure,
// don't penalize it
return path.join(obj.targetDir, path.basename(obj.src));
} else if (obj.src.endsWith('.java')) {
return path.join(APP_MAIN_PREFIX, 'java', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.src.endsWith('.aidl')) {
return path.join(APP_MAIN_PREFIX, 'aidl', obj.targetDir.substring(4), path.basename(obj.src));
} else if (obj.targetDir.includes('libs')) {
if (obj.src.endsWith('.so')) {
return path.join(APP_MAIN_PREFIX, 'jniLibs', obj.targetDir.substring(5), path.basename(obj.src));
} else {
return path.join('app', obj.targetDir, path.basename(obj.src));
}
} else if (obj.targetDir.includes('src/main')) {
return path.join('app', obj.targetDir, path.basename(obj.src));
} else {
// For all other source files not using the new app directory structure,
// add 'app/src/main' to the targetDir
return path.join(APP_MAIN_PREFIX, obj.targetDir, path.basename(obj.src));
}
}

View File

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

View File

@ -69,7 +69,7 @@ ext {
if (!project.hasProperty('cdvBuildMultipleApks')) { if (!project.hasProperty('cdvBuildMultipleApks')) {
cdvBuildMultipleApks = null cdvBuildMultipleApks = null
} }
// Whether to append a 0 "abi digit" to versionCode when only a single APK is build // Whether to append a 0 "abi digit" to versionCode when only a single APK is build
if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) { if (!project.hasProperty('cdvVersionCodeForceAbiDigit')) {
cdvVersionCodeForceAbiDigit = null cdvVersionCodeForceAbiDigit = null
} }
@ -93,11 +93,16 @@ ext {
// PLUGIN GRADLE EXTENSIONS START // PLUGIN GRADLE EXTENSIONS START
// PLUGIN GRADLE EXTENSIONS END // PLUGIN GRADLE EXTENSIONS END
def hasBuildExtras = file('build-extras.gradle').exists() def hasBuildExtras1 = file('build-extras.gradle').exists()
if (hasBuildExtras) { if (hasBuildExtras1) {
apply from: 'build-extras.gradle' apply from: 'build-extras.gradle'
} }
def hasBuildExtras2 = file('../build-extras.gradle').exists()
if (hasBuildExtras2) {
apply from: '../build-extras.gradle'
}
// Set property defaults after extension .gradle files. // Set property defaults after extension .gradle files.
if (ext.cdvCompileSdkVersion == null) { if (ext.cdvCompileSdkVersion == null) {
ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget() ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget()
@ -117,7 +122,7 @@ if (ext.cdvReleaseSigningPropertiesFile == null && file('../release-signing.prop
// Cast to appropriate types. // Cast to appropriate types.
ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean(); ext.cdvBuildMultipleApks = cdvBuildMultipleApks == null ? false : cdvBuildMultipleApks.toBoolean();
ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean(); ext.cdvVersionCodeForceAbiDigit = cdvVersionCodeForceAbiDigit == null ? false : cdvVersionCodeForceAbiDigit.toBoolean();
ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? null : defaultMinSdkVersion ext.cdvMinSdkVersion = cdvMinSdkVersion == null ? defaultMinSdkVersion : Integer.parseInt('' + cdvMinSdkVersion)
ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode) ext.cdvVersionCode = cdvVersionCode == null ? null : Integer.parseInt('' + cdvVersionCode)
def computeBuildTargetName(debugBuild) { def computeBuildTargetName(debugBuild) {
@ -174,10 +179,11 @@ android {
compileSdkVersion cdvCompileSdkVersion compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion buildToolsVersion cdvBuildToolsVersion
//This code exists for Crosswalk and other Native APIs. // This code exists for Crosswalk and other Native APIs.
//By default, we multiply the existing version code in the Android Manifest by 10 and // By default, we multiply the existing version code in the
//add a number for each architecture. If you are not using Crosswalk or SQLite, you can // Android Manifest by 10 and add a number for each architecture.
//ignore this chunk of code, and your version codes will be respected. // If you are not using Crosswalk or SQLite, you can
// ignore this chunk of code, and your version codes will be respected.
if (Boolean.valueOf(cdvBuildMultipleApks)) { if (Boolean.valueOf(cdvBuildMultipleApks)) {
flavorDimensions "default" flavorDimensions "default"

View File

@ -19,7 +19,7 @@
under the License. under the License.
*/ */
;(function() { ;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '7.1.1'; var PLATFORM_VERSION_BUILD_LABEL = '7.1.4';
// file: src/scripts/require.js // file: src/scripts/require.js
/* jshint -W079 */ /* jshint -W079 */
@ -2186,4 +2186,4 @@ window.cordova = require('cordova');
require('cordova/init'); require('cordova/init');
})(); })();

View File

@ -109,17 +109,6 @@ function androidExec(success, fail, service, action, args) {
} }
androidExec.init = function() { androidExec.init = function() {
//CB-11828
//This failsafe checks the version of Android and if it's Jellybean, it switches it to
//using the Online Event bridge for communicating from Native to JS
//
//It's ugly, but it's necessary.
var check = navigator.userAgent.toLowerCase().match(/android\s[0-9].[0-9]/);
var version_code = check && check[0].match(/4.[0-3].*/);
if (version_code != null && nativeToJsBridgeMode == nativeToJsModes.EVAL_BRIDGE) {
nativeToJsBridgeMode = nativeToJsModes.ONLINE_EVENT;
}
bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode);
channel.onNativeReady.fire(); channel.onNativeReady.fire();
}; };

View File

@ -24,10 +24,10 @@ ext {
buildscript { buildscript {
repositories { repositories {
jcenter()
maven { maven {
url "https://maven.google.com" url "https://maven.google.com"
} }
jcenter()
} }
dependencies { dependencies {
@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray' apply plugin: 'com.jfrog.bintray'
group = 'org.apache.cordova' group = 'org.apache.cordova'
version = '7.1.1' version = '7.1.4'
android { android {
compileSdkVersion cdvCompileSdkVersion compileSdkVersion cdvCompileSdkVersion
@ -129,9 +129,9 @@ bintray {
licenses = ['Apache-2.0'] licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap'] labels = ['android', 'cordova', 'phonegap']
version { version {
name = '7.1.1' name = '7.1.4'
released = new Date() released = new Date()
vcsTag = '7.1.1' vcsTag = '7.1.4'
} }
} }
} }

View File

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

View File

@ -1,4 +1,5 @@
{ {
"esversion": 6,
"indent": 2, "indent": 2,
"forin": true, "forin": true,
"noarg": true, "noarg": true,

View File

@ -30,35 +30,42 @@
*/ */
var VERSIONS = { var VERSIONS = {
BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", versionCode: "BASE" }, BASE: { api: 1, ndk: 0, semver: "1.0", name: "(no code name)", },
BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", versionCode: "BASE_1_1" }, BASE_1_1: { api: 2, ndk: 0, semver: "1.1", name: "(no code name)", },
CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", versionCode: "CUPCAKE" }, CUPCAKE: { api: 3, ndk: 1, semver: "1.5", name: "Cupcake", },
DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", versionCode: "DONUT" }, DONUT: { api: 4, ndk: 2, semver: "1.6", name: "Donut", },
ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", versionCode: "ECLAIR" }, ECLAIR: { api: 5, ndk: 2, semver: "2.0", name: "Eclair", },
ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", versionCode: "ECLAIR_0_1" }, ECLAIR_0_1: { api: 6, ndk: 2, semver: "2.0.1", name: "Eclair", },
ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", versionCode: "ECLAIR_MR1" }, ECLAIR_MR1: { api: 7, ndk: 3, semver: "2.1", name: "Eclair", },
FROYO: { api: 8, ndk: 4, semver: "2.2.x", name: "Froyo", versionCode: "FROYO" }, FROYO: { api: 8, ndk: 4, semver: "2.2.x", name: "Froyo", },
GINGERBREAD: { api: 9, ndk: 5, semver: "2.3.0 - 2.3.2", name: "Gingerbread", versionCode: "GINGERBREAD" }, GINGERBREAD: { api: 9, ndk: 5, semver: "2.3.0 - 2.3.2", name: "Gingerbread", },
GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3 - 2.3.7", name: "Gingerbread", versionCode: "GINGERBREAD_MR1" }, GINGERBREAD_MR1: { api: 10, ndk: 5, semver: "2.3.3 - 2.3.7", name: "Gingerbread", },
HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", versionCode: "HONEYCOMB" }, HONEYCOMB: { api: 11, ndk: 5, semver: "3.0", name: "Honeycomb", },
HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", versionCode: "HONEYCOMB_MR1" }, HONEYCOMB_MR1: { api: 12, ndk: 6, semver: "3.1", name: "Honeycomb", },
HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2.x", name: "Honeycomb", versionCode: "HONEYCOMB_MR2" }, HONEYCOMB_MR2: { api: 13, ndk: 6, semver: "3.2.x", name: "Honeycomb", },
ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0.1 - 4.0.2", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH" }, ICE_CREAM_SANDWICH: { api: 14, ndk: 7, semver: "4.0.1 - 4.0.2", name: "Ice Cream Sandwich", },
ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3 - 4.0.4", name: "Ice Cream Sandwich", versionCode: "ICE_CREAM_SANDWICH_MR1" }, ICE_CREAM_SANDWICH_MR1: { api: 15, ndk: 8, semver: "4.0.3 - 4.0.4", name: "Ice Cream Sandwich", },
JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1.x", name: "Jellybean", versionCode: "JELLY_BEAN" }, JELLY_BEAN: { api: 16, ndk: 8, semver: "4.1.x", name: "Jellybean", },
JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2.x", name: "Jellybean", versionCode: "JELLY_BEAN_MR1" }, JELLY_BEAN_MR1: { api: 17, ndk: 8, semver: "4.2.x", name: "Jellybean", },
JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3.x", name: "Jellybean", versionCode: "JELLY_BEAN_MR2" }, JELLY_BEAN_MR2: { api: 18, ndk: 8, semver: "4.3.x", name: "Jellybean", },
KITKAT: { api: 19, ndk: 8, semver: "4.4.0 - 4.4.4", name: "KitKat", versionCode: "KITKAT" }, KITKAT: { api: 19, ndk: 8, semver: "4.4.0 - 4.4.4", name: "KitKat", },
KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", versionCode: "KITKAT_WATCH" }, KITKAT_WATCH: { api: 20, ndk: 8, semver: "4.4", name: "KitKat Watch", },
LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" }, LOLLIPOP: { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", },
LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", versionCode: "LOLLIPOP_MR1" }, LOLLIPOP_MR1: { api: 22, ndk: 8, semver: "5.1", name: "Lollipop", },
M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", versionCode: "M" }, M: { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", },
N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", versionCode: "N" }, N: { api: 24, ndk: 8, semver: "7.0", name: "Nougat", },
N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", versionCode: "N_MR1" }, N_MR1: { api: 25, ndk: 8, semver: "7.1", name: "Nougat", },
O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", versionCode: "O" }, O: { api: 26, ndk: 8, semver: "8.0.0", name: "Oreo", },
O_MR1: { api: 27, ndk: 8, semver: "8.1.0", name: "Oreo", versionCode: "O_MR1" } O_MR1: { api: 27, ndk: 8, semver: "8.1.0", name: "Oreo", },
P: { api: 28, ndk: 8, semver: "9", name: "Pie", }
} }
// Add a key to each version of Android for the "versionCode".
// This is the same key we use in the VERSIONS map above.
Object.keys(VERSIONS).forEach(function(version) {
VERSIONS[version].versionCode = version
})
var semver = require('semver'); var semver = require('semver');
// semver format requires <major>.<minor>.<patch> but we allow just <major>.<minor> format. // semver format requires <major>.<minor>.<patch> but we allow just <major>.<minor> format.
@ -82,8 +89,8 @@ function getFromDefaultPredicate(arg) {
return true return true
} }
let argSemver = formatSemver(arg); var argSemver = formatSemver(arg)
let versionSemver = formatSemver(version.semver); var versionSemver = formatSemver(version.semver)
if (semver.valid(argSemver) && semver.satisfies(argSemver, versionSemver)) { if (semver.valid(argSemver) && semver.satisfies(argSemver, versionSemver)) {
return true return true

View File

@ -1,26 +1,26 @@
{ {
"_from": "android-versions@1.3.0", "_from": "android-versions@1",
"_id": "android-versions@1.3.0", "_id": "android-versions@1.4.0",
"_inBundle": true, "_inBundle": true,
"_integrity": "sha512-d/i1G16Oaw/T1EvskUA7Oo1vIQVK/0ZlpQgZfYVBwg6v/9FBE3QV66g5N1/bTHpRml8tFLxh+KoTw5DokK9c+A==", "_integrity": "sha512-GnomfYsBq+nZh3c3UH/4r9Jt6FuTxdhUJbeHIdYOH5xBhQ8I0ZzC2/RM5IFFIjrzuNWSHb8JWP1lPK0/a26jrg==",
"_location": "/cordova-android/android-versions", "_location": "/cordova-android/android-versions",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "version", "type": "range",
"registry": true, "registry": true,
"raw": "android-versions@1.3.0", "raw": "android-versions@1",
"name": "android-versions", "name": "android-versions",
"escapedName": "android-versions", "escapedName": "android-versions",
"rawSpec": "1.3.0", "rawSpec": "1",
"saveSpec": null, "saveSpec": null,
"fetchSpec": "1.3.0" "fetchSpec": "1"
}, },
"_requiredBy": [ "_requiredBy": [
"/cordova-android" "/cordova-android"
], ],
"_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.3.0.tgz", "_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.4.0.tgz",
"_shasum": "ce6f3eae2e165ce4ed49b89beb68014741093044", "_shasum": "807ea2941d7e5780e6dd61c5d9b7b6f3c0706e09",
"_spec": "android-versions@1.3.0", "_spec": "android-versions@1",
"_where": "/Users/brodybits/Documents/cordova/cordova-android", "_where": "/Users/brodybits/Documents/cordova/cordova-android",
"author": { "author": {
"name": "dvoiss" "name": "dvoiss"
@ -63,5 +63,5 @@
"jshint": "jshint .", "jshint": "jshint .",
"test": "tape tests/**/*.js" "test": "tape tests/**/*.js"
}, },
"version": "1.3.0" "version": "1.4.0"
} }

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
var test = require('tape') const test = require('tape')
var android = require('..') const android = require('..')
test('get specific version by API level', (t) => { test('get specific version by API level', (t) => {
t.plan(1) t.plan(1)
@ -16,7 +16,7 @@ test('getAll versions by API level', (t) => {
test('get specific version by predicate', (t) => { test('get specific version by predicate', (t) => {
t.plan(2) t.plan(2)
var actual = android.get((version) => { let actual = android.get((version) => {
return version.name.indexOf("on") !== -1 return version.name.indexOf("on") !== -1
}) })
t.equal(actual.name, "Donut") t.equal(actual.name, "Donut")
@ -30,7 +30,7 @@ test('get specific version by predicate', (t) => {
test('getAll versions by predicate', (t) => { test('getAll versions by predicate', (t) => {
t.plan(3) t.plan(3)
var actual = android.getAll((version) => { let actual = android.getAll((version) => {
return version.name.indexOf("on") !== -1 return version.name.indexOf("on") !== -1
}).map((version) => version.name) }).map((version) => version.name)
t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"]) t.deepEqual(actual, ["Donut", "Honeycomb", "Honeycomb", "Honeycomb"])
@ -43,7 +43,7 @@ test('getAll versions by predicate', (t) => {
actual = android.getAll((version) => { actual = android.getAll((version) => {
return version.api > 22 return version.api > 22
}).map((version) => version.versionCode) }).map((version) => version.versionCode)
t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1"]) t.deepEqual(actual, ["M", "N", "N_MR1", "O", "O_MR1", "P"])
}) })
test('get version by semantic version', (t) => { test('get version by semantic version', (t) => {
@ -54,32 +54,31 @@ test('get version by semantic version', (t) => {
t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode) t.equal(android.get("2.3.3").versionCode, android.GINGERBREAD_MR1.versionCode)
}) })
test('support major version only', (t) => {
t.plan(2)
t.equal(android.get("9.0").versionCode, android.P.versionCode)
t.equal(android.get("9.0.0").versionCode, android.P.versionCode)
})
test('support version ranges', (t) => { test('support version ranges', (t) => {
t.plan(7); t.plan(7)
t.equal(android.get("4.4").versionCode, android.KITKAT.versionCode); let tests = [ "4.4", "4.4.0", "4.4.1", "4.4.2", "4.4.3", "4.4.4" ]
t.equal(android.get("4.4.0").versionCode, android.KITKAT.versionCode); tests.forEach((versionCode) => {
t.equal(android.get("4.4.1").versionCode, android.KITKAT.versionCode); t.equal(android.get(versionCode).versionCode, android.KITKAT.versionCode)
t.equal(android.get("4.4.2").versionCode, android.KITKAT.versionCode); })
t.equal(android.get("4.4.3").versionCode, android.KITKAT.versionCode); t.equal(android.get("4.4.5"), null)
t.equal(android.get("4.4.4").versionCode, android.KITKAT.versionCode);
t.equal(android.get("4.4.5"), null);
}) })
test('support x-ranges', (t) => { test('support x-ranges', (t) => {
t.plan(12); t.plan(12)
t.equal(android.get("4.1").versionCode, android.JELLY_BEAN.versionCode); let tests = [
t.equal(android.get("4.1.0").versionCode, android.JELLY_BEAN.versionCode); "4.1", "4.1.0", "4.1.1", "4.1.2", "4.1.3", "4.1.4",
t.equal(android.get("4.1.1").versionCode, android.JELLY_BEAN.versionCode); "4.1.5", "4.1.6", "4.1.7", "4.1.8", "4.1.9", "4.1.10"
t.equal(android.get("4.1.2").versionCode, android.JELLY_BEAN.versionCode); ]
t.equal(android.get("4.1.3").versionCode, android.JELLY_BEAN.versionCode); tests.forEach((versionCode) => {
t.equal(android.get("4.1.4").versionCode, android.JELLY_BEAN.versionCode); t.equal(android.get(versionCode).versionCode, android.JELLY_BEAN.versionCode)
t.equal(android.get("4.1.5").versionCode, android.JELLY_BEAN.versionCode); })
t.equal(android.get("4.1.6").versionCode, android.JELLY_BEAN.versionCode); })
t.equal(android.get("4.1.7").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.8").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.9").versionCode, android.JELLY_BEAN.versionCode);
t.equal(android.get("4.1.10").versionCode, android.JELLY_BEAN.versionCode);
});
test('access version codes object', (t) => { test('access version codes object', (t) => {
t.plan(1) t.plan(1)
@ -87,7 +86,7 @@ test('access version codes object', (t) => {
}) })
test('access specific versions directly', (t) => { test('access specific versions directly', (t) => {
t.plan(27) t.plan(28)
t.ok(android.BASE) t.ok(android.BASE)
t.ok(android.BASE_1_1) t.ok(android.BASE_1_1)
t.ok(android.CUPCAKE) t.ok(android.CUPCAKE)
@ -115,4 +114,5 @@ test('access specific versions directly', (t) => {
t.ok(android.N_MR1) t.ok(android.N_MR1)
t.ok(android.O) t.ok(android.O)
t.ok(android.O_MR1) t.ok(android.O_MR1)
t.ok(android.P)
}) })

View File

@ -1,27 +1,27 @@
{ {
"_from": "cordova-android@^7.1.1", "_from": "cordova-android@^7.1.4",
"_id": "cordova-android@7.1.1", "_id": "cordova-android@7.1.4",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-MAOwEMT3TuGjKw4McNzzYyHmxkWY3ozafbIgdMAvPzqSBVGIcn+H3SmWfaHtUXfmIPFliT171ICsSm6W5lZXEA==", "_integrity": "sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g==",
"_location": "/cordova-android", "_location": "/cordova-android",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "range", "type": "range",
"registry": true, "registry": true,
"raw": "cordova-android@^7.1.1", "raw": "cordova-android@^7.1.4",
"name": "cordova-android", "name": "cordova-android",
"escapedName": "cordova-android", "escapedName": "cordova-android",
"rawSpec": "^7.1.1", "rawSpec": "^7.1.4",
"saveSpec": null, "saveSpec": null,
"fetchSpec": "^7.1.1" "fetchSpec": "^7.1.4"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER", "#USER",
"/" "/"
], ],
"_resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.1.tgz", "_resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.4.tgz",
"_shasum": "711559ee18f5f625a2348d4ce348930d14890e2d", "_shasum": "25261ad66cc64f42a30b70be005901fa30e2430e",
"_spec": "cordova-android@^7.1.1", "_spec": "cordova-android@^7.1.4",
"_where": "/home/cromer/WebstormProjects/jvon-mobile", "_where": "/home/cromer/WebstormProjects/jvon-mobile",
"author": { "author": {
"name": "Apache Software Foundation" "name": "Apache Software Foundation"
@ -66,11 +66,11 @@
], ],
"dependencies": { "dependencies": {
"abbrev": "*", "abbrev": "*",
"android-versions": "1.3.0", "android-versions": "1.4.0",
"ansi": "*", "ansi": "*",
"balanced-match": "*", "balanced-match": "*",
"base64-js": "1.2.0", "base64-js": "1.2.0",
"big-integer": "*", "big-integer": "1.6.32",
"bplist-parser": "*", "bplist-parser": "*",
"brace-expansion": "*", "brace-expansion": "*",
"concat-map": "*", "concat-map": "*",
@ -83,12 +83,12 @@
"minimatch": "*", "minimatch": "*",
"nopt": "3.0.1", "nopt": "3.0.1",
"once": "*", "once": "*",
"path-is-absolute": "*", "path-is-absolute": "1.0.1",
"plist": "2.1.0", "plist": "2.1.0",
"properties-parser": "0.2.3", "properties-parser": "0.2.3",
"q": "1.4.1", "q": "1.4.1",
"sax": "0.3.5", "sax": "0.3.5",
"semver": "*", "semver": "5.5.0",
"shelljs": "0.5.3", "shelljs": "0.5.3",
"underscore": "*", "underscore": "*",
"unorm": "*", "unorm": "*",
@ -136,5 +136,5 @@
"test": "npm run eslint && npm run unit-tests && npm run java-unit-tests && npm run e2e-tests", "test": "npm run eslint && npm run unit-tests && npm run java-unit-tests && npm run e2e-tests",
"unit-tests": "jasmine --config=spec/unit/jasmine.json" "unit-tests": "jasmine --config=spec/unit/jasmine.json"
}, },
"version": "7.1.1" "version": "7.1.4"
} }

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
package="com.alunny.childapp" android:versionName="1.1" android:versionCode="5">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true">
<activity android:name="ChildApp" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.test.DroidGap" android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="5" />
</manifest>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<cordova>
<!--
access elements control the Android whitelist.
Domains are assumed blocked unless set otherwise
-->
<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
<!-- <access origin="https://example.com" /> allow any secure requests to example.com -->
<!-- <access origin="https://example.com" subdomains="true" /> such as above, but including subdomains, such as www -->
<!-- <access origin=".*"/> Allow all domains, suggested development use only -->
<log level="DEBUG"/>
<preference name="useBrowserHistory" value="false" />
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="org.apache.cordova.core.contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
</plugins>
</cordova>

View File

@ -2,6 +2,7 @@
buildscript { buildscript {
repositories { repositories {
google()
jcenter() jcenter()
} }
dependencies { dependencies {
@ -14,6 +15,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google()
jcenter() jcenter()
} }
} }

View File

@ -70,6 +70,20 @@
<source-file src="src/android/DummyPlugin.java" <source-file src="src/android/DummyPlugin.java"
target-dir="src/com/phonegap/plugins/dummyplugin" /> target-dir="src/com/phonegap/plugins/dummyplugin" />
<source-file src="src/android/DummyPlugin2.java"
target-dir="app/src/main/src/com/phonegap/plugins/dummyplugin" />
<source-file src="src/android/TestLib.jar"
target-dir="app/libs" />
<source-file src="src/android/TestAar.aar"
target-dir="app/libs" />
<source-file src="src/android/mysettings.xml" target-dir="res/xml" />
<source-file src="src/android/other.extension" target-dir="res/values" />
<source-file src="src/android/myapi.aidl" target-dir="src/com/mytest" />
<source-file src="src/android/testaar2.aar" target-dir="libs" />
<source-file src="src/android/testjar2.jar" target-dir="libs" />
<source-file src="src/android/jniLibs/x86/libnative.so" target-dir="libs/x86" />
<source-file src="src/android/DummyPlugin2.java"
target-dir="src/com/appco" />
<lib-file src="src/android/TestLib.jar" /> <lib-file src="src/android/TestLib.jar" />
</platform> </platform>
</plugin> </plugin>

View File

@ -1,31 +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 path = require('path');
var AndroidProject = require('../../bin/templates/cordova/lib/AndroidProject');
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 () {
expect(AndroidProject.getProjectFile(android_project).getPackageName())
.toEqual('com.alunny.childapp');
});
});
});

View File

@ -8,9 +8,4 @@ describe('AndroidStudio module', function () {
var isAndStud = AndroidStudio.isAndroidStudioProject(root); var isAndStud = AndroidStudio.isAndroidStudioProject(root);
expect(isAndStud).toBe(true); expect(isAndStud).toBe(true);
}); });
it('should return false non Android Studio project', function () {
var root = path.join(__dirname, '../fixtures/android_project/');
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
expect(isAndStud).toBe(false);
});
}); });

View File

@ -28,7 +28,7 @@ var temp = path.join(os.tmpdir(), 'plugman');
var plugins_dir = path.join(temp, 'cordova/plugins'); var plugins_dir = path.join(temp, 'cordova/plugins');
var dummyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.dummyplugin'); var dummyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.dummyplugin');
var faultyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.faultyplugin'); var faultyplugin = path.join(__dirname, '../../fixtures/org.test.plugins.faultyplugin');
var android_project = path.join(__dirname, '../../fixtures/android_project/*'); var android_studio_project = path.join(__dirname, '../../fixtures/android_studio_project/*');
var PluginInfo = require('cordova-common').PluginInfo; var PluginInfo = require('cordova-common').PluginInfo;
var AndroidProject = require('../../../bin/templates/cordova/lib/AndroidProject'); var AndroidProject = require('../../../bin/templates/cordova/lib/AndroidProject');
@ -60,48 +60,44 @@ describe('android project handler', function () {
}); });
describe('of <lib-file> elements', function () { describe('of <lib-file> elements', function () {
it('Test#001 : should copy files', function () { it('Test#001 : should copy files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('libs', 'TestLib.jar'), false);
});
it('Test#002 : should copy files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app', 'libs', 'TestLib.jar'), false); expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app', 'libs', 'TestLib.jar'), false);
}); });
}); });
describe('of <resource-file> elements', function () { describe('of <resource-file> elements', function () {
it('Test#003 : should copy files to the correct location on a non-Android Studio project', function () { it('Test#002 : should copy files to the correct location on an Android Studio project', function () {
android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject); android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'android-resource.xml', temp, path.join('res', 'xml', 'dummy.xml'), false); expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'android-resource.xml', temp, path.join('app', 'src', 'main', 'res', 'xml', 'dummy.xml'), false);
}); });
}); });
describe('of <source-file> elements', function () { describe('of <source-file> elements', function () {
beforeEach(function () { beforeEach(function () {
shell.cp('-rf', android_project, temp); shell.cp('-rf', android_studio_project, temp);
}); });
it('Test#004 : should copy stuff from one location to another by calling common.copyFile', function () { it('Test#003 : should copy stuff from one location to another by calling common.copyFile', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject); android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy) expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('src/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false); .toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('src/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false);
}); });
it('Test#005 : should install source files to the right location for Android Studio projects', function () { it('Test#004 : should install source files to the right location for Android Studio projects', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy) expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false); .toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin.java', temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'), false);
}); });
it('Test#006 : should throw if source file cannot be found', function () { it('Test#005 : should throw if source file cannot be found', function () {
common.__set__('copyFile', copyFileOrig); common.__set__('copyFile', copyFileOrig);
expect(function () { expect(function () {
android['source-file'].install(invalid_source[0], faultyPluginInfo, dummyProject); android['source-file'].install(invalid_source[0], faultyPluginInfo, dummyProject);
}).toThrow(new Error('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!')); }).toThrow(new Error('"' + path.resolve(faultyplugin, 'src/android/NotHere.java') + '" not found!'));
}); });
it('Test#007 : should throw if target file already exists', function () { it('Test#006 : should throw if target file already exists', function () {
// write out a file // write out a file
var target = path.resolve(temp, 'src/com/phonegap/plugins/dummyplugin'); var target = path.resolve(temp, 'src/com/phonegap/plugins/dummyplugin');
shell.mkdir('-p', target); shell.mkdir('-p', target);
@ -112,6 +108,73 @@ describe('android project handler', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject); android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
}).toThrow(new Error('"' + target + '" already exists!')); }).toThrow(new Error('"' + target + '" already exists!'));
}); });
// TODO: renumber these tests and other tests below
it('Test#00a6 : should allow installing sources with new app target-dir scheme', function () {
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'), false);
});
it('Test#006b : should allow installing jar lib file from sources with new app target-dir scheme', function () {
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestLib.jar', temp, path.join('app/libs/TestLib.jar'), false);
});
it('Test#006c : should allow installing aar lib file from sources with new app target-dir scheme', function () {
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/TestAar.aar', temp, path.join('app/libs/TestAar.aar'), false);
});
it('Test#006d : should allow installing xml file from sources with old target-dir scheme', function () {
android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/mysettings.xml', temp,
path.join('app/src/main/res/xml/mysettings.xml'), false);
});
it('Test#006e : should allow installing file with other extension from sources with old target-dir scheme', function () {
android['source-file'].install(valid_source[5], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/other.extension', temp,
path.join('app/src/main/res/values/other.extension'), false);
});
it('Test#006f : should allow installing aidl file from sources with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/myapi.aidl', temp,
path.join('app/src/main/aidl/com/mytest/myapi.aidl'), false);
});
it('Test#006g : should allow installing aar lib file from sources with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/testaar2.aar', temp,
path.join('app/libs/testaar2.aar'), false);
});
it('Test#006h : should allow installing jar lib file from sources with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/testjar2.jar', temp,
path.join('app/libs/testjar2.jar'), false);
});
it('Test#006i : should allow installing .so lib file from sources with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin,
'src/android/jniLibs/x86/libnative.so', temp,
path.join('app/src/main/jniLibs/x86/libnative.so'), false);
});
it('Test#006j : should allow installing sources with target-dir that includes "app"', function () {
android['source-file'].install(valid_source[10], dummyPluginInfo, dummyProject, {android_studio: true});
expect(copyFileSpy)
.toHaveBeenCalledWith(dummyplugin, 'src/android/DummyPlugin2.java', temp, path.join('app/src/main/java/com/appco/DummyPlugin2.java'), false);
});
}); });
describe('of <framework> elements', function () { describe('of <framework> elements', function () {
@ -122,7 +185,7 @@ describe('android project handler', function () {
var copyNewFileSpy = jasmine.createSpy('copyNewFile'); var copyNewFileSpy = jasmine.createSpy('copyNewFile');
beforeEach(function () { beforeEach(function () {
shell.cp('-rf', android_project, temp); shell.cp('-rf', android_studio_project, temp);
spyOn(dummyProject, 'addSystemLibrary'); spyOn(dummyProject, 'addSystemLibrary');
spyOn(dummyProject, 'addSubProject'); spyOn(dummyProject, 'addSubProject');
@ -134,23 +197,23 @@ describe('android project handler', function () {
common.__set__('copyNewFile', copyNewFileOrig); common.__set__('copyNewFile', copyNewFileOrig);
}); });
it('Test#008 : should throw if framework doesn\'t have "src" attribute', function () { it('Test#007 : should throw if framework doesn\'t have "src" attribute', function () {
expect(function () { android.framework.install({}, dummyPluginInfo, dummyProject); }).toThrow(); expect(function () { android.framework.install({}, dummyPluginInfo, dummyProject); }).toThrow();
}); });
it('Test#009 : should install framework without "parent" attribute into project root', function () { it('Test#008 : should install framework without "parent" attribute into project root', function () {
var framework = {src: 'plugin-lib'}; var framework = {src: 'plugin-lib'};
android.framework.install(framework, dummyPluginInfo, dummyProject); android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString);
}); });
it('Test#010 : should install framework with "parent" attribute into parent framework dir', function () { it('Test#009 : should install framework with "parent" attribute into parent framework dir', function () {
var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'}; var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'};
android.framework.install(childFramework, dummyPluginInfo, dummyProject); android.framework.install(childFramework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString); expect(dummyProject.addSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString);
}); });
it('Test#011 : should not copy anything if "custom" attribute is not set', function () { it('Test#010 : should not copy anything if "custom" attribute is not set', function () {
var framework = {src: 'plugin-lib'}; var framework = {src: 'plugin-lib'};
var cpSpy = spyOn(shell, 'cp'); var cpSpy = spyOn(shell, 'cp');
android.framework.install(framework, dummyPluginInfo, dummyProject); android.framework.install(framework, dummyPluginInfo, dummyProject);
@ -158,14 +221,14 @@ describe('android project handler', function () {
expect(cpSpy).not.toHaveBeenCalled(); expect(cpSpy).not.toHaveBeenCalled();
}); });
it('Test#012 : should copy framework sources if "custom" attribute is set', function () { it('Test#011 : should copy framework sources if "custom" attribute is set', function () {
var framework = {src: 'plugin-lib', custom: true}; var framework = {src: 'plugin-lib', custom: true};
android.framework.install(framework, dummyPluginInfo, dummyProject); android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.addSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(dummyProject.addSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString);
expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false); expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false);
}); });
it('Test#013 : should install gradleReference using project.addGradleReference', function () { it('Test#012 : should install gradleReference using project.addGradleReference', function () {
var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'}; var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'};
android.framework.install(framework, dummyPluginInfo, dummyProject); android.framework.install(framework, dummyPluginInfo, dummyProject);
expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false); expect(copyNewFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, framework.src, dummyProject.projectDir, someString, false);
@ -183,13 +246,13 @@ describe('android project handler', function () {
platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src); platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);
}); });
it('Test#014 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { it('Test#013 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android['js-module'].install(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true}); android['js-module'].install(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8'); expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8'); expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
}); });
it('Test#015 : should put module to www only when options.usePlatformWww flag is not specified', function () { it('Test#014 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android['js-module'].install(jsModule, dummyPluginInfo, dummyProject); android['js-module'].install(jsModule, dummyPluginInfo, dummyProject);
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8'); expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8'); expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
@ -206,13 +269,13 @@ describe('android project handler', function () {
platformWwwDest = path.resolve(dummyProject.platformWww, asset.target); platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);
}); });
it('Test#016 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () { it('Test#015 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
android.asset.install(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true}); android.asset.install(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target); expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target); expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
}); });
it('Test#017 : should put asset to www only when options.usePlatformWww flag is not specified', function () { it('Test#016 : should put asset to www only when options.usePlatformWww flag is not specified', function () {
android.asset.install(asset, dummyPluginInfo, dummyProject); android.asset.install(asset, dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target); expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).not.toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target); expect(copyFileSpy).not.toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
@ -232,7 +295,7 @@ describe('android project handler', function () {
beforeEach(function () { beforeEach(function () {
shell.mkdir('-p', temp); shell.mkdir('-p', temp);
shell.mkdir('-p', plugins_dir); shell.mkdir('-p', plugins_dir);
shell.cp('-rf', android_project, temp); shell.cp('-rf', android_studio_project, temp);
AndroidProject.purgeCache(); AndroidProject.purgeCache();
dummyProject = AndroidProject.getProjectFile(temp); dummyProject = AndroidProject.getProjectFile(temp);
common.__set__('removeFile', removeFileSpy); common.__set__('removeFile', removeFileSpy);
@ -246,12 +309,7 @@ describe('android project handler', function () {
}); });
describe('of <lib-file> elements', function () { describe('of <lib-file> elements', function () {
it('Test#018 : should remove jar files', function () { it('Test#017 : should remove jar files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject);
android['lib-file'].uninstall(valid_libs[0], dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('libs/TestLib.jar'));
});
it('Test#019 : should remove jar files for Android Studio projects', function () {
android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['lib-file'].install(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true});
android['lib-file'].uninstall(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['lib-file'].uninstall(valid_libs[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar')); expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar'));
@ -259,12 +317,7 @@ describe('android project handler', function () {
}); });
describe('of <resource-file> elements', function () { describe('of <resource-file> elements', function () {
it('Test#020 : should remove files', function () { it('Test#018 : should remove files for Android Studio projects', function () {
android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject);
android['resource-file'].uninstall(valid_resources[0], dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('res/xml/dummy.xml'));
});
it('Test#021 : should remove files for Android Studio projects', function () {
android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['resource-file'].install(valid_resources[0], dummyPluginInfo, dummyProject, {android_studio: true});
android['resource-file'].uninstall(valid_resources[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['resource-file'].uninstall(valid_resources[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/xml/dummy.xml')); expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/xml/dummy.xml'));
@ -272,16 +325,71 @@ describe('android project handler', function () {
}); });
describe('of <source-file> elements', function () { describe('of <source-file> elements', function () {
it('Test#022 : should remove stuff by calling common.deleteJava', function () { it('Test#019 : should remove stuff by calling common.deleteJava for Android Studio projects', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject);
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject);
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('src/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
});
it('Test#023 : should remove stuff by calling common.deleteJava for Android Studio projects', function () {
android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['source-file'].install(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true}); android['source-file'].uninstall(valid_source[0], dummyPluginInfo, dummyProject, {android_studio: true});
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java')); expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/phonegap/plugins/dummyplugin/DummyPlugin.java'));
}); });
it('Test#019a : should remove stuff by calling common.deleteJava for Android Studio projects, with specific app target-dir', function () {
android['source-file'].install(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[1], dummyPluginInfo, dummyProject, {android_studio: true});
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/src/com/phonegap/plugins/dummyplugin/DummyPlugin2.java'));
});
it('Test#019b : should remove stuff by calling common.removeFile for Android Studio projects, of jar with new app target-dir scheme', function () {
android['source-file'].install(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[2], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestLib.jar'));
});
it('Test#019c : should remove stuff by calling common.removeFile for Android Studio projects, of aar with new app target-dir scheme', function () {
android['source-file'].install(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[3], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/TestAar.aar'));
});
it('Test#019d : should remove stuff by calling common.removeFile for Android Studio projects, of xml with old target-dir scheme', function () {
android['source-file'].install(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[4], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/xml/mysettings.xml'));
});
it('Test#019e : should remove stuff by calling common.removeFile for Android Studio projects, of file with other extension with old target-dir scheme', function () {
android['source-file'].install(valid_source[5], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[5], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/res/values/other.extension'));
});
it('Test#019f : should remove stuff by calling common.removeFile for Android Studio projects, of aidl with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[6], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/aidl/com/mytest/myapi.aidl'));
});
it('Test#019g : should remove stuff by calling common.removeFile for Android Studio projects, of aar with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[7], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/testaar2.aar'));
});
it('Test#019h : should remove stuff by calling common.removeFile for Android Studio projects, of jar with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[8], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/libs/testjar2.jar'));
});
it('Test#019i : should remove stuff by calling common.removeFile for Android Studio projects, of .so lib file with old target-dir scheme (GH-547)', function () {
android['source-file'].install(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[9], dummyPluginInfo, dummyProject, {android_studio: true});
expect(removeFileSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/jniLibs/x86/libnative.so'));
});
it('Test#019j : should remove stuff by calling common.deleteJava for Android Studio projects, with target-dir that includes "app"', function () {
android['source-file'].install(valid_source[10], dummyPluginInfo, dummyProject, {android_studio: true});
android['source-file'].uninstall(valid_source[10], dummyPluginInfo, dummyProject, {android_studio: true});
expect(deleteJavaSpy).toHaveBeenCalledWith(temp, path.join('app/src/main/java/com/appco/DummyPlugin2.java'));
});
}); });
describe('of <framework> elements', function () { describe('of <framework> elements', function () {
@ -296,30 +404,30 @@ describe('android project handler', function () {
spyOn(dummyProject, 'removeGradleReference'); spyOn(dummyProject, 'removeGradleReference');
}); });
it('Test#024 : should throw if framework doesn\'t have "src" attribute', function () { it('Test#020 : should throw if framework doesn\'t have "src" attribute', function () {
expect(function () { android.framework.uninstall({}, dummyPluginInfo, dummyProject); }).toThrow(); expect(function () { android.framework.uninstall({}, dummyPluginInfo, dummyProject); }).toThrow();
}); });
it('Test#025 : should uninstall framework without "parent" attribute into project root', function () { it('Test#021 : should uninstall framework without "parent" attribute into project root', function () {
var framework = {src: 'plugin-lib'}; var framework = {src: 'plugin-lib'};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject); android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(dummyProject.projectDir, someString);
}); });
it('Test#026 : should uninstall framework with "parent" attribute into parent framework dir', function () { it('Test#022 : should uninstall framework with "parent" attribute into parent framework dir', function () {
var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'}; var childFramework = {src: 'plugin-lib2', parent: 'plugin-lib'};
android.framework.uninstall(childFramework, dummyPluginInfo, dummyProject); android.framework.uninstall(childFramework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString); expect(dummyProject.removeSystemLibrary).toHaveBeenCalledWith(path.resolve(dummyProject.projectDir, childFramework.parent), someString);
}); });
it('Test#027 : should remove framework sources if "custom" attribute is set', function () { it('Test#023 : should remove framework sources if "custom" attribute is set', function () {
var framework = {src: 'plugin-lib', custom: true}; var framework = {src: 'plugin-lib', custom: true};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject); android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(dummyProject.removeSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(dummyProject.removeSubProject).toHaveBeenCalledWith(dummyProject.projectDir, someString);
expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString);
}); });
it('Test#28 : should install gradleReference using project.removeGradleReference', function () { it('Test#24 : should install gradleReference using project.removeGradleReference', function () {
var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'}; var framework = {src: 'plugin-lib', custom: true, type: 'gradleReference'};
android.framework.uninstall(framework, dummyPluginInfo, dummyProject); android.framework.uninstall(framework, dummyPluginInfo, dummyProject);
expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString); expect(removeFileSpy).toHaveBeenCalledWith(dummyProject.projectDir, someString);
@ -345,13 +453,13 @@ describe('android project handler', function () {
}); });
}); });
it('Test#029 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { it('Test#025 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true}); android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest); expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest);
expect(shell.rm).toHaveBeenCalledWith('-Rf', platformWwwDest); expect(shell.rm).toHaveBeenCalledWith('-Rf', platformWwwDest);
}); });
it('Test#030 : should put module to www only when options.usePlatformWww flag is not specified', function () { it('Test#026 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject); android['js-module'].uninstall(jsModule, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest); expect(shell.rm).toHaveBeenCalledWith('-Rf', wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith('-Rf', platformWwwDest); expect(shell.rm).not.toHaveBeenCalledWith('-Rf', platformWwwDest);
@ -375,13 +483,13 @@ describe('android project handler', function () {
}); });
}); });
it('Test#031 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () { it('Test#027 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
android.asset.uninstall(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true}); android.asset.uninstall(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
}); });
it('Test#032 : should put module to www only when options.usePlatformWww flag is not specified', function () { it('Test#028 : should put module to www only when options.usePlatformWww flag is not specified', function () {
android.asset.uninstall(asset, dummyPluginInfo, dummyProject); android.asset.uninstall(asset, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest); expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest); expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);

676
package-lock.json generated
View File

@ -5,16 +5,16 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"cordova-android": { "cordova-android": {
"version": "7.1.1", "version": "7.1.4",
"resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.1.tgz", "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-7.1.4.tgz",
"integrity": "sha512-MAOwEMT3TuGjKw4McNzzYyHmxkWY3ozafbIgdMAvPzqSBVGIcn+H3SmWfaHtUXfmIPFliT171ICsSm6W5lZXEA==", "integrity": "sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g==",
"requires": { "requires": {
"abbrev": "*", "abbrev": "*",
"android-versions": "1.3.0", "android-versions": "1.4.0",
"ansi": "*", "ansi": "*",
"balanced-match": "*", "balanced-match": "*",
"base64-js": "1.2.0", "base64-js": "1.2.0",
"big-integer": "*", "big-integer": "1.6.32",
"bplist-parser": "*", "bplist-parser": "*",
"brace-expansion": "*", "brace-expansion": "*",
"concat-map": "*", "concat-map": "*",
@ -27,12 +27,12 @@
"minimatch": "*", "minimatch": "*",
"nopt": "3.0.1", "nopt": "3.0.1",
"once": "*", "once": "*",
"path-is-absolute": "*", "path-is-absolute": "1.0.1",
"plist": "2.1.0", "plist": "2.1.0",
"properties-parser": "0.2.3", "properties-parser": "0.2.3",
"q": "1.4.1", "q": "1.4.1",
"sax": "0.3.5", "sax": "0.3.5",
"semver": "*", "semver": "5.5.0",
"shelljs": "0.5.3", "shelljs": "0.5.3",
"underscore": "*", "underscore": "*",
"unorm": "*", "unorm": "*",
@ -46,7 +46,7 @@
"bundled": true "bundled": true
}, },
"android-versions": { "android-versions": {
"version": "1.3.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"requires": { "requires": {
"semver": "^5.4.1" "semver": "^5.4.1"
@ -214,6 +214,661 @@
} }
} }
}, },
"cordova-browser": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/cordova-browser/-/cordova-browser-5.0.4.tgz",
"integrity": "sha512-EDuG+9NGsaYpNSY6wF0kR34m1m38V+nRglGXxQ609fgMYrMHEYR2lg38nDr1Os4qeF0LJz8UQ7nq7Y+idg6Aig==",
"requires": {
"abbrev": "*",
"accepts": "*",
"ansi": "*",
"ansi-regex": "2.1.1",
"ansi-styles": "2.2.1",
"array-flatten": "1.1.1",
"balanced-match": "*",
"base64-js": "1.2.0",
"big-integer": "*",
"body-parser": "1.18.2",
"bplist-parser": "*",
"brace-expansion": "*",
"bytes": "*",
"chalk": "1.1.3",
"compressible": "*",
"compression": "1.7.2",
"concat-map": "*",
"content-disposition": "*",
"content-type": "*",
"cookie": "*",
"cookie-signature": "1.0.6",
"cordova-common": "2.2.5",
"cordova-registry-mapper": "*",
"cordova-serve": "2.0.1",
"debug": "2.6.9",
"depd": "*",
"destroy": "*",
"ee-first": "*",
"elementtree": "0.1.6",
"encodeurl": "*",
"escape-html": "*",
"escape-string-regexp": "*",
"etag": "*",
"express": "*",
"finalhandler": "*",
"forwarded": "*",
"fresh": "*",
"glob": "5.0.15",
"has-ansi": "2.0.0",
"http-errors": "1.6.3",
"iconv-lite": "0.4.19",
"inflight": "*",
"inherits": "*",
"ipaddr.js": "1.6.0",
"is-wsl": "*",
"media-typer": "*",
"merge-descriptors": "*",
"methods": "*",
"mime": "1.4.1",
"mime-db": "1.33.0",
"mime-types": "2.1.18",
"minimatch": "*",
"ms": "2.0.0",
"negotiator": "*",
"nopt": "3.0.6",
"on-finished": "*",
"on-headers": "*",
"once": "*",
"opn": "*",
"parseurl": "*",
"path-is-absolute": "*",
"path-to-regexp": "0.1.7",
"plist": "2.1.0",
"proxy-addr": "2.0.3",
"q": "*",
"qs": "6.5.1",
"range-parser": "*",
"raw-body": "2.3.2",
"safe-buffer": "5.1.1",
"sax": "0.3.5",
"send": "*",
"serve-static": "*",
"setprototypeof": "*",
"shelljs": "0.5.3",
"statuses": "1.4.0",
"strip-ansi": "3.0.1",
"supports-color": "2.0.0",
"type-is": "*",
"underscore": "*",
"unorm": "*",
"unpipe": "*",
"utils-merge": "*",
"vary": "*",
"wrappy": "*",
"xmlbuilder": "8.2.2",
"xmldom": "*"
},
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true
},
"accepts": {
"version": "1.3.5",
"bundled": true,
"requires": {
"mime-types": "~2.1.18",
"negotiator": "0.6.1"
}
},
"ansi": {
"version": "0.3.1",
"bundled": true
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true
},
"ansi-styles": {
"version": "2.2.1",
"bundled": true
},
"array-flatten": {
"version": "1.1.1",
"bundled": true
},
"balanced-match": {
"version": "1.0.0",
"bundled": true
},
"base64-js": {
"version": "1.2.0",
"bundled": true
},
"big-integer": {
"version": "1.6.32",
"bundled": true
},
"body-parser": {
"version": "1.18.2",
"bundled": true,
"requires": {
"bytes": "3.0.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.1",
"http-errors": "~1.6.2",
"iconv-lite": "0.4.19",
"on-finished": "~2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "~1.6.15"
}
},
"bplist-parser": {
"version": "0.1.1",
"bundled": true,
"requires": {
"big-integer": "^1.6.7"
}
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"bytes": {
"version": "3.0.0",
"bundled": true
},
"chalk": {
"version": "1.1.3",
"bundled": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"compressible": {
"version": "2.0.14",
"bundled": true,
"requires": {
"mime-db": ">= 1.34.0 < 2"
},
"dependencies": {
"mime-db": {
"version": "1.34.0",
"bundled": true
}
}
},
"compression": {
"version": "1.7.2",
"bundled": true,
"requires": {
"accepts": "~1.3.4",
"bytes": "3.0.0",
"compressible": "~2.0.13",
"debug": "2.6.9",
"on-headers": "~1.0.1",
"safe-buffer": "5.1.1",
"vary": "~1.1.2"
}
},
"concat-map": {
"version": "0.0.1",
"bundled": true
},
"content-disposition": {
"version": "0.5.2",
"bundled": true
},
"content-type": {
"version": "1.0.4",
"bundled": true
},
"cookie": {
"version": "0.3.1",
"bundled": true
},
"cookie-signature": {
"version": "1.0.6",
"bundled": true
},
"cordova-common": {
"version": "2.2.5",
"bundled": true,
"requires": {
"ansi": "^0.3.1",
"bplist-parser": "^0.1.0",
"cordova-registry-mapper": "^1.1.8",
"elementtree": "0.1.6",
"glob": "^5.0.13",
"minimatch": "^3.0.0",
"plist": "^2.1.0",
"q": "^1.4.1",
"shelljs": "^0.5.3",
"underscore": "^1.8.3",
"unorm": "^1.3.3"
}
},
"cordova-registry-mapper": {
"version": "1.1.15",
"bundled": true
},
"cordova-serve": {
"version": "2.0.1",
"bundled": true,
"requires": {
"chalk": "^1.1.1",
"compression": "^1.6.0",
"express": "^4.13.3",
"opn": "^5.3.0",
"shelljs": "^0.5.3"
}
},
"debug": {
"version": "2.6.9",
"bundled": true,
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"bundled": true
},
"destroy": {
"version": "1.0.4",
"bundled": true
},
"ee-first": {
"version": "1.1.1",
"bundled": true
},
"elementtree": {
"version": "0.1.6",
"bundled": true,
"requires": {
"sax": "0.3.5"
}
},
"encodeurl": {
"version": "1.0.2",
"bundled": true
},
"escape-html": {
"version": "1.0.3",
"bundled": true
},
"escape-string-regexp": {
"version": "1.0.5",
"bundled": true
},
"etag": {
"version": "1.8.1",
"bundled": true
},
"express": {
"version": "4.16.3",
"bundled": true,
"requires": {
"accepts": "~1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
"content-type": "~1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.3",
"qs": "6.5.1",
"range-parser": "~1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "~1.4.0",
"type-is": "~1.6.16",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
}
},
"finalhandler": {
"version": "1.1.1",
"bundled": true,
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.2",
"statuses": "~1.4.0",
"unpipe": "~1.0.0"
}
},
"forwarded": {
"version": "0.1.2",
"bundled": true
},
"fresh": {
"version": "0.5.2",
"bundled": true
},
"glob": {
"version": "5.0.15",
"bundled": true,
"requires": {
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "2 || 3",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"has-ansi": {
"version": "2.0.0",
"bundled": true,
"requires": {
"ansi-regex": "^2.0.0"
}
},
"http-errors": {
"version": "1.6.3",
"bundled": true,
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": ">= 1.4.0 < 2"
}
},
"iconv-lite": {
"version": "0.4.19",
"bundled": true
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.3",
"bundled": true
},
"ipaddr.js": {
"version": "1.6.0",
"bundled": true
},
"is-wsl": {
"version": "1.1.0",
"bundled": true
},
"media-typer": {
"version": "0.3.0",
"bundled": true
},
"merge-descriptors": {
"version": "1.0.1",
"bundled": true
},
"methods": {
"version": "1.1.2",
"bundled": true
},
"mime": {
"version": "1.4.1",
"bundled": true
},
"mime-db": {
"version": "1.33.0",
"bundled": true
},
"mime-types": {
"version": "2.1.18",
"bundled": true,
"requires": {
"mime-db": "~1.33.0"
}
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"ms": {
"version": "2.0.0",
"bundled": true
},
"negotiator": {
"version": "0.6.1",
"bundled": true
},
"nopt": {
"version": "3.0.6",
"bundled": true,
"requires": {
"abbrev": "1"
}
},
"on-finished": {
"version": "2.3.0",
"bundled": true,
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": {
"version": "1.0.1",
"bundled": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"requires": {
"wrappy": "1"
}
},
"opn": {
"version": "5.3.0",
"bundled": true,
"requires": {
"is-wsl": "^1.1.0"
}
},
"parseurl": {
"version": "1.3.2",
"bundled": true
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true
},
"path-to-regexp": {
"version": "0.1.7",
"bundled": true
},
"plist": {
"version": "2.1.0",
"bundled": true,
"requires": {
"base64-js": "1.2.0",
"xmlbuilder": "8.2.2",
"xmldom": "0.1.x"
}
},
"proxy-addr": {
"version": "2.0.3",
"bundled": true,
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.6.0"
}
},
"q": {
"version": "1.5.1",
"bundled": true
},
"qs": {
"version": "6.5.1",
"bundled": true
},
"range-parser": {
"version": "1.2.0",
"bundled": true
},
"raw-body": {
"version": "2.3.2",
"bundled": true,
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"bundled": true
},
"http-errors": {
"version": "1.6.2",
"bundled": true,
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": ">= 1.3.1 < 2"
}
},
"setprototypeof": {
"version": "1.0.3",
"bundled": true
}
}
},
"safe-buffer": {
"version": "5.1.1",
"bundled": true
},
"sax": {
"version": "0.3.5",
"bundled": true
},
"send": {
"version": "0.16.2",
"bundled": true,
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.6.2",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "~2.3.0",
"range-parser": "~1.2.0",
"statuses": "~1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"bundled": true,
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"bundled": true
},
"shelljs": {
"version": "0.5.3",
"bundled": true
},
"statuses": {
"version": "1.4.0",
"bundled": true
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"requires": {
"ansi-regex": "^2.0.0"
}
},
"supports-color": {
"version": "2.0.0",
"bundled": true
},
"type-is": {
"version": "1.6.16",
"bundled": true,
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.18"
}
},
"underscore": {
"version": "1.9.1",
"bundled": true
},
"unorm": {
"version": "1.4.1",
"bundled": true
},
"unpipe": {
"version": "1.0.0",
"bundled": true
},
"utils-merge": {
"version": "1.0.1",
"bundled": true
},
"vary": {
"version": "1.1.2",
"bundled": true
},
"wrappy": {
"version": "1.0.2",
"bundled": true
},
"xmlbuilder": {
"version": "8.2.2",
"bundled": true
},
"xmldom": {
"version": "0.1.27",
"bundled": true
}
}
},
"cordova-plugin-splashscreen": { "cordova-plugin-splashscreen": {
"version": "5.0.2", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",
@ -223,6 +878,11 @@
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.3.tgz",
"integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q=" "integrity": "sha1-tehezbv+Wu3tQKG/TuI3LmfZb7Q="
},
"ubuntu": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ubuntu/-/ubuntu-2.0.0.tgz",
"integrity": "sha1-VIN9X6tdxyj7lguobYcnE0g5ePI="
} }
} }
} }

View File

@ -10,9 +10,11 @@
"author": "Chris Cromer", "author": "Chris Cromer",
"license": "BSD3", "license": "BSD3",
"dependencies": { "dependencies": {
"cordova-android": "^7.1.1", "cordova-android": "^7.1.4",
"cordova-browser": "^5.0.4",
"cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3" "cordova-plugin-whitelist": "^1.3.3",
"ubuntu": "^2.0.0"
}, },
"cordova": { "cordova": {
"plugins": { "plugins": {
@ -20,7 +22,8 @@
"cordova-plugin-splashscreen": {} "cordova-plugin-splashscreen": {}
}, },
"platforms": [ "platforms": [
"android" "android",
"browser"
] ]
} }
} }

18
plugins/browser.json Normal file
View File

@ -0,0 +1,18 @@
{
"prepare_queue": {
"installed": [],
"uninstalled": []
},
"config_munge": {
"files": {}
},
"installed_plugins": {
"cordova-plugin-splashscreen": {
"PACKAGE_NAME": "cl.cromer.jvonmobile"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "cl.cromer.jvonmobile"
}
},
"dependent_plugins": {}
}