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/20 11:24:55 UTC

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

brodybits 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_r249274456
 
 

 ##########
 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:
   Yes, thanks!

----------------------------------------------------------------
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