You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/01/19 02:16:04 UTC

[GitHub] fredgalvao commented on a change in pull request #633: [WIP] Quick fix for inconsistent SDK versions - WIP with TEST TODO

fredgalvao commented on a change in pull request #633: [WIP] Quick fix for inconsistent SDK versions - WIP with TEST TODO
URL: https://github.com/apache/cordova-android/pull/633#discussion_r249229882
 
 

 ##########
 File path: bin/templates/cordova/lib/builders/ProjectBuilder.js
 ##########
 @@ -89,17 +89,29 @@ class ProjectBuilder {
         };
     }
 
-    extractRealProjectNameFromManifest () {
+    getAndroidManifestInfo () {
         var manifestPath = path.join(this.root, 'app', 'src', 'main', 'AndroidManifest.xml');
         var manifestData = fs.readFileSync(manifestPath, 'utf8');
         var m = /<manifest[\s\S]*?package\s*=\s*"(.*?)"/i.exec(manifestData);
         if (!m) {
             throw new CordovaError('Could not find package name in ' + manifestPath);
         }
 
-        var packageName = m[1];
-        var lastDotIndex = packageName.lastIndexOf('.');
-        return packageName.substring(lastDotIndex + 1);
+        const m2 = /<uses-sdk[\s\S]*?android:minSdkVersion\s*=\s*"(.*?)"/i.exec(manifestData);
+        if (!m2) {
+            throw new CordovaError('Could not android:minSdkVersion in ' + manifestPath);
 
 Review comment:
   Was this supposed to be `Could not <find> android:min...`? The same applies to the `target` one bellow.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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