You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/10/17 00:52:59 UTC
[06/16] git commit: config.xml helper function is used,
removed error merge of wp folder.
config.xml helper function is used, removed error merge of wp folder.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/9e3fc875
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/9e3fc875
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/9e3fc875
Branch: refs/heads/master
Commit: 9e3fc87554570e6c0d01b993fa91d7afe4d01556
Parents: e13aaf5
Author: purplecabbage <pu...@gmail.com>
Authored: Fri Sep 27 16:56:52 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Tue Oct 15 14:28:44 2013 -0700
----------------------------------------------------------------------
src/metadata/windows8_parser.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9e3fc875/src/metadata/windows8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/windows8_parser.js b/src/metadata/windows8_parser.js
index 208bec2..a846c50 100644
--- a/src/metadata/windows8_parser.js
+++ b/src/metadata/windows8_parser.js
@@ -39,13 +39,15 @@ module.exports = function windows8_parser(project) {
throw new Error('The provided path "' + project + '" is not a Windows 8 project. ' + e);
}
this.manifest_path = path.join(this.windows8_proj_dir, 'Properties', 'WMAppManifest.xml');
- this.config_path = path.join(this.windows8_proj_dir, 'config.xml');
+ this.config_path = this.config_xml();
this.config = new util.config_parser(this.config_path);
};
module.exports.check_requirements = function(project_root, callback) {
events.emit('log', 'Checking windows8 requirements...');
- var lib_path = path.join(util.libDirectory, 'windows8', 'cordova', require('../../platforms').windows8.version, 'windows8');
+ var lib_path = path.join(util.libDirectory, 'windows8', 'cordova',
+ require('../../platforms').windows8.version, 'windows8');
+
var custom_path = config.has_custom_path(project_root, 'windows8');
if (custom_path) lib_path = custom_path;
var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"';
@@ -61,6 +63,7 @@ module.exports.check_requirements = function(project_root, callback) {
};
module.exports.prototype = {
+
update_from_config:function(config) {
//check config parser
if (config instanceof config_parser) {
@@ -83,10 +86,12 @@ module.exports.prototype = {
manifest.find('.//App').attrib.Author = name + " Author";
manifest.find('.//PrimaryToken').attrib.TokenID = name;
//update name of sln and jsproj.
- name = name.replace(/(\.\s|\s\.|\s+|\.+)/g, '_'); //make it a ligitamate name
+ name = name.replace(/(\.\s|\s\.|\s+|\.+)/g, '_'); //make it a valid name
prev_name = prev_name.replace(/(\.\s|\s\.|\s+|\.+)/g, '_');
// TODO: might return .sln.user? (generated file)
- var sln_name = fs.readdirSync(this.windows8_proj_dir).filter(function(e) { return e.match(/\.sln$/i); })[0];
+ var sln_name = fs.readdirSync(this.windows8_proj_dir).filter(function(e) {
+ return e.match(/\.sln$/i);
+ })[0];
var sln_path = path.join(this.windows8_proj_dir, sln_name);
var sln_file = fs.readFileSync(sln_path, 'utf-8');
var name_regex = new RegExp(prev_name, "g");
@@ -143,6 +148,7 @@ module.exports.prototype = {
return path.join(this.windows8_proj_dir, 'www');
},
config_xml:function() {
+ return path.join(this.windows8_proj_dir,"config.xml");
},
// copy files from merges directory to actual www dir
copy_merges:function(merges_sub_path) {
@@ -162,11 +168,11 @@ module.exports.prototype = {
shell.cp('-rf', project_www, this.windows8_proj_dir);
// copy all files from merges directories (generic first, then specific)
- this.copy_merges('wp');
this.copy_merges('windows8');
+
// copy over windows8 lib's cordova.js
- var lib_path = path.join(util.libDirectory, 'wp', 'cordova', require('../../platforms').windows8.version);
+ var lib_path = path.join(util.libDirectory, 'windows8', 'cordova', require('../../platforms').windows8.version);
var custom_path = config.has_custom_path(project_root, 'windows8');
if (custom_path) lib_path = custom_path;
var cordovajs_path = path.join(lib_path, 'common', 'www', 'cordova.js');