CB-8320: We look for a build.gradle to make sure it's Android, not an 
AndroidManifest, because it moved


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/6c622f51
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/6c622f51
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/6c622f51

Branch: refs/heads/master
Commit: 6c622f51ace9a2a0bab73c5ec910e81f835199ba
Parents: f8b58c7
Author: Joe Bowser <bows...@apache.org>
Authored: Fri Feb 12 14:06:42 2016 -0800
Committer: Anis Kadri <a...@apache.org>
Committed: Wed Sep 14 16:49:10 2016 -0700

----------------------------------------------------------------------
 cordova-lib/src/cordova/metadata/android_parser.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/6c622f51/cordova-lib/src/cordova/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/android_parser.js 
b/cordova-lib/src/cordova/metadata/android_parser.js
index 2b3b211..7f3c114 100644
--- a/cordova-lib/src/cordova/metadata/android_parser.js
+++ b/cordova-lib/src/cordova/metadata/android_parser.js
@@ -31,7 +31,7 @@ var fs            = require('fs'),
 
 
 function android_parser(project) {
-    if (!fs.existsSync(path.join(project, 'AndroidManifest.xml'))) {
+    if (!fs.existsSync(path.join(project, 'build.gradle'))) {
         throw new CordovaError('The provided path "' + project + '" is not an 
Android project.');
     }
 
@@ -39,6 +39,12 @@ function android_parser(project) {
     Parser.call(this, 'android', project);
 
     this.path = project;
+
+    //If we have a gradle file but not a manifest, this is an Android Studio 
project
+    if(!fs.existsSync(path.join(project, "AndroidManifest.xml"))) {
+      this.path = path.join(project, 'app', 'src', 'main');
+    }
+
     this.strings = path.join(this.path, 'res', 'values', 'strings.xml');
     this.manifest = path.join(this.path, 'AndroidManifest.xml');
     this.android_config = path.join(this.path, 'res', 'xml', 'config.xml');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to