From 5502ddaf0d814a0b4c8c106ad7351c9e40c382e9 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 2 Nov 2017 14:17:10 -0700 Subject: [PATCH 1/5] CB-13530: This fixes the basic APK installation --- bin/templates/cordova/lib/builders/GenericBuilder.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/templates/cordova/lib/builders/GenericBuilder.js b/bin/templates/cordova/lib/builders/GenericBuilder.js index 5c4215d6..47d57af9 100644 --- a/bin/templates/cordova/lib/builders/GenericBuilder.js +++ b/bin/templates/cordova/lib/builders/GenericBuilder.js @@ -106,10 +106,14 @@ function apkSorter (fileA, fileB) { } function findOutputApksHelper (dir, build_type, arch) { + console.log("Directory: " + dir); + console.log("Build Type: " + build_type); + console.log("Arch: " + arch); + var shellSilent = shell.config.silent; shell.config.silent = true; - var ret = shell.ls(path.join(dir, '*.apk')).filter(function (candidate) { + var ret = shell.ls(path.join(dir, build_type, '*.apk')).filter(function (candidate) { var apkName = path.basename(candidate); // Need to choose between release and debug .apk. if (build_type === 'debug') { From b83c3b3684c74b092d7615097c9e6d1f3cc0513f Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 2 Nov 2017 14:45:51 -0700 Subject: [PATCH 2/5] CB-13530: Removing debug console.logs --- bin/templates/cordova/lib/builders/GenericBuilder.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bin/templates/cordova/lib/builders/GenericBuilder.js b/bin/templates/cordova/lib/builders/GenericBuilder.js index 47d57af9..770911b7 100644 --- a/bin/templates/cordova/lib/builders/GenericBuilder.js +++ b/bin/templates/cordova/lib/builders/GenericBuilder.js @@ -106,10 +106,6 @@ function apkSorter (fileA, fileB) { } function findOutputApksHelper (dir, build_type, arch) { - console.log("Directory: " + dir); - console.log("Build Type: " + build_type); - console.log("Arch: " + arch); - var shellSilent = shell.config.silent; shell.config.silent = true; From b138867b78c9e09db2ad842fd969325276d85506 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 6 Nov 2017 11:43:47 -0800 Subject: [PATCH 3/5] CB-13528 Updated RELEASENOTES and Version for release 6.4.0 --- RELEASENOTES.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 5707ac3c..27924822 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,17 @@ --> ## Release Notes for Cordova (Android) ## +### 6.4.0 (Nov 06, 2017) +* [CB-13289](https://issues.apache.org/jira/browse/CB-13289) Fixing build problems with Studio Three, but keeping **Windows** Gradle fix for now, will be deprecated +* [CB-13289](https://issues.apache.org/jira/browse/CB-13289) Fix test to work with new Google **Android** Gradle DSL +* :CB-13501 : update appveyor node versions to support node 8 +* [CB-13499](https://issues.apache.org/jira/browse/CB-13499) Remove duplicate "setting" in error strings +* Include missing values for task.name when 'cdvBuildMultipleApks' option is true, 'task.name' can have 'validateSigningArmv7Release' or 'validateSigningX86Release' values too. +* [CB-13406](https://issues.apache.org/jira/browse/CB-13406) Fixed AVD API level comparison when choosing sub-par API level match. Added tests for the best_image method. +* [CB-13404](https://issues.apache.org/jira/browse/CB-13404) add **Android**-versions to bundledDependencies. Ignore best emulator selection when parsed AVD information does not include API level in the target +* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) : eslint ignoring cordova.js +* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) Temporarily disabling eslint since cordova-js does not have eslint yet. + ### 6.3.0 (Sep 25, 2017) * [CB-6936](https://issues.apache.org/jira/browse/CB-6936) fix crash when calling methods on a destroyed webview * [CB-12981](https://issues.apache.org/jira/browse/CB-12981) handle SDK 26.0.2 slightly different AVD list output for **Android** 8+ AVDs. Would cause "cannot read property replace of undefined" errors when trying to deploy an **Android** 8 emulator. diff --git a/package.json b/package.json index 88a0da7f..39c62219 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-android", - "version": "6.4.0-dev", + "version": "6.4.0", "description": "cordova-android release", "bin": { "create": "bin/create" From 05aeaf1bd2f7e207896be906eef08a029ae3bbe0 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 6 Nov 2017 11:44:20 -0800 Subject: [PATCH 4/5] Set VERSION to 6.5.0-dev (via coho) --- VERSION | 2 +- bin/templates/cordova/version | 2 +- framework/build.gradle | 6 +++--- framework/src/org/apache/cordova/CordovaWebView.java | 2 +- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 26c70f2f..1c12120d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.4.0-dev +6.5.0-dev diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version index 3b4df99a..cf4c5901 100755 --- a/bin/templates/cordova/version +++ b/bin/templates/cordova/version @@ -20,7 +20,7 @@ */ // Coho updates this line: -var VERSION = "6.4.0-dev"; +var VERSION = "6.5.0-dev"; module.exports.version = VERSION; diff --git a/framework/build.gradle b/framework/build.gradle index 6471c2d6..31c53afe 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -42,7 +42,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' group = 'org.apache.cordova' -version = '6.4.0-dev' +version = '6.5.0-dev' android { compileSdkVersion cdvCompileSdkVersion @@ -129,9 +129,9 @@ bintray { licenses = ['Apache-2.0'] labels = ['android', 'cordova', 'phonegap'] version { - name = '6.4.0-dev' + name = '6.5.0-dev' released = new Date() - vcsTag = '6.4.0-dev' + vcsTag = '6.5.0-dev' } } } diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 2f792241..6b34ff55 100644 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback; * are not expected to implement it. */ public interface CordovaWebView { - public static final String CORDOVA_VERSION = "6.4.0-dev"; + public static final String CORDOVA_VERSION = "6.5.0-dev"; void init(CordovaInterface cordova, List pluginEntries, CordovaPreferences preferences); diff --git a/package.json b/package.json index 39c62219..23c68e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-android", - "version": "6.4.0", + "version": "6.5.0-dev", "description": "cordova-android release", "bin": { "create": "bin/create" From 83601dca2fa468a76bcb2c687b5baebfcb69588b Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 6 Nov 2017 11:44:23 -0800 Subject: [PATCH 5/5] Update JS snapshot to version 6.5.0-dev (via coho) --- bin/templates/project/assets/www/cordova.js | 665 ++++++++++---------- 1 file changed, 322 insertions(+), 343 deletions(-) diff --git a/bin/templates/project/assets/www/cordova.js b/bin/templates/project/assets/www/cordova.js index f71ab4d6..5eb7b4d2 100644 --- a/bin/templates/project/assets/www/cordova.js +++ b/bin/templates/project/assets/www/cordova.js @@ -1,6 +1,5 @@ -/* eslint-disable */ // Platform: android -// 74a4adc2d0fddb1e0cfb9be1961494ef0afc9893 +// 4450a4cea50616e080a82e8ede9e3d6a1fe3c3ec /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -20,35 +19,33 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '6.4.0-dev'; +var PLATFORM_VERSION_BUILD_LABEL = '6.5.0-dev'; // file: src/scripts/require.js -/*jshint -W079 */ -/*jshint -W020 */ +/* jshint -W079 */ +/* jshint -W020 */ -var require, - define; +var require; +var define; (function () { - var modules = {}, + var modules = {}; // Stack of moduleIds currently being built. - requireStack = [], + var requireStack = []; // Map of module ID -> index into requireStack of modules currently being built. - inProgressModules = {}, - SEPARATOR = "."; + var inProgressModules = {}; + var SEPARATOR = '.'; - - - function build(module) { - var factory = module.factory, - localRequire = function (id) { - var resultantId = id; - //Its a relative path, so lop off the last portion and add the id (minus "./") - if (id.charAt(0) === ".") { - resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); - } - return require(resultantId); - }; + function build (module) { + var factory = module.factory; + var localRequire = function (id) { + var resultantId = id; + // Its a relative path, so lop off the last portion and add the id (minus "./") + if (id.charAt(0) === '.') { + resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); + } + return require(resultantId); + }; module.exports = {}; delete module.factory; factory(localRequire, module.exports, module); @@ -57,10 +54,10 @@ var require, require = function (id) { if (!modules[id]) { - throw "module " + id + " not found"; + throw 'module ' + id + ' not found'; } else if (id in inProgressModules) { var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; - throw "Cycle in require graph: " + cycle; + throw 'Cycle in require graph: ' + cycle; } if (modules[id].factory) { try { @@ -77,7 +74,7 @@ var require, define = function (id, factory) { if (modules[id]) { - throw "module " + id + " already defined"; + throw 'module ' + id + ' already defined'; } modules[id] = { @@ -93,8 +90,8 @@ var require, define.moduleMap = modules; })(); -//Export for use in node -if (typeof module === "object" && typeof require === "function") { +// Export for use in node +if (typeof module === 'object' && typeof require === 'function') { module.exports.require = require; module.exports.define = define; } @@ -104,15 +101,13 @@ define("cordova", function(require, exports, module) { // Workaround for Windows 10 in hosted environment case // http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object -if (window.cordova && !(window.cordova instanceof HTMLElement)) { - throw new Error("cordova already defined"); +if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef + throw new Error('cordova already defined'); } - var channel = require('cordova/channel'); var platform = require('cordova/platform'); - /** * Intercept calls to addEventListener + removeEventListener and handle deviceready, * resume, and pause events. @@ -125,48 +120,48 @@ var m_window_removeEventListener = window.removeEventListener; /** * Houses custom event handlers to intercept on document + window event listeners. */ -var documentEventHandlers = {}, - windowEventHandlers = {}; +var documentEventHandlers = {}; +var windowEventHandlers = {}; -document.addEventListener = function(evt, handler, capture) { +document.addEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); - if (typeof documentEventHandlers[e] != 'undefined') { + if (typeof documentEventHandlers[e] !== 'undefined') { documentEventHandlers[e].subscribe(handler); } else { m_document_addEventListener.call(document, evt, handler, capture); } }; -window.addEventListener = function(evt, handler, capture) { +window.addEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); - if (typeof windowEventHandlers[e] != 'undefined') { + if (typeof windowEventHandlers[e] !== 'undefined') { windowEventHandlers[e].subscribe(handler); } else { m_window_addEventListener.call(window, evt, handler, capture); } }; -document.removeEventListener = function(evt, handler, capture) { +document.removeEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); // If unsubscribing from an event that is handled by a plugin - if (typeof documentEventHandlers[e] != "undefined") { + if (typeof documentEventHandlers[e] !== 'undefined') { documentEventHandlers[e].unsubscribe(handler); } else { m_document_removeEventListener.call(document, evt, handler, capture); } }; -window.removeEventListener = function(evt, handler, capture) { +window.removeEventListener = function (evt, handler, capture) { var e = evt.toLowerCase(); // If unsubscribing from an event that is handled by a plugin - if (typeof windowEventHandlers[e] != "undefined") { + if (typeof windowEventHandlers[e] !== 'undefined') { windowEventHandlers[e].unsubscribe(handler); } else { m_window_removeEventListener.call(window, evt, handler, capture); } }; -function createEvent(type, data) { +function createEvent (type, data) { var event = document.createEvent('Events'); event.initEvent(type, false, false); if (data) { @@ -179,29 +174,32 @@ function createEvent(type, data) { return event; } - +/* eslint-disable no-undef */ var cordova = { - define:define, - require:require, - version:PLATFORM_VERSION_BUILD_LABEL, - platformVersion:PLATFORM_VERSION_BUILD_LABEL, - platformId:platform.id, + define: define, + require: require, + version: PLATFORM_VERSION_BUILD_LABEL, + platformVersion: PLATFORM_VERSION_BUILD_LABEL, + platformId: platform.id, + + /* eslint-enable no-undef */ + /** * Methods to add/remove your own addEventListener hijacking on document + window. */ - addWindowEventHandler:function(event) { + addWindowEventHandler: function (event) { return (windowEventHandlers[event] = channel.create(event)); }, - addStickyDocumentEventHandler:function(event) { + addStickyDocumentEventHandler: function (event) { return (documentEventHandlers[event] = channel.createSticky(event)); }, - addDocumentEventHandler:function(event) { + addDocumentEventHandler: function (event) { return (documentEventHandlers[event] = channel.create(event)); }, - removeWindowEventHandler:function(event) { + removeWindowEventHandler: function (event) { delete windowEventHandlers[event]; }, - removeDocumentEventHandler:function(event) { + removeDocumentEventHandler: function (event) { delete documentEventHandlers[event]; }, /** @@ -209,24 +207,23 @@ var cordova = { * * @return object */ - getOriginalHandlers: function() { + getOriginalHandlers: function () { return {'document': {'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener}, - 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; + 'window': {'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener}}; }, /** * Method to fire event from native code * bNoDetach is required for events which cause an exception which needs to be caught in native code */ - fireDocumentEvent: function(type, data, bNoDetach) { + fireDocumentEvent: function (type, data, bNoDetach) { var evt = createEvent(type, data); - if (typeof documentEventHandlers[type] != 'undefined') { - if( bNoDetach ) { + if (typeof documentEventHandlers[type] !== 'undefined') { + if (bNoDetach) { documentEventHandlers[type].fire(evt); - } - else { - setTimeout(function() { + } else { + setTimeout(function () { // Fire deviceready on listeners that were registered before cordova.js was loaded. - if (type == 'deviceready') { + if (type === 'deviceready') { document.dispatchEvent(evt); } documentEventHandlers[type].fire(evt); @@ -236,10 +233,10 @@ var cordova = { document.dispatchEvent(evt); } }, - fireWindowEvent: function(type, data) { - var evt = createEvent(type,data); - if (typeof windowEventHandlers[type] != 'undefined') { - setTimeout(function() { + fireWindowEvent: function (type, data) { + var evt = createEvent(type, data); + if (typeof windowEventHandlers[type] !== 'undefined') { + setTimeout(function () { windowEventHandlers[type].fire(evt); }, 0); } else { @@ -253,7 +250,7 @@ var cordova = { // Randomize the starting callbackId to avoid collisions after refreshing or navigating. // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. callbackId: Math.floor(Math.random() * 2000000000), - callbacks: {}, + callbacks: {}, callbackStatus: { NO_RESULT: 0, OK: 1, @@ -270,14 +267,14 @@ var cordova = { /** * Called by native code when returning successful result from an action. */ - callbackSuccess: function(callbackId, args) { + callbackSuccess: function (callbackId, args) { cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); }, /** * Called by native code when returning error result from an action. */ - callbackError: function(callbackId, args) { + callbackError: function (callbackId, args) { // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. // Derive success from status. cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); @@ -286,11 +283,11 @@ var cordova = { /** * Called by native code when returning the result from an action. */ - callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback) { + callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) { try { var callback = cordova.callbacks[callbackId]; if (callback) { - if (isSuccess && status == cordova.callbackStatus.OK) { + if (isSuccess && status === cordova.callbackStatus.OK) { callback.success && callback.success.apply(null, args); } else if (!isSuccess) { callback.fail && callback.fail.apply(null, args); @@ -307,26 +304,24 @@ var cordova = { delete cordova.callbacks[callbackId]; } } - } - catch (err) { - var msg = "Error in " + (isSuccess ? "Success" : "Error") + " callbackId: " + callbackId + " : " + err; + } catch (err) { + var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; console && console.log && console.log(msg); - cordova.fireWindowEvent("cordovacallbackerror", { 'message': msg }); + cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); throw err; } }, - addConstructor: function(func) { - channel.onCordovaReady.subscribe(function() { + addConstructor: function (func) { + channel.onCordovaReady.subscribe(function () { try { func(); - } catch(e) { - console.log("Failed to run constructor: " + e); + } catch (e) { + console.log('Failed to run constructor: ' + e); } }); } }; - module.exports = cordova; }); @@ -392,29 +387,29 @@ var typeMap = { 'O': 'Object' }; -function extractParamName(callee, argIndex) { +function extractParamName (callee, argIndex) { return (/.*?\((.*?)\)/).exec(callee)[1].split(', ')[argIndex]; } -function checkArgs(spec, functionName, args, opt_callee) { +function checkArgs (spec, functionName, args, opt_callee) { if (!moduleExports.enableChecks) { return; } var errMsg = null; var typeName; for (var i = 0; i < spec.length; ++i) { - var c = spec.charAt(i), - cUpper = c.toUpperCase(), - arg = args[i]; + var c = spec.charAt(i); + var cUpper = c.toUpperCase(); + var arg = args[i]; // Asterix means allow anything. - if (c == '*') { + if (c === '*') { continue; } typeName = utils.typeName(arg); - if ((arg === null || arg === undefined) && c == cUpper) { + if ((arg === null || arg === undefined) && c === cUpper) { continue; } - if (typeName != typeMap[cUpper]) { + if (typeName !== typeMap[cUpper]) { errMsg = 'Expected ' + typeMap[cUpper]; break; } @@ -423,14 +418,14 @@ function checkArgs(spec, functionName, args, opt_callee) { errMsg += ', but got ' + typeName + '.'; errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; // Don't log when running unit tests. - if (typeof jasmine == 'undefined') { + if (typeof jasmine === 'undefined') { console.error(errMsg); } throw TypeError(errMsg); } } -function getValue(value, defaultValue) { +function getValue (value, defaultValue) { return value === undefined ? defaultValue : value; } @@ -438,7 +433,6 @@ moduleExports.checkArgs = checkArgs; moduleExports.getValue = getValue; moduleExports.enableChecks = true; - }); // file: src/common/base64.js @@ -446,58 +440,58 @@ define("cordova/base64", function(require, exports, module) { var base64 = exports; -base64.fromArrayBuffer = function(arrayBuffer) { +base64.fromArrayBuffer = function (arrayBuffer) { var array = new Uint8Array(arrayBuffer); return uint8ToBase64(array); }; -base64.toArrayBuffer = function(str) { - var decodedStr = typeof atob != 'undefined' ? atob(str) : new Buffer(str,'base64').toString('binary'); +base64.toArrayBuffer = function (str) { + var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef var arrayBuffer = new ArrayBuffer(decodedStr.length); var array = new Uint8Array(arrayBuffer); - for (var i=0, len=decodedStr.length; i < len; i++) { + for (var i = 0, len = decodedStr.length; i < len; i++) { array[i] = decodedStr.charCodeAt(i); } return arrayBuffer; }; -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ /* This code is based on the performance tests at http://jsperf.com/b64tests * This 12-bit-at-a-time algorithm was the best performing version on all * platforms tested. */ -var b64_6bit = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var b64_12bit; -var b64_12bitTable = function() { +var b64_12bitTable = function () { b64_12bit = []; - for (var i=0; i<64; i++) { - for (var j=0; j<64; j++) { - b64_12bit[i*64+j] = b64_6bit[i] + b64_6bit[j]; + for (var i = 0; i < 64; i++) { + for (var j = 0; j < 64; j++) { + b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j]; } } - b64_12bitTable = function() { return b64_12bit; }; + b64_12bitTable = function () { return b64_12bit; }; return b64_12bit; }; -function uint8ToBase64(rawData) { +function uint8ToBase64 (rawData) { var numBytes = rawData.byteLength; - var output=""; + var output = ''; var segment; var table = b64_12bitTable(); - for (var i=0;i> 12]; output += table[segment & 0xfff]; } - if (numBytes - i == 2) { - segment = (rawData[i] << 16) + (rawData[i+1] << 8); + if (numBytes - i === 2) { + segment = (rawData[i] << 16) + (rawData[i + 1] << 8); output += table[segment >> 12]; output += b64_6bit[(segment & 0xfff) >> 6]; output += '='; - } else if (numBytes - i == 1) { + } else if (numBytes - i === 1) { segment = (rawData[i] << 16); output += table[segment >> 12]; output += '=='; @@ -512,7 +506,7 @@ define("cordova/builder", function(require, exports, module) { var utils = require('cordova/utils'); -function each(objects, func, context) { +function each (objects, func, context) { for (var prop in objects) { if (objects.hasOwnProperty(prop)) { func.apply(context, [objects[prop], prop]); @@ -520,7 +514,7 @@ function each(objects, func, context) { } } -function clobber(obj, key, value) { +function clobber (obj, key, value) { exports.replaceHookForTesting(obj, key); var needsProperty = false; try { @@ -530,15 +524,15 @@ function clobber(obj, key, value) { } // Getters can only be overridden by getters. if (needsProperty || obj[key] !== value) { - utils.defineGetter(obj, key, function() { + utils.defineGetter(obj, key, function () { return value; }); } } -function assignOrWrapInDeprecateGetter(obj, key, value, message) { +function assignOrWrapInDeprecateGetter (obj, key, value, message) { if (message) { - utils.defineGetter(obj, key, function() { + utils.defineGetter(obj, key, function () { console.log(message); delete obj[key]; clobber(obj, key, value); @@ -549,7 +543,7 @@ function assignOrWrapInDeprecateGetter(obj, key, value, message) { } } -function include(parent, objects, clobber, merge) { +function include (parent, objects, clobber, merge) { each(objects, function (obj, key) { try { var result = obj.path ? require(obj.path) : {}; @@ -569,7 +563,7 @@ function include(parent, objects, clobber, merge) { result = parent[key]; } else { // Overwrite if not currently defined. - if (typeof parent[key] == 'undefined') { + if (typeof parent[key] === 'undefined') { assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); } else { // Set result to what already exists, so we can build children into it if they exist. @@ -580,7 +574,7 @@ function include(parent, objects, clobber, merge) { if (obj.children) { include(result, obj.children, clobber, merge); } - } catch(e) { + } catch (e) { utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); } }); @@ -593,7 +587,7 @@ function include(parent, objects, clobber, merge) { * @param target Object to merge properties into. * @param src Object to merge properties from. */ -function recursiveMerge(target, src) { +function recursiveMerge (target, src) { for (var prop in src) { if (src.hasOwnProperty(prop)) { if (target.prototype && target.prototype.constructor === target) { @@ -610,26 +604,26 @@ function recursiveMerge(target, src) { } } -exports.buildIntoButDoNotClobber = function(objects, target) { +exports.buildIntoButDoNotClobber = function (objects, target) { include(target, objects, false, false); }; -exports.buildIntoAndClobber = function(objects, target) { +exports.buildIntoAndClobber = function (objects, target) { include(target, objects, true, false); }; -exports.buildIntoAndMerge = function(objects, target) { +exports.buildIntoAndMerge = function (objects, target) { include(target, objects, true, true); }; exports.recursiveMerge = recursiveMerge; exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; -exports.replaceHookForTesting = function() {}; +exports.replaceHookForTesting = function () {}; }); // file: src/common/channel.js define("cordova/channel", function(require, exports, module) { -var utils = require('cordova/utils'), - nextGuid = 1; +var utils = require('cordova/utils'); +var nextGuid = 1; /** * Custom pub-sub "channel" that can have functions subscribed to it @@ -669,7 +663,7 @@ var utils = require('cordova/utils'), * @constructor * @param type String the channel name */ -var Channel = function(type, sticky) { +var Channel = function (type, sticky) { this.type = type; // Map of guid -> function. this.handlers = {}; @@ -682,72 +676,73 @@ var Channel = function(type, sticky) { // Function that is called when the first listener is subscribed, or when // the last listener is unsubscribed. this.onHasSubscribersChange = null; -}, - channel = { - /** - * Calls the provided function only after all of the channels specified - * have been fired. All channels must be sticky channels. - */ - join: function(h, c) { - var len = c.length, - i = len, - f = function() { - if (!(--i)) h(); - }; - for (var j=0; j - if (strategy == 'r') { + if (strategy === 'r') { continue; } var symbolPath = symbolList[i + 2]; @@ -1524,9 +1515,9 @@ exports.mapModules = function(context) { var parentObj = prepareNamespace(namespace, context); var target = parentObj[lastName]; - if (strategy == 'm' && target) { + if (strategy === 'm' && target) { builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { + } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { if (!(symbolPath in origSymbols)) { origSymbols[symbolPath] = target; } @@ -1535,7 +1526,7 @@ exports.mapModules = function(context) { } }; -exports.getOriginalSymbol = function(context, symbolPath) { +exports.getOriginalSymbol = function (context, symbolPath) { var origSymbols = context.CDV_origSymbols; if (origSymbols && (symbolPath in origSymbols)) { return origSymbols[symbolPath]; @@ -1550,22 +1541,21 @@ exports.getOriginalSymbol = function(context, symbolPath) { exports.reset(); - }); // file: src/common/modulemapper_b.js define("cordova/modulemapper_b", function(require, exports, module) { -var builder = require('cordova/builder'), - symbolList = [], - deprecationMap; +var builder = require('cordova/builder'); +var symbolList = []; +var deprecationMap; -exports.reset = function() { +exports.reset = function () { symbolList = []; deprecationMap = {}; }; -function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { +function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { symbolList.push(strategy, moduleName, symbolPath); if (opt_deprecationMessage) { deprecationMap[symbolPath] = opt_deprecationMessage; @@ -1573,35 +1563,35 @@ function addEntry(strategy, moduleName, symbolPath, opt_deprecationMessage) { } // Note: Android 2.3 does have Function.bind(). -exports.clobbers = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('c', moduleName, symbolPath, opt_deprecationMessage); }; -exports.merges = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('m', moduleName, symbolPath, opt_deprecationMessage); }; -exports.defaults = function(moduleName, symbolPath, opt_deprecationMessage) { +exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { addEntry('d', moduleName, symbolPath, opt_deprecationMessage); }; -exports.runs = function(moduleName) { +exports.runs = function (moduleName) { addEntry('r', moduleName, null); }; -function prepareNamespace(symbolPath, context) { +function prepareNamespace (symbolPath, context) { if (!symbolPath) { return context; } var parts = symbolPath.split('.'); var cur = context; - for (var i = 0, part; part = parts[i]; ++i) { + for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign cur = cur[part] = cur[part] || {}; } return cur; } -exports.mapModules = function(context) { +exports.mapModules = function (context) { var origSymbols = {}; context.CDV_origSymbols = origSymbols; for (var i = 0, len = symbolList.length; i < len; i += 3) { @@ -1609,7 +1599,7 @@ exports.mapModules = function(context) { var moduleName = symbolList[i + 1]; var module = require(moduleName); // - if (strategy == 'r') { + if (strategy === 'r') { continue; } var symbolPath = symbolList[i + 2]; @@ -1621,9 +1611,9 @@ exports.mapModules = function(context) { var parentObj = prepareNamespace(namespace, context); var target = parentObj[lastName]; - if (strategy == 'm' && target) { + if (strategy === 'm' && target) { builder.recursiveMerge(target, module); - } else if ((strategy == 'd' && !target) || (strategy != 'd')) { + } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { if (!(symbolPath in origSymbols)) { origSymbols[symbolPath] = target; } @@ -1632,7 +1622,7 @@ exports.mapModules = function(context) { } }; -exports.getOriginalSymbol = function(context, symbolPath) { +exports.getOriginalSymbol = function (context, symbolPath) { var origSymbols = context.CDV_origSymbols; if (origSymbols && (symbolPath in origSymbols)) { return origSymbols[symbolPath]; @@ -1647,7 +1637,6 @@ exports.getOriginalSymbol = function(context, symbolPath) { exports.reset(); - }); // file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js @@ -1857,12 +1846,11 @@ module.exports = { define("cordova/pluginloader", function(require, exports, module) { var modulemapper = require('cordova/modulemapper'); -var urlutil = require('cordova/urlutil'); // Helper function to inject a