You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/08/20 16:41:29 UTC

[1/4] git commit: ubuntu: support incremental builds

Repository: cordova-lib
Updated Branches:
  refs/heads/master 38e04e1fc -> 884852fa7


ubuntu: support incremental builds

github: close #73


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

Branch: refs/heads/master
Commit: 884852fa7f053d83c7dc9256ad88af02f1364fab
Parents: 22b67eb
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Aug 19 15:13:06 2014 +0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 20 10:41:18 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/ubuntu.js | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/884852fa/cordova-lib/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ubuntu.js b/cordova-lib/src/plugman/platforms/ubuntu.js
index 4fd01f2..bf2665b 100644
--- a/cordova-lib/src/plugman/platforms/ubuntu.js
+++ b/cordova-lib/src/plugman/platforms/ubuntu.js
@@ -53,10 +53,16 @@ module.exports = {
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
             var dest = path.join('build', 'src', 'plugins', plugin_id, path.basename(source_el.attrib.src));
             common.copyFile(plugin_dir, source_el.attrib.src, project_dir, dest);
+
+            var cmake = path.join(project_dir, 'build', 'CMakeLists.txt');
+            shell.exec('touch ' + cmake);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
             var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
             shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
+
+            var cmake = path.join(project_dir, 'build', 'CMakeLists.txt');
+            shell.exec('touch ' + cmake);
         }
     },
     'header-file':{


[2/4] git commit: ubuntu: use common.copyFile

Posted by ag...@apache.org.
ubuntu: use common.copyFile


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

Branch: refs/heads/master
Commit: cc768706d0fbcd0cadf0e2102719415493a890ce
Parents: ead6074
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Aug 19 16:03:07 2014 +0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 20 10:41:18 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/ubuntu.js | 29 ++++++++----------------
 1 file changed, 9 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/cc768706/cordova-lib/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ubuntu.js b/cordova-lib/src/plugman/platforms/ubuntu.js
index c422d7c..89e0ed8 100644
--- a/cordova-lib/src/plugman/platforms/ubuntu.js
+++ b/cordova-lib/src/plugman/platforms/ubuntu.js
@@ -32,8 +32,10 @@ function toCamelCase(str) {
     }).join('');
 }
 
-var fs = require('fs')
+var shell = require('shelljs')
+   , fs = require('fs')
    , path = require('path')
+   , common = require('./common')
    , events = require('../../events')
    , xml_helpers = require(path.join(__dirname, '..', '..', 'util', 'xml-helpers'));
 
@@ -49,26 +51,18 @@ module.exports = {
     },
     'source-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            var shell = require('shelljs');
-            var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
-            shell.mkdir(dest);
-            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
-
-            shell.exec('touch ' + path.join(project_dir, 'CMakeLists.txt'));
+            var dest = path.join('build', 'src', 'plugins', plugin_id, path.basename(source_el.attrib.src));
+            common.copyFile(plugin_dir, source_el.attrib.src, project_dir, dest);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
-            var shell = require('shelljs');
-
             var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
             shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
         }
     },
     'header-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            var shell = require('shelljs');
-            var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
-            shell.mkdir(dest);
-            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
+            var dest = path.join('build', 'src', 'plugins', plugin_id, path.basename(source_el.attrib.src));
+            common.copyFile(plugin_dir, source_el.attrib.src, project_dir, dest);
 
             var plugins = path.join(project_dir, 'build', 'src', 'coreplugins.cpp');
             var src = String(fs.readFileSync(plugins));
@@ -81,7 +75,6 @@ module.exports = {
             fs.writeFileSync(plugins, src);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
-            var shell = require('shelljs');
             var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
             shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
 
@@ -98,14 +91,10 @@ module.exports = {
     },
     'resource-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
-            var shell = require('shelljs');
-            var dest = path.join(project_dir, 'qml');
-            shell.mkdir(dest);
-            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
+            var dest = path.join('qml', path.basename(source_el.attrib.src));
+            common.copyFile(plugin_dir, source_el.attrib.src, project_dir, dest);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
-            var shell = require('shelljs');
-
             var dest = path.join(project_dir, 'qml');
             shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
         }


[3/4] git commit: ubuntu: support target-dir for resource-file

Posted by ag...@apache.org.
ubuntu: support target-dir for resource-file


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

Branch: refs/heads/master
Commit: 22b67eb2a6ab04d8e4d65c7c9a291ec35ed13840
Parents: cc76870
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Aug 19 15:10:17 2014 +0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 20 10:41:18 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/ubuntu.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/22b67eb2/cordova-lib/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ubuntu.js b/cordova-lib/src/plugman/platforms/ubuntu.js
index 89e0ed8..4fd01f2 100644
--- a/cordova-lib/src/plugman/platforms/ubuntu.js
+++ b/cordova-lib/src/plugman/platforms/ubuntu.js
@@ -92,10 +92,14 @@ module.exports = {
     'resource-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id) {
             var dest = path.join('qml', path.basename(source_el.attrib.src));
+            if (source_el.attrib['target-dir'])
+                dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib.src));
             common.copyFile(plugin_dir, source_el.attrib.src, project_dir, dest);
         },
         uninstall:function(source_el, project_dir, plugin_id) {
             var dest = path.join(project_dir, 'qml');
+            if (source_el.attrib['target-dir'])
+                dest = path.join(project_dir, source_el.attrib['target-dir']);
             shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
         }
     },


[4/4] git commit: ubuntu: check icon existence

Posted by ag...@apache.org.
ubuntu: check icon existence


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

Branch: refs/heads/master
Commit: ead6074df288916c5ec033ddda1af69fc4e3a45f
Parents: 38e04e1
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Aug 19 15:03:48 2014 +0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Aug 20 10:41:18 2014 -0400

----------------------------------------------------------------------
 .../src/cordova/metadata/ubuntu_parser.js       | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ead6074d/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 634a575..a199662 100644
--- a/cordova-lib/src/cordova/metadata/ubuntu_parser.js
+++ b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
@@ -87,14 +87,18 @@ module.exports.prototype = {
                          architecture: arch,
                          description: sanitize(this.config.description()) };
 
-        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';
-
-        name = sanitize(this.config.name()); //FIXME: escaping
-        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;
+        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) {
+            var iconPath = path.join(this.path, 'www', this.config.doc.find('icon').attrib.src);
+            if (fs.existsSync(iconPath))
+                content += '\nIcon=www/' + this.config.doc.find('icon').attrib.src;
+            else
+                return Q.reject(new Error('icon does not exist: ' + iconPath));
+        } else {
+            content += '\nIcon=qmlscene';
+            console.warn('missing icon element in config.xml');
         }
         fs.writeFileSync(path.join(this.path, 'manifest.json'), JSON.stringify(manifest));
         fs.writeFileSync(path.join(this.path, 'cordova.desktop'), content);