You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ge...@apache.org on 2015/10/22 16:22:49 UTC

cordova-lib git commit: CB-9736 - Extra main activity generated when an android package name is specified

Repository: cordova-lib
Updated Branches:
  refs/heads/master b89a50f1d -> 071eccd7e


CB-9736 - Extra main activity generated when an android package name is specified

Removes the old package name after the new one is created. If the package
name is different


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

Branch: refs/heads/master
Commit: 071eccd7eb33b61fe9dd706dfb520de10bfcfc83
Parents: b89a50f
Author: Gorkem Ercan <go...@gmail.com>
Authored: Wed Oct 21 17:32:08 2015 -0400
Committer: Gorkem Ercan <go...@gmail.com>
Committed: Wed Oct 21 17:32:08 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/071eccd7/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 6b36a42..7b2ea12 100644
--- a/cordova-lib/src/cordova/metadata/android_parser.js
+++ b/cordova-lib/src/cordova/metadata/android_parser.js
@@ -281,6 +281,20 @@ android_parser.prototype.update_from_config = function(config) {
     javs_contents = javs_contents.replace(/package [\w\.]*;/, 'package ' + pkg + ';');
     events.emit('verbose', 'Wrote out Android package name to "' + pkg + '"');
     fs.writeFileSync(new_javs, javs_contents, 'utf-8');
+    // remove the original if different from the new.
+    if(orig_pkgDir !== pkgDir){
+      shell.rm('-Rf',orig_javs);
+      // remove any empty directories
+      var curDir = path.dirname(orig_javs);
+      while(curDir !== path.resolve(this.path, 'src')) {
+          if(fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) {
+              fs.rmdirSync(curDir);
+              curDir = path.resolve(curDir, '..');
+            } else {
+              break;
+            }
+          }
+    }
 };
 
 // Returns the platform-specific www directory.


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