forked from github/cordova-android
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96457effbc | ||
|
|
67e7980eba | ||
|
|
0efa6cd766 | ||
|
|
a51fc4b25e | ||
|
|
071ddbf6eb | ||
|
|
a87eb7266f | ||
|
|
c2ddd2da7f | ||
|
|
e856613787 | ||
|
|
94e9bd5e26 | ||
|
|
011b57da54 | ||
|
|
7e54af75d8 | ||
|
|
d95df96881 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -40,7 +40,6 @@ Desktop.ini
|
||||
*.iml
|
||||
.idea
|
||||
npm-debug.log
|
||||
/framework/build
|
||||
node_modules/jshint
|
||||
node_modules/promise-matchers
|
||||
node_modules/jasmine-node
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
-->
|
||||
## Release Notes for Cordova (Android) ##
|
||||
|
||||
### 6.1.1 (Jan 03, 2017)
|
||||
* [CB-12159](https://issues.apache.org/jira/browse/CB-12159) **Android** Keystore password prompt won't show up
|
||||
* [CB-12169](https://issues.apache.org/jira/browse/CB-12169) Check for build directory before running a clean
|
||||
* Fixed `AndroidStudio` tests to actually run, removed `app/src/main/assets/` as a requirement and added `app/src/main/res` instead, added placeholder for `build/` folder, Removed dupe `gitignore`
|
||||
|
||||
### 6.1.0 (Nov 02, 2016)
|
||||
* [CB-12108](https://issues.apache.org/jira/browse/CB-12108) Updating gradle files to work with the latest version of Android Studio
|
||||
* [CB-12102](https://issues.apache.org/jira/browse/CB-12102) Bump travis to build to API 25
|
||||
|
||||
8
bin/templates/cordova/Api.js
vendored
8
bin/templates/cordova/Api.js
vendored
@@ -72,6 +72,7 @@ function Api(platform, platformRootDir, events) {
|
||||
defaultConfigXml: path.join(self.root, 'cordova/defaults.xml'),
|
||||
strings: path.join(self.root, 'res/values/strings.xml'),
|
||||
manifest: path.join(self.root, 'AndroidManifest.xml'),
|
||||
build: path.join(self.root, 'build'),
|
||||
// NOTE: Due to platformApi spec we need to return relative paths here
|
||||
cordovaJs: 'bin/templates/project/assets/www/cordova.js',
|
||||
cordovaJsSrc: 'cordova-js-src'
|
||||
@@ -241,11 +242,12 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
|
||||
// Do some basic argument parsing
|
||||
var opts = {};
|
||||
|
||||
// Skip cleaning prepared files when not invoking via cordova CLI.
|
||||
// Skip cleaning prepared files when not invoking via cordova CLI.
|
||||
opts.noPrepare = true;
|
||||
|
||||
if(!(AndroidStudio.isAndroidStudioProject(self.root)))
|
||||
if(!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
|
||||
return self.clean(opts);
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
return PluginManager.get(self.platform, self.locations, project)
|
||||
@@ -396,6 +398,8 @@ Api.prototype.clean = function(cleanOptions) {
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Performs a requirements check for current platform. Each platform defines its
|
||||
* own set of requirements, which should be resolved before platform can be
|
||||
|
||||
9
bin/templates/cordova/lib/AndroidProject.js
vendored
9
bin/templates/cordova/lib/AndroidProject.js
vendored
@@ -197,5 +197,14 @@ AndroidProject.prototype.getUninstaller = function (type) {
|
||||
return pluginHandlers.getUninstaller(type);
|
||||
};
|
||||
|
||||
/*
|
||||
* This checks if an Android project is clean or has old build artifacts
|
||||
*/
|
||||
|
||||
AndroidProject.prototype.isClean = function() {
|
||||
var build_path = path.join(this.projectDir, 'build');
|
||||
//If the build directory doesn't exist, it's clean
|
||||
return !(fs.existsSync(build_path));
|
||||
};
|
||||
|
||||
module.exports = AndroidProject;
|
||||
|
||||
8
bin/templates/cordova/lib/AndroidStudio.js
vendored
8
bin/templates/cordova/lib/AndroidStudio.js
vendored
@@ -8,15 +8,20 @@
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var CordovaError = require('cordova-common').CordovaError;
|
||||
|
||||
module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
|
||||
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
|
||||
var androidStudioFiles = ['app', 'gradle', 'build', 'app/src/main/assets'];
|
||||
var androidStudioFiles = ['app', 'gradle', 'app/src/main/res'];
|
||||
|
||||
// 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))) {
|
||||
@@ -28,6 +33,7 @@ module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
|
||||
if(!isEclipse) {
|
||||
androidStudioFiles.forEach(function(file){
|
||||
if(!fs.existsSync(path.join(root, file))) {
|
||||
console.log('missing file :: ' + file);
|
||||
isAS = false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
// Coho updates this line:
|
||||
var VERSION = "6.1.0-dev";
|
||||
var VERSION = "6.1.1";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
||||
14
bin/templates/project/assets/www/cordova.js
vendored
14
bin/templates/project/assets/www/cordova.js
vendored
@@ -1,5 +1,5 @@
|
||||
// Platform: android
|
||||
// 53ea1913735222d326e65326e03391405df3cd4e
|
||||
// a3732cb71d9b1dd590338e8cf44196f366d46da3
|
||||
/*
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
@@ -19,7 +19,7 @@
|
||||
under the License.
|
||||
*/
|
||||
;(function() {
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.1.0-dev';
|
||||
var PLATFORM_VERSION_BUILD_LABEL = '6.1.1';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/*jshint -W079 */
|
||||
@@ -330,7 +330,7 @@ module.exports = cordova;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js
|
||||
define("cordova/android/nativeapiprovider", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -353,7 +353,7 @@ module.exports = {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js
|
||||
define("cordova/android/promptbasednativeapi", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -886,7 +886,7 @@ module.exports = channel;
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/exec.js
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js
|
||||
define("cordova/exec", function(require, exports, module) {
|
||||
|
||||
/**
|
||||
@@ -1649,7 +1649,7 @@ exports.reset();
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/platform.js
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js
|
||||
define("cordova/platform", function(require, exports, module) {
|
||||
|
||||
// The last resume event that was received that had the result of a plugin call.
|
||||
@@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) {
|
||||
|
||||
});
|
||||
|
||||
// file: /Users/jbowser/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js
|
||||
define("cordova/plugin/android/app", function(require, exports, module) {
|
||||
|
||||
var exec = require('cordova/exec');
|
||||
|
||||
@@ -264,7 +264,7 @@ def promptForReleaseKeyPassword() {
|
||||
|
||||
gradle.taskGraph.whenReady { taskGraph ->
|
||||
taskGraph.getAllTasks().each() { task ->
|
||||
if (task.name == 'validateReleaseSigning') {
|
||||
if (task.name == 'validateReleaseSigning' || task.name == 'validateSigningRelease') {
|
||||
promptForReleaseKeyPassword()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.1.0-dev";
|
||||
public static final String CORDOVA_VERSION = "6.1.1";
|
||||
|
||||
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);
|
||||
|
||||
|
||||
94
package.json
94
package.json
@@ -1,49 +1,49 @@
|
||||
{
|
||||
"name": "cordova-android",
|
||||
"version": "6.1.0",
|
||||
"description": "cordova-android release",
|
||||
"bin": {
|
||||
"create": "bin/create"
|
||||
},
|
||||
"main": "bin/templates/cordova/Api.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
|
||||
},
|
||||
"keywords": [
|
||||
"android",
|
||||
"cordova",
|
||||
"apache"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run jshint && jasmine-node --color spec/unit",
|
||||
"cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
|
||||
"test-build": "jasmine-node --captureExceptions --color spec/e2e",
|
||||
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
|
||||
},
|
||||
"author": "Apache Software Foundation",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cordova-common": "^1.5.0",
|
||||
"elementtree": "^0.1.6",
|
||||
"nopt": "^3.0.1",
|
||||
"properties-parser": "^0.2.3",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.5.3"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"cordova-common",
|
||||
"elementtree",
|
||||
"nopt",
|
||||
"properties-parser",
|
||||
"q",
|
||||
"shelljs"
|
||||
],
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.2",
|
||||
"jasmine-node": "^1.14.5",
|
||||
"jshint": "^2.6.0",
|
||||
"promise-matchers": "~0",
|
||||
"rewire": "^2.1.3"
|
||||
}
|
||||
"name": "cordova-android",
|
||||
"version": "6.1.1",
|
||||
"description": "cordova-android release",
|
||||
"bin": {
|
||||
"create": "bin/create"
|
||||
},
|
||||
"main": "bin/templates/cordova/Api.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
|
||||
},
|
||||
"keywords": [
|
||||
"android",
|
||||
"cordova",
|
||||
"apache"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run jshint && jasmine-node --color spec/unit",
|
||||
"cover": "istanbul cover --root bin/templates/cordova --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
|
||||
"test-build": "jasmine-node --captureExceptions --color spec/e2e",
|
||||
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
|
||||
},
|
||||
"author": "Apache Software Foundation",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cordova-common": "^1.5.0",
|
||||
"elementtree": "^0.1.6",
|
||||
"nopt": "^3.0.1",
|
||||
"properties-parser": "^0.2.3",
|
||||
"q": "^1.4.1",
|
||||
"shelljs": "^0.5.3"
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"cordova-common",
|
||||
"elementtree",
|
||||
"nopt",
|
||||
"properties-parser",
|
||||
"q",
|
||||
"shelljs"
|
||||
],
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.2",
|
||||
"jasmine-node": "^1.14.5",
|
||||
"jshint": "^2.6.0",
|
||||
"promise-matchers": "~0",
|
||||
"rewire": "^2.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
var path = require('path'),
|
||||
actions = require('./helpers/projectActions.js');
|
||||
|
||||
var PLUGIN_ADD_TIMEOUT = 60000;
|
||||
var PLUGIN_ADD_TIMEOUT = 90000;
|
||||
|
||||
describe('plugin add', function() {
|
||||
|
||||
|
||||
1
spec/fixtures/android_studio_project/app/build/placeholder
vendored
Normal file
1
spec/fixtures/android_studio_project/app/build/placeholder
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Tests require that this folder exists.
|
||||
@@ -1,14 +0,0 @@
|
||||
var AndroidStudio = require('../../bin/templates/cordova/lib/AndroidStudio');
|
||||
|
||||
describe('AndroidStudio module', function () {
|
||||
it('should detect Android Studio project', function() {
|
||||
var root = './fixtures/android_studio_project';
|
||||
spyOn(AndroidStudio, 'isAndroidStudioProject').andReturn(true);
|
||||
AndroidStudio.isAndroidStudioProject(root);
|
||||
});
|
||||
it('should detect non Android Studio project', function() {
|
||||
var root = './fixtures/android_project';
|
||||
spyOn(AndroidStudio, 'isAndroidStudioProject').andReturn(false);
|
||||
AndroidStudio.isAndroidStudioProject(root);
|
||||
});
|
||||
});
|
||||
17
spec/unit/AndroidStudio.spec.js
Normal file
17
spec/unit/AndroidStudio.spec.js
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
var path = require('path');
|
||||
var AndroidStudio = require('../../bin/templates/cordova/lib/AndroidStudio');
|
||||
|
||||
|
||||
describe('AndroidStudio module', function () {
|
||||
it('should return true for Android Studio project', function() {
|
||||
var root = path.join(__dirname,'../fixtures/android_studio_project/');
|
||||
var isAndStud = AndroidStudio.isAndroidStudioProject(root);
|
||||
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);
|
||||
});
|
||||
});
|
||||
@@ -42,7 +42,7 @@ describe('addPlugin method', function () {
|
||||
pluginManager.addPlugin.andReturn(Q());
|
||||
spyOn(common.PluginManager, 'get').andReturn(pluginManager);
|
||||
|
||||
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write']);
|
||||
var projectSpy = jasmine.createSpyObj('AndroidProject', ['getPackageName', 'write', 'isClean']);
|
||||
spyOn(AndroidProject, 'getProjectFile').andReturn(projectSpy);
|
||||
|
||||
oldClean = Api.__get__('Api.prototype.clean');
|
||||
|
||||
Reference in New Issue
Block a user