incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [2/2] git commit: update android project name on each build
Date Thu, 30 Aug 2012 04:03:04 GMT
update android project name on each build


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/de8a06d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/de8a06d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/de8a06d4

Branch: refs/heads/cordova-client
Commit: de8a06d40e58725dbe5d2b959d5d0c318e5e0166
Parents: bb485e1
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Aug 29 20:59:55 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Wed Aug 29 20:59:55 2012 -0700

----------------------------------------------------------------------
 README.md    |    1 +
 src/build.js |   11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/de8a06d4/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8c7a2f0..fa3390c 100644
--- a/README.md
+++ b/README.md
@@ -148,5 +148,6 @@ mocks/stubs that we override for testing purposes.
 ## TO-DO
 
 - figure out versioning. for now: 2.1.0 minimum.
+- properly extracting info from config.xml
 - blackberry support
 - windows phone support

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/de8a06d4/src/build.js
----------------------------------------------------------------------
diff --git a/src/build.js b/src/build.js
index 3b79ecc..7873f2a 100644
--- a/src/build.js
+++ b/src/build.js
@@ -7,6 +7,7 @@ var cordova_util  = require('./util'),
     config_parser = require('./config_parser'),
     fs            = require('fs'),
     asyncblock    = require('asyncblock'),
+    et            = require('elementtree'),
     util          = require('util');
 
 module.exports = function build () {
@@ -33,15 +34,17 @@ module.exports = function build () {
                     assetsPath = path.join(projectRoot, 'platforms', 'android', 'assets',
'www');
                     js = path.join(__dirname, '..', 'lib', 'android', 'framework', 'assets',
'js', 'cordova.android.js');
 
-                    // TODO: drop activity name and package name into
-                    // appropriate places in android
+                    // update activity name
+                    var stringsXml = path.join(projectRoot, 'platforms', 'android', 'res',
'values', 'strings.xml');
+                    var strings = new et.ElementTree(et.XML(fs.readFileSync(stringsXml, 'utf-8')));
+                    strings.find('string[@name="app_name"]').text = name;
+                    fs.writeFileSync(stringsXml, strings.write(), 'utf-8');
                     break;
                 case 'ios':
                     assetsPath = path.join(projectRoot, 'platforms', 'ios', 'www');
                     js = path.join(__dirname, '..', 'lib', 'ios', 'CordovaLib', 'javascript',
'cordova.ios.js');
 
-                    // TODO: drop app name and id into
-                    // appropriate places in ios
+                    // TODO: update activity name
                     break;
             } 
 


Mime
View raw message