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/06 01:43:07 UTC
[01/11] git commit: workaround for qt 5.2
Repository: cordova-ubuntu
Updated Branches:
refs/heads/master 250ba9fcb -> 105879e8e
workaround for qt 5.2
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/0c28378e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/0c28378e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/0c28378e
Branch: refs/heads/master
Commit: 0c28378e833e56d2b2d8c4a63cfb34702983cf34
Parents: 77cda30
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Wed Apr 16 14:20:10 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
Cordovaqt/cordova_wrapper.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/0c28378e/Cordovaqt/cordova_wrapper.js
----------------------------------------------------------------------
diff --git a/Cordovaqt/cordova_wrapper.js b/Cordovaqt/cordova_wrapper.js
index e8d7193..a4be290 100644
--- a/Cordovaqt/cordova_wrapper.js
+++ b/Cordovaqt/cordova_wrapper.js
@@ -27,7 +27,7 @@ function addPlugin(pluginName, pluginObject) {
}
function messageHandler(message) {
- var received = JSON.parse(message.data);
+ var received = eval(message.data); // TODO: qt 5.2 have buggy JSON.parse. JSON.parse fails on FileApi tests
if (typeof received === 'undefined')
return false;
if (typeof received.messageType === 'undefined')
[04/11] git commit: bin/build: switch to async shelljs.exec
Posted by st...@apache.org.
bin/build: switch to async shelljs.exec
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/e4d45807
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/e4d45807
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/e4d45807
Branch: refs/heads/master
Commit: e4d45807644f8f0a453b112ae674727b24b1f4e0
Parents: 9d3f614
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Apr 14 15:04:35 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/lib/ubuntu.js | 160 ++++++++++++++++++++++++++-----------------
bin/create | 1 +
bin/package.json | 1 +
3 files changed, 100 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/e4d45807/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 35ff185..4285a21 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -25,6 +25,7 @@ var fs = require('fs');
var msg = require('./msg');
var assert = require('assert');
var colors = require('colors');
+var Q = require("q");
function exec(cmd) {
console.log(cmd.green);
@@ -38,6 +39,24 @@ function exec(cmd) {
return res;
}
+function execAsync(cmd) {
+ var deferred = Q.defer();
+
+ console.log(cmd.green);
+
+ shell.exec(cmd, { async: true }, function (code, output) {
+ var res = { code: code, output: output };
+ if (res.code !== 0) {
+ console.error(cmd.green + " " + "FAILED".underline.red);
+ process.exit(1);
+ }
+ deferred.resolve(res);
+ });
+
+ return deferred.promise;
+}
+
+
function cp(source, dest) {
console.log(('cp -Rf ' + source + ' ' + dest).green);
@@ -73,27 +92,32 @@ function buildArmPackage(campoDir, ubuntuDir, nobuild) {
pushd(path.join(armhfDir, 'build'));
- exec('click chroot -aarmhf -s trusty run cmake ' + campoDir + ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"');
- exec('find . -name AutomocInfo.cmake | xargs sed -i \'s;AM_QT_MOC_EXECUTABLE .*;AM_QT_MOC_EXECUTABLE "/usr/lib/\'$(dpkg-architecture -qDEB_BUILD_MULTIARCH)\'/qt5/bin/moc");\'');
- exec('click chroot -aarmhf -s trusty run make -j 6');
- exec('click chroot -aarmhf -s trusty run make install');
- cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
- cp(path.join(ubuntuDir, 'qml', '*'), path.join(prefixDir, 'qml'));
- cp(path.join(ubuntuDir, 'apparmor.json'), prefixDir);
- cp(path.join(ubuntuDir, 'cordova.desktop'), prefixDir);
- cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
-
- var content = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
- content.architecture = "armhf";
- fs.writeFileSync(path.join(prefixDir, 'manifest.json'), JSON.stringify(content));
-
- pushd(prefixDir);
-
- exec('click build .');
-
- popd();
-
- popd();
+ return execAsync('click chroot -aarmhf -s trusty run cmake ' + campoDir
+ + ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt -DCMAKE_INSTALL_PREFIX="'
+ + prefixDir + '"').then(function () {
+ exec('find . -name AutomocInfo.cmake | xargs sed -i \'s;AM_QT_MOC_EXECUTABLE .*;AM_QT_MOC_EXECUTABLE "/usr/lib/\'$(dpkg-architecture -qDEB_BUILD_MULTIARCH)\'/qt5/bin/moc");\'');
+ return execAsync('click chroot -aarmhf -s trusty run make -j 6');
+ }).then(function () {
+ return execAsync('click chroot -aarmhf -s trusty run make install');
+ }).then(function () {
+ cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
+ cp(path.join(ubuntuDir, 'qml', '*'), path.join(prefixDir, 'qml'));
+ cp(path.join(ubuntuDir, 'apparmor.json'), prefixDir);
+ cp(path.join(ubuntuDir, 'cordova.desktop'), prefixDir);
+ cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
+
+ var content = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
+ content.architecture = "armhf";
+ fs.writeFileSync(path.join(prefixDir, 'manifest.json'), JSON.stringify(content));
+
+ pushd(prefixDir);
+
+ return execAsync('click build .');
+ }).then(function () {
+ popd();
+
+ popd();
+ });
}
function buildNative(campoDir, ubuntuDir, nobuild) {
@@ -112,38 +136,40 @@ function buildNative(campoDir, ubuntuDir, nobuild) {
pushd(path.join(nativeDir, 'build'));
- exec('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"');
- exec('make -j 6; make install');
+ return execAsync('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"').then(function () {
+ return execAsync('make -j 6; make install');
+ }).then(function () {
+ cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
+ cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
+ cp(path.join(ubuntuDir, 'qml', '*'), path.join(prefixDir, 'qml'));
- cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
- cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
- cp(path.join(ubuntuDir, 'qml', '*'), path.join(prefixDir, 'qml'));
+ popd();
- popd();
+ var manifest = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
- var manifest = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
-
- assert(manifest.name.length);
- assert(manifest.name.indexOf(' ') == -1);
+ assert(manifest.name.length);
+ assert(manifest.name.indexOf(' ') == -1);
- var debDir = path.join(nativeDir, manifest.name);
+ var debDir = path.join(nativeDir, manifest.name);
- shell.rm('-rf', debDir);
- shell.mkdir('-p', path.join(debDir, 'opt', manifest.name));
- cp(path.join(prefixDir, '*'), path.join(debDir, 'opt', manifest.name));
+ shell.rm('-rf', debDir);
+ shell.mkdir('-p', path.join(debDir, 'opt', manifest.name));
+ cp(path.join(prefixDir, '*'), path.join(debDir, 'opt', manifest.name));
- var destDir = path.join('/opt', manifest.name);
- shell.mkdir('-p', path.join(debDir, 'usr', 'share', 'applications'));
- shell.mkdir('-p', path.join(debDir, 'DEBIAN'));
- fs.writeFileSync(path.join(debDir, 'DEBIAN', 'control'), 'Package: ' + manifest.name + '\nVersion: ' + manifest.version + '\nMaintainer: ' + manifest.maintainer + '\nArchitecture: ' + manifest.architecture + '\nDescription: ' + manifest.description + '\n')
- fs.writeFileSync(path.join(debDir, 'usr', 'share', 'applications', manifest.name + '.desktop'), '[Desktop Entry]\nName=' + manifest.title + '\nExec=' + path.join(destDir, 'cordova-ubuntu') + ' ' + path.join(destDir, 'www') + '\nIcon=qmlscene\nTerminal=false\nType=Application\nX-Ubuntu-Touch=true\n');
+ var destDir = path.join('/opt', manifest.name);
+ shell.mkdir('-p', path.join(debDir, 'usr', 'share', 'applications'));
+ shell.mkdir('-p', path.join(debDir, 'DEBIAN'));
+ fs.writeFileSync(path.join(debDir, 'DEBIAN', 'control'), 'Package: ' + manifest.name + '\nVersion: ' + manifest.version + '\nMaintainer: ' + manifest.maintainer + '\nArchitecture: ' + manifest.architecture + '\nDescription: ' + manifest.description + '\n')
+ fs.writeFileSync(path.join(debDir, 'usr', 'share', 'applications', manifest.name + '.desktop'), '[Desktop Entry]\nName=' + manifest.title + '\nExec=' + path.join(destDir, 'cordova-ubuntu') + ' ' + path.join(destDir, 'www') + '\nIcon=qmlscene\nTerminal=false\nType=Application\nX-Ubuntu-Touch=true\n');
- pushd(nativeDir);
+ pushd(nativeDir);
- exec('dpkg-deb -b "' + manifest.name + '" .');
- shell.rm('-rf', debDir);
+ return execAsync('dpkg-deb -b "' + manifest.name + '" .');
+ }).then(function () {
+ shell.rm('-rf', debDir);
- popd();
+ popd();
+ });
}
module.exports.ALL = 2;
@@ -157,10 +183,15 @@ module.exports.build = function(rootDir, target, nobuild) {
assert.ok(fs.existsSync(ubuntuDir));
assert.ok(fs.existsSync(campoDir));
- if (target === module.exports.PHONE || target === module.exports.ALL)
- buildArmPackage(campoDir, ubuntuDir, nobuild);
- if (target === module.exports.DESKTOP || target === module.exports.ALL)
- buildNative(campoDir, ubuntuDir, nobuild);
+ if (target === module.exports.PHONE)
+ return buildArmPackage(campoDir, ubuntuDir, nobuild);
+ if (target === module.exports.DESKTOP)
+ return buildNative(campoDir, ubuntuDir, nobuild);
+ if (target === module.exports.ALL) {
+ return buildArmPackage(campoDir, ubuntuDir, nobuild).then(function () {
+ return buildNative(campoDir, ubuntuDir, nobuild);
+ });
+ }
}
function runNative(rootDir, debug) {
@@ -169,14 +200,12 @@ function runNative(rootDir, debug) {
pushd(path.join(nativeDir, 'prefix'));
- if (debug) {
+ if (debug)
console.error('Debug enabled. Try pointing a WebKit browser to http://127.0.0.1:9222');
- exec('QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/');
- } else {
- exec('./cordova-ubuntu www/');
- }
- popd();
+ return execAsync('QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/').then(function () {
+ popd();
+ });
}
function deviceList() {
@@ -199,6 +228,11 @@ function adbExec(target, command) {
return exec('adb -s ' + target + ' ' + command);
}
+function adbExecAsync(target, command) {
+ assert.ok(target && command);
+ return execAsync('adb -s ' + target + ' ' + command);
+}
+
function isDeviceAttached(target) {
var res = adbExec(target, 'get-state');
@@ -248,17 +282,18 @@ function runOnDevice(rootDir, debug, target) {
adbExec(target, 'forward tcp:9222 tcp:9222');
}
- adbExec(target, 'shell "su - phablet -c \'cd /opt/click.ubuntu.com/' + appId + '/current; QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/ --desktop_file_hint=/opt/click.ubuntu.com/' + appId + '/current/cordova.desktop\'"');
-
- popd();
-
console.log('have fun!'.rainbow);
+
+ return adbExecAsync(target, 'shell "su - phablet -c \'cd /opt/click.ubuntu.com/' + appId + '/current; QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/ --desktop_file_hint=/opt/click.ubuntu.com/' + appId + '/current/cordova.desktop\'"').then(function () {
+ popd();
+ });
}
module.exports.run = function(rootDir, desktop, debug, target, nobuild) {
if (desktop) {
- module.exports.build(rootDir, module.exports.DESKTOP, nobuild);
- runNative(rootDir, debug);
+ return module.exports.build(rootDir, module.exports.DESKTOP, nobuild).then(function () {
+ return runNative(rootDir, debug);
+ });
} else {
if (!target) {
var devices = deviceList();
@@ -276,7 +311,8 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild) {
}
}
- module.exports.build(rootDir, module.exports.PHONE, nobuild);
- runOnDevice(rootDir, debug, target);
+ return module.exports.build(rootDir, module.exports.PHONE, nobuild).then(function () {
+ return runOnDevice(rootDir, debug, target);
+ });
}
}
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/e4d45807/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 3399672..2d83bef 100755
--- a/bin/create
+++ b/bin/create
@@ -57,6 +57,7 @@ function create(project_path, package_name, project_name, project_template_dir)
require.resolve("elementtree");
require.resolve("colors");
require.resolve("optimist");
+ require.resolve("q");
create_project();
} catch(e) {
console.log('Shelljs module was not found, running \'npm install\'.....');
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/e4d45807/bin/package.json
----------------------------------------------------------------------
diff --git a/bin/package.json b/bin/package.json
index c3991fc..bb2dc7a 100644
--- a/bin/package.json
+++ b/bin/package.json
@@ -18,6 +18,7 @@
"node": ">=0.10.0"
},
"dependencies": {
+ "q": "2.0.*",
"shelljs": "0.2.6",
"elementtree": "*",
"colors": "0.6.2",
[11/11] git commit: Merge branch 'master' of
https://github.com/Zaspire/cordova-ubuntu
Posted by st...@apache.org.
Merge branch 'master' of https://github.com/Zaspire/cordova-ubuntu
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/105879e8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/105879e8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/105879e8
Branch: refs/heads/master
Commit: 105879e8e86d7c1d1ed79066a0bbc5d47c46925e
Parents: 250ba9f 3b6762c
Author: Steven Gill <st...@gmail.com>
Authored: Mon May 5 16:42:56 2014 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Mon May 5 16:42:56 2014 -0700
----------------------------------------------------------------------
.editorconfig | 25 ++++++
Cordovaqt/cordova_wrapper.js | 5 +-
bin/build/build | 4 +-
bin/build/lib/ubuntu.js | 176 ++++++++++++++++++++++++--------------
bin/build/run | 4 +-
bin/check_reqs | 31 +++----
bin/create | 2 +
bin/package.json | 1 +
src/cordova.cpp | 38 ++++----
src/cordova.h | 23 +++--
10 files changed, 197 insertions(+), 112 deletions(-)
----------------------------------------------------------------------
[05/11] git commit: don't hard code cpu count
Posted by st...@apache.org.
don't hard code cpu count
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/94a65b96
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/94a65b96
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/94a65b96
Branch: refs/heads/master
Commit: 94a65b966e32ddeb46f204fa08a435a4ba38e88f
Parents: 4655347
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Apr 15 14:10:01 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/lib/ubuntu.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/94a65b96/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 79ba239..75c9f9f 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -26,6 +26,7 @@ var msg = require('./msg');
var assert = require('assert');
var colors = require('colors');
var Q = require("q");
+var os = require("os");
function exec(cmd) {
console.log(cmd.green);
@@ -76,6 +77,10 @@ function popd(dir) {
shell.popd();
}
+function cpuCount() {
+ return os.cpus().length;
+}
+
function buildArmPackage(campoDir, ubuntuDir, nobuild) {
var armhfDir = path.join(ubuntuDir, 'armhf');
var prefixDir = path.join(armhfDir, 'prefix');
@@ -97,7 +102,7 @@ function buildArmPackage(campoDir, ubuntuDir, nobuild) {
+ ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt -DCMAKE_INSTALL_PREFIX="'
+ prefixDir + '"').then(function () {
exec('find . -name AutomocInfo.cmake | xargs sed -i \'s;AM_QT_MOC_EXECUTABLE .*;AM_QT_MOC_EXECUTABLE "/usr/lib/\'$(dpkg-architecture -qDEB_BUILD_MULTIARCH)\'/qt5/bin/moc");\'');
- return execAsync('click chroot -aarmhf -f ' + framework + ' run make -j 6');
+ return execAsync('click chroot -aarmhf -f ' + framework + ' run make -j ' + cpuCount());
}).then(function () {
return execAsync('click chroot -aarmhf -f ' + framework + ' run make install');
}).then(function () {
@@ -137,8 +142,9 @@ function buildNative(campoDir, ubuntuDir, nobuild) {
pushd(path.join(nativeDir, 'build'));
+ var debDir;
return execAsync('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"').then(function () {
- return execAsync('make -j 6; make install');
+ return execAsync('make -j ' + cpuCount() + '; make install');
}).then(function () {
cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
@@ -151,7 +157,7 @@ function buildNative(campoDir, ubuntuDir, nobuild) {
assert(manifest.name.length);
assert(manifest.name.indexOf(' ') == -1);
- var debDir = path.join(nativeDir, manifest.name);
+ debDir = path.join(nativeDir, manifest.name);
shell.rm('-rf', debDir);
shell.mkdir('-p', path.join(debDir, 'opt', manifest.name));
[06/11] git commit: bin/build: specify framework instead of series
for click chroot
Posted by st...@apache.org.
bin/build: specify framework instead of series for click chroot
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/63bb865c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/63bb865c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/63bb865c
Branch: refs/heads/master
Commit: 63bb865cc4069ce265f157d3c4000737b2a5275a
Parents: e4d4580
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Apr 14 15:30:42 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/lib/ubuntu.js | 7 ++++---
bin/check_reqs | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/63bb865c/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 4285a21..36b55d6 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -79,6 +79,7 @@ function popd(dir) {
function buildArmPackage(campoDir, ubuntuDir, nobuild) {
var armhfDir = path.join(ubuntuDir, 'armhf');
var prefixDir = path.join(armhfDir, 'prefix');
+ var framework = "ubuntu-sdk-13.10";
if (nobuild && fs.existsSync(path.join(prefixDir, 'cordova-ubuntu'))) {
return;
@@ -92,13 +93,13 @@ function buildArmPackage(campoDir, ubuntuDir, nobuild) {
pushd(path.join(armhfDir, 'build'));
- return execAsync('click chroot -aarmhf -s trusty run cmake ' + campoDir
+ return execAsync('click chroot -aarmhf -f ' + framework + ' run cmake ' + campoDir
+ ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt -DCMAKE_INSTALL_PREFIX="'
+ prefixDir + '"').then(function () {
exec('find . -name AutomocInfo.cmake | xargs sed -i \'s;AM_QT_MOC_EXECUTABLE .*;AM_QT_MOC_EXECUTABLE "/usr/lib/\'$(dpkg-architecture -qDEB_BUILD_MULTIARCH)\'/qt5/bin/moc");\'');
- return execAsync('click chroot -aarmhf -s trusty run make -j 6');
+ return execAsync('click chroot -aarmhf -f ' + framework + ' run make -j 6');
}).then(function () {
- return execAsync('click chroot -aarmhf -s trusty run make install');
+ return execAsync('click chroot -aarmhf -f ' + framework + ' run make install');
}).then(function () {
cp(path.join(ubuntuDir, 'www', '*'), path.join(prefixDir, 'www'));
cp(path.join(ubuntuDir, 'qml', '*'), path.join(prefixDir, 'qml'));
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/63bb865c/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
index 01e2f01..2340fdd 100755
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -24,7 +24,7 @@ var exec = require('child_process').exec;
// FIXME: check for armhf
var deps = "cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev";
var depsArm = "cmake libicu-dev:armhf pkg-config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf qtsensors5-dev:armhf qtsystems5-dev:armhf";
-var series = "trusty";
+var framework = "ubuntu-sdk-13.10";
exec("dpkg-query -Wf'$${db:Status-abbrev}' click " + deps, function(error, stdout, stderr) {
if (error) {
console.error("Error: missing dependency " + deps);
@@ -38,13 +38,13 @@ exec("dpkg-query -Wf'$${db:Status-abbrev}' click " + deps, function(error, stdou
process.exit(error.code);
}
- exec("click chroot -aarmhf -s " + series + " run dpkg-query -l " + deps, function(error, stdout, stderr) {
+ exec("click chroot -aarmhf -f " + framework + " run dpkg-query -l " + deps, function(error, stdout, stderr) {
if (error) {
console.error("Error: missing armhf chroot");
-// to fix problem click chroot -aarmhf -s trusty maint
+// to fix problem click chroot -aarmhf -f ubuntu-sdk-13.10 maint
// dpkg --force-overwrite --force-conflicts -i /var/cache/apt/archives/qtbase5-dev_5.0.2+dfsg1-7ubuntu13_amd64.deb
// apt-get install -f
- console.error("run:\nclick chroot -aarmhf -s " + series + " create\n click chroot -aarmhf -s " + series + " install " + depsArm);
+ console.error("run:\nclick chroot -aarmhf -f " + framework + " create\n click chroot -aarmhf -f " + framework + " install " + depsArm);
process.exit(error.code);
}
}
[07/11] git commit: bin/build: fixes for --nobuild
Posted by st...@apache.org.
bin/build: fixes for --nobuild
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/46553475
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/46553475
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/46553475
Branch: refs/heads/master
Commit: 46553475de8818e4af526a95c343db2bcc8935bf
Parents: 63bb865
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Apr 14 15:46:36 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/lib/ubuntu.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/46553475/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 36b55d6..79ba239 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -82,7 +82,7 @@ function buildArmPackage(campoDir, ubuntuDir, nobuild) {
var framework = "ubuntu-sdk-13.10";
if (nobuild && fs.existsSync(path.join(prefixDir, 'cordova-ubuntu'))) {
- return;
+ return Q();
}
shell.rm('-rf', path.join(armhfDir, 'build'));
@@ -126,7 +126,7 @@ function buildNative(campoDir, ubuntuDir, nobuild) {
var prefixDir = path.join(nativeDir, 'prefix');
if (nobuild && fs.existsSync(path.join(prefixDir, 'cordova-ubuntu'))) {
- return;
+ return Q();
}
shell.rm('-rf', path.join(nativeDir, 'build'));
[09/11] git commit: allow inter plugin communication
Posted by st...@apache.org.
allow inter plugin communication
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/67869587
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/67869587
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/67869587
Branch: refs/heads/master
Commit: 67869587550e8dcc658360238f9e4c86c83d5b30
Parents: 02f8363
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Fri May 2 01:38:39 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Fri May 2 01:38:39 2014 +0400
----------------------------------------------------------------------
src/cordova.cpp | 38 +++++++++++++++++++-------------------
src/cordova.h | 23 ++++++++++++++++-------
2 files changed, 35 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/67869587/src/cordova.cpp
----------------------------------------------------------------------
diff --git a/src/cordova.cpp b/src/cordova.cpp
index 893e8f7..1c34a3e 100644
--- a/src/cordova.cpp
+++ b/src/cordova.cpp
@@ -24,19 +24,19 @@
#include <QQuickItem>
#include <QQmlContext>
-Cordova::Cordova(QDir wwwDir, QString contentFile, QQuickItem *item, QObject *parent): QObject(parent), m_item(item), m_www(wwwDir) {
- qDebug() << "Using" << m_www.absolutePath() << "as working dir";
+Cordova::Cordova(QDir wwwDir, QString contentFile, QQuickItem *item, QObject *parent): QObject(parent), _item(item), _www(wwwDir) {
+ qDebug() << "Using" << _www.absolutePath() << "as working dir";
- if (!m_www.exists(contentFile))
+ if (!_www.exists(contentFile))
qCritical() << contentFile << "does not exists";
- m_mainUrl = QUrl::fromUserInput(m_www.absoluteFilePath(contentFile)).toString();
+ _mainUrl = QUrl::fromUserInput(_www.absoluteFilePath(contentFile)).toString();
- qCritical() << QString(m_mainUrl);
+ qCritical() << QString(_mainUrl);
}
QString Cordova::get_app_dir() {
- return m_www.absolutePath();
+ return _www.absolutePath();
}
struct Splash {
@@ -45,7 +45,7 @@ struct Splash {
};
QString Cordova::getSplashscreenPath() {
- double ratio = (double)m_item->width() / m_item->height();
+ double ratio = (double)_item->width() / _item->height();
QDir dir(get_app_dir());
if (!dir.cd("splashscreen"))
@@ -58,7 +58,7 @@ QString Cordova::getSplashscreenPath() {
continue;
Splash t;
t.path = info.absoluteFilePath();
- t.rating = std::abs((image.width() / (double)m_item->width()) * ((image.width() / image.height()) / ratio) - 1);
+ t.rating = std::abs((image.width() / (double)_item->width()) * ((image.width() / image.height()) / ratio) - 1);
images.push_back(t);
}
std::min_element(images.begin(), images.end(), [](Splash &f, Splash &s) {
@@ -72,7 +72,7 @@ QString Cordova::getSplashscreenPath() {
void Cordova::initPlugins() {
QList<QDir> searchPath = {get_app_dir()};
- m_plugins.clear();
+ _plugins.clear();
for (QDir pluginsDir: searchPath) {
for (const QString &fileName: pluginsDir.entryList(QDir::Files)) {
QString path = pluginsDir.absoluteFilePath(fileName);
@@ -93,7 +93,7 @@ void Cordova::initPlugins() {
qDebug() << "Enable plugin" << plugin->fullName();
emit pluginWantsToBeAdded(plugin->fullName(), plugin.data(), plugin->shortName());
}
- m_plugins += plugins;
+ _plugins += plugins;
}
}
}
@@ -113,35 +113,35 @@ void Cordova::execJS(const QString &js) {
}
QString Cordova::mainUrl() const {
- return m_mainUrl;
+ return _mainUrl;
}
QObject *Cordova::topLevelEventsReceiver() {
- return dynamic_cast<QQuickView*>(m_item->window());
+ return dynamic_cast<QQuickView*>(_item->window());
}
QQuickItem *Cordova::rootObject() {
- return m_item->parentItem();
+ return _item->parentItem();
}
void Cordova::setTitle(const QString &title) {
- dynamic_cast<QQuickView*>(m_item->window())->setTitle(title);
+ dynamic_cast<QQuickView*>(_item->window())->setTitle(title);
}
void Cordova::pushViewState(const QString &state) {
- if (m_states.empty()) {
+ if (_states.empty()) {
rootObject()->setState(state);
}
- m_states.push_front(state);
+ _states.push_front(state);
}
void Cordova::popViewState(const QString &state) {
- if (!m_states.removeOne(state))
+ if (!_states.removeOne(state))
qDebug() << "WARNING: incorrect view states order";
- if (m_states.empty()) {
+ if (_states.empty()) {
rootObject()->setState("main");
} else {
- rootObject()->setState(m_states.front());
+ rootObject()->setState(_states.front());
}
}
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/67869587/src/cordova.h
----------------------------------------------------------------------
diff --git a/src/cordova.h b/src/cordova.h
index 48ad3b3..9c0fa7e 100644
--- a/src/cordova.h
+++ b/src/cordova.h
@@ -41,6 +41,17 @@ public:
void pushViewState(const QString &state);
void popViewState(const QString &state);
QString getSplashscreenPath();
+
+ template<typename A>
+ QSharedPointer<CPlugin> getPlugin() {
+ for (QSharedPointer<CPlugin> &plugin: _plugins) {
+ if (plugin->fullName() != A::fullID())
+ continue;
+ return plugin;
+ }
+
+ return QSharedPointer<CPlugin>();
+ }
signals:
void javaScriptExecNeeded(const QString &js);
void qmlExecNeeded(const QString &src);
@@ -53,16 +64,14 @@ public slots:
void execQML(const QString &src);
private:
- int m_alertCallback;
-
void initPlugins();
- QQuickItem *m_item;
- QList<QSharedPointer<CPlugin>> m_plugins;
+ QQuickItem *_item;
+ QList<QSharedPointer<CPlugin>> _plugins;
- QDir m_www;
- QString m_mainUrl;
- QList<QString> m_states;
+ QDir _www;
+ QString _mainUrl;
+ QList<QString> _states;
Q_DISABLE_COPY(Cordova)
};
[10/11] git commit: another qt 5.2 workaround
Posted by st...@apache.org.
another qt 5.2 workaround
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/3b6762c6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/3b6762c6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/3b6762c6
Branch: refs/heads/master
Commit: 3b6762c655c21cf635964cc45e66a5c365c915ff
Parents: 6786958
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Fri May 2 01:43:12 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Fri May 2 01:43:12 2014 +0400
----------------------------------------------------------------------
Cordovaqt/cordova_wrapper.js | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/3b6762c6/Cordovaqt/cordova_wrapper.js
----------------------------------------------------------------------
diff --git a/Cordovaqt/cordova_wrapper.js b/Cordovaqt/cordova_wrapper.js
index a4be290..3a4cddc 100644
--- a/Cordovaqt/cordova_wrapper.js
+++ b/Cordovaqt/cordova_wrapper.js
@@ -21,6 +21,9 @@
var pluginObjects = {}
+// qt 5.2 forbids assigning new properties to JS module
+// global variable used by plugins to store temporary data
+var global = {};
function addPlugin(pluginName, pluginObject) {
pluginObjects[pluginName] = pluginObject
[08/11] git commit: add .editorconfig
Posted by st...@apache.org.
add .editorconfig
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/02f83631
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/02f83631
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/02f83631
Branch: refs/heads/master
Commit: 02f836318184a123fba9c0b9f1725d6734cd5066
Parents: 0c28378
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Fri Apr 25 14:23:58 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Fri Apr 25 14:23:58 2014 +0400
----------------------------------------------------------------------
.editorconfig | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/02f83631/.editorconfig
----------------------------------------------------------------------
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..7fe54e5
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,25 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+# 4 space indentation
+[*.cpp]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.h]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.js]
+indent_style = space
+indent_size = 4
[03/11] git commit: bin/build/[build,run] always report errors
Posted by st...@apache.org.
bin/build/[build,run] always report errors
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/af5a228e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/af5a228e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/af5a228e
Branch: refs/heads/master
Commit: af5a228e1c72cb98ec12083c55ed94dc052b87b1
Parents: 94a65b9
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Apr 15 14:13:05 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/build | 2 +-
bin/build/run | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/af5a228e/bin/build/build
----------------------------------------------------------------------
diff --git a/bin/build/build b/bin/build/build
index 787ba6c..ed2635f 100755
--- a/bin/build/build
+++ b/bin/build/build
@@ -25,4 +25,4 @@ var platform = require('./lib/ubuntu');
var root = path.resolve();
var www = path.join(root, 'www');
-platform.build(root, platform.ALL);
+platform.build(root, platform.ALL).done();
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/af5a228e/bin/build/run
----------------------------------------------------------------------
diff --git a/bin/build/run b/bin/build/run
index 20b95cc..9345f07 100755
--- a/bin/build/run
+++ b/bin/build/run
@@ -26,5 +26,5 @@ var www = path.join(root, 'www');
var argv = require('optimist').boolean(['device', 'debug', 'nobuild']).string(['target']).argv;
-platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild);
+platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild).done();
[02/11] git commit: check requirements before build
Posted by st...@apache.org.
check requirements before build
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/77cda302
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/77cda302
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/77cda302
Branch: refs/heads/master
Commit: 77cda302b077d712bb4e938581febd1bce5efca2
Parents: af5a228
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Wed Apr 16 13:50:22 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Wed Apr 16 14:28:08 2014 +0400
----------------------------------------------------------------------
bin/build/build | 4 +++-
bin/build/lib/ubuntu.js | 5 +++++
bin/build/run | 4 +++-
bin/check_reqs | 27 ++++++++++-----------------
bin/create | 1 +
5 files changed, 22 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/77cda302/bin/build/build
----------------------------------------------------------------------
diff --git a/bin/build/build b/bin/build/build
index ed2635f..81810d3 100755
--- a/bin/build/build
+++ b/bin/build/build
@@ -25,4 +25,6 @@ var platform = require('./lib/ubuntu');
var root = path.resolve();
var www = path.join(root, 'www');
-platform.build(root, platform.ALL).done();
+platform.check_reqs(root).then(function () {
+ return platform.build(root, platform.ALL);
+}).done();
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/77cda302/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 75c9f9f..e7429fa 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -323,3 +323,8 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild) {
});
}
}
+
+module.exports.check_reqs = function(rootDir) {
+ var checkReqs = path.join(rootDir, 'platforms', 'ubuntu', 'cordova', 'check_reqs');
+ return execAsync(checkReqs);
+}
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/77cda302/bin/build/run
----------------------------------------------------------------------
diff --git a/bin/build/run b/bin/build/run
index 9345f07..923171d 100755
--- a/bin/build/run
+++ b/bin/build/run
@@ -26,5 +26,7 @@ var www = path.join(root, 'www');
var argv = require('optimist').boolean(['device', 'debug', 'nobuild']).string(['target']).argv;
-platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild).done();
+platform.check_reqs(root).then(function () {
+ return platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild);
+}).done();
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/77cda302/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
index 2340fdd..08166fb 100755
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -25,29 +25,22 @@ var exec = require('child_process').exec;
var deps = "cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev";
var depsArm = "cmake libicu-dev:armhf pkg-config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf qtsensors5-dev:armhf qtsystems5-dev:armhf";
var framework = "ubuntu-sdk-13.10";
-exec("dpkg-query -Wf'$${db:Status-abbrev}' click " + deps, function(error, stdout, stderr) {
- if (error) {
+
+exec("dpkg-query -Wf'${db:Status-abbrev}\n' click " + deps, function(error, stdout, stderr) {
+ if (error || stdout.indexOf('un') !== -1) {
console.error("Error: missing dependency " + deps);
- process.exit(error.code);
+ process.exit(2);
}
- exec("dpkg-query -Wf='${Version}' click", function(error, stdout, stderr) {
- //FIXME:
- if (error || stdout != "0.4.13") {
- console.error("Error: click package too old");
- process.exit(error.code);
- }
-
- exec("click chroot -aarmhf -f " + framework + " run dpkg-query -l " + deps, function(error, stdout, stderr) {
- if (error) {
- console.error("Error: missing armhf chroot");
+ exec("click chroot -aarmhf -f " + framework + " run dpkg-query -Wf'${db:Status-abbrev}\n' " + deps, function(error, stdout, stderr) {
+ if (error || stdout.indexOf('un') !== -1) {
+ console.error("Error: missing armhf chroot");
// to fix problem click chroot -aarmhf -f ubuntu-sdk-13.10 maint
// dpkg --force-overwrite --force-conflicts -i /var/cache/apt/archives/qtbase5-dev_5.0.2+dfsg1-7ubuntu13_amd64.deb
// apt-get install -f
- console.error("run:\nclick chroot -aarmhf -f " + framework + " create\n click chroot -aarmhf -f " + framework + " install " + depsArm);
- process.exit(error.code);
- }
+ console.error("run:\nsudo click chroot -aarmhf -f " + framework + " create\nsudo click chroot -aarmhf -f " + framework + " install " + depsArm);
+ process.exit(2);
}
})
-}
+});
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/77cda302/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index 2d83bef..bf5c25f 100755
--- a/bin/create
+++ b/bin/create
@@ -44,6 +44,7 @@ function create(project_path, package_name, project_name, project_template_dir)
shell.mkdir(path.join(project_path, 'armhf'));
shell.mkdir(path.join(project_path, 'native'));
shell.cp('-r', path.join(ROOT, 'bin/build/*'), path.join(project_path, 'cordova'));
+ shell.cp('-r', path.join(ROOT, 'bin/check_reqs'), path.join(project_path, 'cordova'));
shell.cp('-r', path.join(ROOT, 'bin/node_modules'), path.join(project_path, 'cordova'));