mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-28 22:17:50 +08:00
Remove no longer needed AndroidStudio.js
This commit is contained in:
parent
350d35fb24
commit
4b0725dfc2
17
bin/templates/cordova/Api.js
vendored
17
bin/templates/cordova/Api.js
vendored
@ -21,7 +21,6 @@ var path = require('path');
|
|||||||
var Q = require('q');
|
var Q = require('q');
|
||||||
|
|
||||||
var AndroidProject = require('./lib/AndroidProject');
|
var AndroidProject = require('./lib/AndroidProject');
|
||||||
var AndroidStudio = require('./lib/AndroidStudio');
|
|
||||||
var PluginManager = require('cordova-common').PluginManager;
|
var PluginManager = require('cordova-common').PluginManager;
|
||||||
|
|
||||||
var CordovaLogger = require('cordova-common').CordovaLogger;
|
var CordovaLogger = require('cordova-common').CordovaLogger;
|
||||||
@ -214,22 +213,6 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Q().then(function () {
|
return Q().then(function () {
|
||||||
// CB-11964: Do a clean when installing the plugin code to get around
|
|
||||||
// the Gradle bug introduced by the Android Gradle Plugin Version 2.2
|
|
||||||
// TODO: Delete when the next version of Android Gradle plugin comes out
|
|
||||||
// Since clean doesn't just clean the build, it also wipes out www, we need
|
|
||||||
// to pass additional options.
|
|
||||||
|
|
||||||
// Do some basic argument parsing
|
|
||||||
var opts = {};
|
|
||||||
|
|
||||||
// Skip cleaning prepared files when not invoking via cordova CLI.
|
|
||||||
opts.noPrepare = true;
|
|
||||||
|
|
||||||
if (!AndroidStudio.isAndroidStudioProject(self.root) && !project.isClean()) {
|
|
||||||
return self.clean(opts);
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions);
|
return PluginManager.get(self.platform, self.locations, project).addPlugin(plugin, installOptions);
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
if (plugin.getFrameworks(this.platform).length === 0) return;
|
if (plugin.getFrameworks(this.platform).length === 0) return;
|
||||||
|
9
bin/templates/cordova/lib/AndroidProject.js
vendored
9
bin/templates/cordova/lib/AndroidProject.js
vendored
@ -21,7 +21,6 @@ var fs = require('fs');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var properties_parser = require('properties-parser');
|
var properties_parser = require('properties-parser');
|
||||||
var AndroidManifest = require('./AndroidManifest');
|
var AndroidManifest = require('./AndroidManifest');
|
||||||
var AndroidStudio = require('./AndroidStudio');
|
|
||||||
var pluginHandlers = require('./pluginHandlers');
|
var pluginHandlers = require('./pluginHandlers');
|
||||||
|
|
||||||
var projectFileCache = {};
|
var projectFileCache = {};
|
||||||
@ -62,10 +61,7 @@ function AndroidProject (projectDir) {
|
|||||||
this._dirty = false;
|
this._dirty = false;
|
||||||
this.projectDir = projectDir;
|
this.projectDir = projectDir;
|
||||||
this.platformWww = path.join(this.projectDir, 'platform_www');
|
this.platformWww = path.join(this.projectDir, 'platform_www');
|
||||||
this.www = path.join(this.projectDir, 'assets/www');
|
|
||||||
if (AndroidStudio.isAndroidStudioProject(projectDir) === true) {
|
|
||||||
this.www = path.join(this.projectDir, 'app/src/main/assets/www');
|
this.www = path.join(this.projectDir, 'app/src/main/assets/www');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidProject.getProjectFile = function (projectDir) {
|
AndroidProject.getProjectFile = function (projectDir) {
|
||||||
@ -92,10 +88,7 @@ AndroidProject.purgeCache = function (projectDir) {
|
|||||||
* @return {String} The name of the package
|
* @return {String} The name of the package
|
||||||
*/
|
*/
|
||||||
AndroidProject.prototype.getPackageName = function () {
|
AndroidProject.prototype.getPackageName = function () {
|
||||||
var manifestPath = path.join(this.projectDir, 'AndroidManifest.xml');
|
var manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml');
|
||||||
if (AndroidStudio.isAndroidStudioProject(this.projectDir) === true) {
|
|
||||||
manifestPath = path.join(this.projectDir, 'app/src/main/AndroidManifest.xml');
|
|
||||||
}
|
|
||||||
return new AndroidManifest(manifestPath).getPackageId();
|
return new AndroidManifest(manifestPath).getPackageId();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
9
bin/templates/cordova/lib/AndroidStudio.js
vendored
9
bin/templates/cordova/lib/AndroidStudio.js
vendored
@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* This is a simple routine that checks if project is an Android Studio Project
|
|
||||||
*
|
|
||||||
* @param {String} root Root folder of the project
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports.isAndroidStudioProject = function isAndroidStudioProject (root) {
|
|
||||||
return true;
|
|
||||||
};
|
|
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user