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 2014/05/08 02:31:38 UTC
git commit: CB-6594: pulled in CLI PR for ubuntu,
close apache/cordova-cli#136
Repository: cordova-lib
Updated Branches:
refs/heads/master 8ca5b87cf -> d6997c46e
CB-6594: pulled in CLI PR for ubuntu, close apache/cordova-cli#136
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/d6997c46
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/d6997c46
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/d6997c46
Branch: refs/heads/master
Commit: d6997c46e74cae0df1ff5d32c774dd28d08991b9
Parents: 8ca5b87
Author: Steven Gill <st...@gmail.com>
Authored: Wed May 7 17:31:29 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed May 7 17:31:29 2014 -0700
----------------------------------------------------------------------
cordova-lib/README.md | 15 +++++++++++++--
cordova-lib/src/cordova/ConfigParser.js | 4 ++--
cordova-lib/src/cordova/metadata/ubuntu_parser.js | 12 +++++++++---
3 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d6997c46/cordova-lib/README.md
----------------------------------------------------------------------
diff --git a/cordova-lib/README.md b/cordova-lib/README.md
index aacca52..f2f8067 100644
--- a/cordova-lib/README.md
+++ b/cordova-lib/README.md
@@ -19,5 +19,16 @@
#
-->
-#cordova-lib
-Contains code common to [cordova](https://github.com/apache/cordova-cli/) and [plugman](https://github.com/apache/cordova-plugman/).
\ No newline at end of file
+# cordova-lib
+Contains npm modules used primarily by [cordova](https://github.com/apache/cordova-cli/) and [plugman](https://github.com/apache/cordova-plugman/).
+
+## Setup
+* Clone this repository onto your local machine.
+ `git clone https://git-wip-us.apache.org/repos/asf/cordova-lib.git`
+* In terminal, navigate to the inner cordova-lib directory.
+ `cd cordova-lib/cordova-lib`
+* Install dependencies and npm-link
+ `npm install && npm link`
+* Navigate to CLI and Plugman directories and link cordova-lib
+ `cd ../../cordova-cli && npm link cordova-lib && npm install`
+ `cd ../../cordova-plugman && npm link cordova-lib && npm install`
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d6997c46/cordova-lib/src/cordova/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/ConfigParser.js b/cordova-lib/src/cordova/ConfigParser.js
index 262e75f..a6850d2 100644
--- a/cordova-lib/src/cordova/ConfigParser.js
+++ b/cordova-lib/src/cordova/ConfigParser.js
@@ -66,8 +66,8 @@ ConfigParser.prototype = {
description: function() {
return this.doc.find('description').text.trim();
},
- setDescription: function() {
- this.doc.find('description').text = name;
+ setDescription: function(text) {
+ this.doc.find('description').text = text;
var el = findOrCreate(this.doc, 'description');
},
version: function() {
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d6997c46/cordova-lib/src/cordova/metadata/ubuntu_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/ubuntu_parser.js b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
index 1ced342..c39bb0c 100644
--- a/cordova-lib/src/cordova/metadata/ubuntu_parser.js
+++ b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
@@ -102,20 +102,26 @@ module.exports.prototype = {
hooks: { cordova: { desktop: "cordova.desktop",
apparmor: "apparmor.json" } },
framework: "ubuntu-sdk-13.10",
- maintainer: sanitize(this.config.author()),
+ maintainer: sanitize(this.config.author()) + " <" + this.config.doc.find('author').attrib.email + ">",
architecture: arch,
description: sanitize(this.config.description()) };
- fs.writeFileSync(path.join(this.path, 'manifest.json'), JSON.stringify(manifest));
var name = this.config.name().replace(/\n/g, ' '); //FIXME: escaping
var content = "[Desktop Entry]\nName=" + name + "\nExec=./cordova-ubuntu www/\nIcon=qmlscene\nTerminal=false\nType=Application\nX-Ubuntu-Touch=true";
+ var name = sanitize(this.config.name()); //FIXME: escaping
+ var content = "[Desktop Entry]\nName=" + name + "\nExec=./cordova-ubuntu www/\nTerminal=false\nType=Application\nX-Ubuntu-Touch=true";
+
+ if (this.config.doc.find('icon') && this.config.doc.find('icon').attrib.src && fs.existsSync(path.join(this.path, 'www', this.config.doc.find('icon').attrib.src))) {
+ content += '\nIcon=www/' + this.config.doc.find('icon').attrib.src;
+ }
+ fs.writeFileSync(path.join(this.path, 'manifest.json'), JSON.stringify(manifest));
fs.writeFileSync(path.join(this.path, 'cordova.desktop'), content);
var policy = { policy_groups: ["networking", "audio"], policy_version: 1 };
this.config.doc.getroot().findall('./feature/param').forEach(function (element) {
- if (element.attrib.policy_group && policy.policy_groups.indexOf(policy.policy_groups) === -1)
+ if (element.attrib.policy_group && policy.policy_groups.indexOf(element.attrib.policy_group) === -1)
policy.policy_groups.push(element.attrib.policy_group);
});