Compare commits

...

5 Commits

11 changed files with 78 additions and 69 deletions

1
.gitignore vendored
View File

@@ -40,7 +40,6 @@ Desktop.ini
*.iml *.iml
.idea .idea
npm-debug.log npm-debug.log
/framework/build
node_modules/jshint node_modules/jshint
node_modules/promise-matchers node_modules/promise-matchers
node_modules/jasmine-node node_modules/jasmine-node

View File

@@ -1 +1 @@
6.1.0-dev 6.1.0

View File

@@ -8,15 +8,20 @@
var path = require('path'); var path = require('path');
var fs = require('fs'); 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', 'project.properties', 'platform_www']; 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 // assume it is an AS project and not an Eclipse project
var isEclipse = false; var isEclipse = false;
var isAS = true; 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 // if any of the following exists, then we are not an ASProj
eclipseFiles.forEach(function(file) { eclipseFiles.forEach(function(file) {
if(fs.existsSync(path.join(root, file))) { if(fs.existsSync(path.join(root, file))) {
@@ -28,6 +33,7 @@ module.exports.isAndroidStudioProject = function isAndroidStudioProject(root) {
if(!isEclipse) { if(!isEclipse) {
androidStudioFiles.forEach(function(file){ androidStudioFiles.forEach(function(file){
if(!fs.existsSync(path.join(root, file))) { if(!fs.existsSync(path.join(root, file))) {
console.log('missing file :: ' + file);
isAS = false; isAS = false;
} }
}); });

View File

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

View File

@@ -1,5 +1,5 @@
// Platform: android // Platform: android
// 53ea1913735222d326e65326e03391405df3cd4e // a3732cb71d9b1dd590338e8cf44196f366d46da3
/* /*
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License. under the License.
*/ */
;(function() { ;(function() {
var PLATFORM_VERSION_BUILD_LABEL = '6.1.0-dev'; var PLATFORM_VERSION_BUILD_LABEL = '6.1.0';
// file: src/scripts/require.js // file: src/scripts/require.js
/*jshint -W079 */ /*jshint -W079 */

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 = "6.1.0-dev"; public static final String CORDOVA_VERSION = "6.1.0";
void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences); void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences);

View File

@@ -1,49 +1,49 @@
{ {
"name": "cordova-android", "name": "cordova-android",
"version": "6.1.0", "version": "6.1.0",
"description": "cordova-android release", "description": "cordova-android release",
"bin": { "bin": {
"create": "bin/create" "create": "bin/create"
}, },
"main": "bin/templates/cordova/Api.js", "main": "bin/templates/cordova/Api.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git" "url": "https://git-wip-us.apache.org/repos/asf/cordova-android.git"
}, },
"keywords": [ "keywords": [
"android", "android",
"cordova", "cordova",
"apache" "apache"
], ],
"scripts": { "scripts": {
"test": "npm run jshint && jasmine-node --color spec/unit", "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", "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", "test-build": "jasmine-node --captureExceptions --color spec/e2e",
"jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec" "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint spec"
}, },
"author": "Apache Software Foundation", "author": "Apache Software Foundation",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"cordova-common": "^1.5.0", "cordova-common": "^1.5.0",
"elementtree": "^0.1.6", "elementtree": "^0.1.6",
"nopt": "^3.0.1", "nopt": "^3.0.1",
"properties-parser": "^0.2.3", "properties-parser": "^0.2.3",
"q": "^1.4.1", "q": "^1.4.1",
"shelljs": "^0.5.3" "shelljs": "^0.5.3"
}, },
"bundledDependencies": [ "bundledDependencies": [
"cordova-common", "cordova-common",
"elementtree", "elementtree",
"nopt", "nopt",
"properties-parser", "properties-parser",
"q", "q",
"shelljs" "shelljs"
], ],
"devDependencies": { "devDependencies": {
"istanbul": "^0.4.2", "istanbul": "^0.4.2",
"jasmine-node": "^1.14.5", "jasmine-node": "^1.14.5",
"jshint": "^2.6.0", "jshint": "^2.6.0",
"promise-matchers": "~0", "promise-matchers": "~0",
"rewire": "^2.1.3" "rewire": "^2.1.3"
} }
} }

View File

@@ -20,7 +20,7 @@
var path = require('path'), var path = require('path'),
actions = require('./helpers/projectActions.js'); actions = require('./helpers/projectActions.js');
var PLUGIN_ADD_TIMEOUT = 60000; var PLUGIN_ADD_TIMEOUT = 90000;
describe('plugin add', function() { describe('plugin add', function() {

View File

@@ -0,0 +1 @@
Tests require that this folder exists.

View File

@@ -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);
});
});

View 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);
});
});