cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/2] cordova-common git commit: CB-11244: Spot fix for cordova-android PR #389
Date Tue, 17 Oct 2017 23:07:12 GMT
CB-11244: Spot fix for cordova-android PR #389


Project: http://git-wip-us.apache.org/repos/asf/cordova-common/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-common/commit/8b643096
Tree: http://git-wip-us.apache.org/repos/asf/cordova-common/tree/8b643096
Diff: http://git-wip-us.apache.org/repos/asf/cordova-common/diff/8b643096

Branch: refs/heads/master
Commit: 8b6430960e8aa6f1ef51e3ad218b11b773f89b1a
Parents: 7f4e5d7
Author: Joe Bowser <bowserj@apache.org>
Authored: Mon Oct 2 14:00:46 2017 -0700
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Mon Oct 16 17:00:31 2017 -0700

----------------------------------------------------------------------
 src/ConfigChanges/ConfigFile.js | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-common/blob/8b643096/src/ConfigChanges/ConfigFile.js
----------------------------------------------------------------------
diff --git a/src/ConfigChanges/ConfigFile.js b/src/ConfigChanges/ConfigFile.js
index a4a7331..330f2c1 100644
--- a/src/ConfigChanges/ConfigFile.js
+++ b/src/ConfigChanges/ConfigFile.js
@@ -184,16 +184,29 @@ function resolveConfigFilePath (project_dir, platform, file) {
         return filepath;
     }
 
-    // special-case config.xml target that is just "config.xml". This should be resolved
to the real location of the file.
-    // TODO: move the logic that contains the locations of config.xml from cordova CLI into
plugman.
+    // XXX this checks for android studio projects
+    // only if none of the options above are satisfied does this get called
+    // TODO: Move this out of cordova-common and into the platforms somehow
+    if (platform === 'android' && !fs.existsSync(filepath)) {
+        if(file === 'AndroidManifest.xml') {
+          filepath = path.join(project_dir, 'app', 'src', 'main', 'AndroidManifest.xml');
+        } else if(file.endsWith('config.xml')) {
+          filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
+        } else if(file.endsWith('strings.xml')) {
+          filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml');
+        }
+        return filepath;
+    }
+
+    // special-case config.xml target that is just "config.xml" for other platforms. This
should 
+    // be resolved to the real location of the file.
+    // TODO: Move this out of cordova-common into platforms
     if (file === 'config.xml') {
         if (platform === 'ubuntu') {
             filepath = path.join(project_dir, 'config.xml');
         } else if (platform === 'ios') {
             var iospath = getIOSProjectname(project_dir);
             filepath = path.join(project_dir, iospath, 'config.xml');
-        } else if (platform === 'android') {
-            filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
         } else {
             matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml'));
             if (matches.length) filepath = matches[0];
@@ -201,12 +214,6 @@ function resolveConfigFilePath (project_dir, platform, file) {
         return filepath;
     }
 
-    // XXX this checks for android studio projects
-    // only if none of the options above are satisfied does this get called
-    if (platform === 'android' && !fs.existsSync(filepath)) {
-        filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
-    }
-
     // None of the special cases matched, returning project_dir/file.
     return filepath;
 }


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


Mime
View raw message