mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
First attempt at supporting Android Studio
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* This is a simple routine that checks if project is an Android Studio Project
|
||||
*
|
||||
* @param {String} root Root folder of the project
|
||||
*/
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
function isAndroidStudioProject(root) {
|
||||
var eclipseFiles = ['AndroidManifest.xml', 'libs', 'res', 'project.properties', 'platform_www'];
|
||||
var androidStudioFiles = ['app', 'gradle', 'build', 'app/src/main/assets'];
|
||||
for(file of eclipseFiles) {
|
||||
if(fs.existsSync(path.join(root, file))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(file of androidStudioFiles) {
|
||||
if(!fs.existsSync(path.join(root, file))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports.isAndroidStudioProject = isAndroidStudioProject;
|
||||
Reference in New Issue
Block a user