forked from github/cordova-android
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
|
||||
|
||||
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.0";
|
||||
|
||||
module.exports.version = VERSION;
|
||||
|
||||
|
||||
4
bin/templates/project/assets/www/cordova.js
vendored
4
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.0';
|
||||
// file: src/scripts/require.js
|
||||
|
||||
/*jshint -W079 */
|
||||
|
||||
@@ -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.0";
|
||||
|
||||
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.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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user