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/08/26 22:46:34 UTC

[01/15] git commit: cplugin: add onAppLoaded

Repository: cordova-ubuntu
Updated Branches:
  refs/heads/master 431c103aa -> a003c32d3


cplugin: add onAppLoaded


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

Branch: refs/heads/master
Commit: 60a10cd281fcb2ae0407edb3c2a8cda6f3cd32b8
Parents: 431c103
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sat May 17 00:58:24 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:18:48 2014 +0400

----------------------------------------------------------------------
 Cordovaqt/CordovaViewInternal.qml | 3 ++-
 main.cpp                          | 1 -
 src/cordova.cpp                   | 9 ++++++++-
 src/cordova.h                     | 1 +
 src/cplugin.h                     | 2 ++
 src/qmlplugin.h                   | 4 ++++
 6 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/Cordovaqt/CordovaViewInternal.qml
----------------------------------------------------------------------
diff --git a/Cordovaqt/CordovaViewInternal.qml b/Cordovaqt/CordovaViewInternal.qml
index f61f3bd..a6d798a 100644
--- a/Cordovaqt/CordovaViewInternal.qml
+++ b/Cordovaqt/CordovaViewInternal.qml
@@ -85,7 +85,8 @@ Item {
 
             Component.onCompleted: {
                 root.mainWebview = webView;
-                webView.url = cordova.mainUrl
+                cordova.appLoaded();
+                webView.url = cordova.mainUrl;
             }
 
             onTitleChanged: {

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/main.cpp
----------------------------------------------------------------------
diff --git a/main.cpp b/main.cpp
index bfe9ab3..d726bff 100644
--- a/main.cpp
+++ b/main.cpp
@@ -103,7 +103,6 @@ int main(int argc, char *argv[]) {
     view.setResizeMode(QQuickView::SizeRootObjectToView);
     view.rootContext()->setContextProperty("overscroll", !disallowOverscroll);
     view.rootContext()->setContextProperty("content", content);
-
     view.setSource(QUrl(QString("%1/qml/main.qml").arg(workingDir.absolutePath())));
 
     if (fullscreen)

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/src/cordova.cpp
----------------------------------------------------------------------
diff --git a/src/cordova.cpp b/src/cordova.cpp
index 1c34a3e..bff0574 100644
--- a/src/cordova.cpp
+++ b/src/cordova.cpp
@@ -32,7 +32,14 @@ Cordova::Cordova(QDir wwwDir, QString contentFile, QQuickItem *item, QObject *pa
 
     _mainUrl = QUrl::fromUserInput(_www.absoluteFilePath(contentFile)).toString();
 
-    qCritical() << QString(_mainUrl);
+    qDebug() << _mainUrl;
+}
+
+void Cordova::appLoaded() {
+    initPlugins();
+    for (QSharedPointer<CPlugin> &plugin: _plugins) {
+        plugin->onAppLoaded();
+    }
 }
 
 QString Cordova::get_app_dir() {

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/src/cordova.h
----------------------------------------------------------------------
diff --git a/src/cordova.h b/src/cordova.h
index 9c0fa7e..c85de58 100644
--- a/src/cordova.h
+++ b/src/cordova.h
@@ -62,6 +62,7 @@ public slots:
     void execJS(const QString &js);
     void setTitle(const QString &title);
     void execQML(const QString &src);
+    void appLoaded();
 
 private:
     void initPlugins();

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/src/cplugin.h
----------------------------------------------------------------------
diff --git a/src/cplugin.h b/src/cplugin.h
index 58179ec..8bec212 100644
--- a/src/cplugin.h
+++ b/src/cplugin.h
@@ -107,6 +107,8 @@ public:
 
     virtual const QString fullName() = 0;
     virtual const QString shortName() = 0;
+    virtual void onAppLoaded() {
+    }
 protected:
     Cordova *m_cordova;
 private:

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/60a10cd2/src/qmlplugin.h
----------------------------------------------------------------------
diff --git a/src/qmlplugin.h b/src/qmlplugin.h
index a7e5882..f2a8965 100644
--- a/src/qmlplugin.h
+++ b/src/qmlplugin.h
@@ -88,6 +88,10 @@ public slots:
         }
         return _cordova->loadFinished(b);
     }
+    void appLoaded() {
+        assert(_cordova.data());
+        return _cordova->appLoaded();
+    }
 
 private:
     void initialize() {


[13/15] git commit: set policy_version in apparmor.json based on framework version

Posted by st...@apache.org.
set policy_version in apparmor.json based on framework version


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

Branch: refs/heads/master
Commit: 24367fe133409af6bfba02c3b53839fcf0cd09d5
Parents: 1f76dfe
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Jul 28 03:42:08 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:37 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/24367fe1/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index f17fae1..644856f 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -250,7 +250,6 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
     }).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);
 
@@ -259,6 +258,13 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
         content.framework = framework;
         fs.writeFileSync(path.join(prefixDir, 'manifest.json'), JSON.stringify(content));
 
+        content = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'apparmor.json'), {encoding: "utf8"}));
+        if (framework == 'ubuntu-sdk-13.10')
+            content.policy_version = 1;
+        else
+            content.policy_version = 1.1;
+        fs.writeFileSync(path.join(prefixDir, 'apparmor.json'), JSON.stringify(content));
+
         pushd(prefixDir);
 
         return execAsync('click build .');


[12/15] git commit: remove -flto from compiler flags

Posted by st...@apache.org.
remove -flto from compiler flags

gcc -flto produce broken binary on armhf


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

Branch: refs/heads/master
Commit: 1f76dfef6092db9abd89b9400e530c5301c104e2
Parents: 040c898
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sat Jun 28 08:34:12 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:31 2014 +0400

----------------------------------------------------------------------
 CMakeLists.txt          | 2 +-
 bin/build/lib/ubuntu.js | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/1f76dfef/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 274e135..b41e5e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ configure_file (
 SET(CMAKE_CXX_FLAGS "-std=c++11 -fno-omit-frame-pointer -Wall -Wextra -DCORDOVA_UBUNTU_VERSION=\\\"${VERSION}\\\" -DCORDOVA_UBUNTU_MAJOR_VERSION=${MAJOR_VERSION} -DCORDOVA_UBUNTU_MINOR_VERSION=${MINOR_VERSION} -I ${PROJECT_SOURCE_DIR}/src")
 
 if(CMAKE_BUILD_TYPE STREQUAL "Release")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -Os")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os")
 endif()
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g")

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/1f76dfef/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 3fcd02e..f17fae1 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -234,7 +234,6 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
     var cmakeCmd = 'click chroot -a' + architecture + ' -f ' + framework + ' run cmake ' + campoDir
               + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"' + ' -DCMAKE_BUILD_TYPE=' + buildType;
 
-
     if (framework == 'ubuntu-sdk-13.10')
         cmakeCmd += ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt';
 
@@ -354,11 +353,11 @@ module.exports.build = function(rootDir, target, nobuild, architecture, framewor
     assert.ok(fs.existsSync(campoDir));
 
     if (target === module.exports.PHONE)
-        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework);
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework, debug);
     if (target === module.exports.DESKTOP)
         return buildNative(campoDir, ubuntuDir, nobuild, debug);
     if (target === module.exports.ALL) {
-        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework).then(function () {
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework, debug).then(function () {
             return buildNative(campoDir, ubuntuDir, nobuild);
         });
     }


[07/15] git commit: bin/build/build: integrate with click-reviewers-tools

Posted by st...@apache.org.
bin/build/build: integrate with click-reviewers-tools


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

Branch: refs/heads/master
Commit: 042ecbe42ad439345bd55efe46d8126dd873f02f
Parents: a815d58
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Wed Jun 4 01:33:43 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:49 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 58 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/042ecbe4/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index a096c83..d834b79 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -28,10 +28,10 @@ var colors = require('colors');
 var Q = require("q");
 var os = require("os");
 
-function exec(cmd) {
+function exec(cmd, silent) {
     console.log(cmd.green);
 
-    var res = shell.exec(cmd);
+    var res = shell.exec(cmd, { silent: silent });
     if (res.code !== 0) {
         console.error(cmd.green + " " + "FAILED".underline.red);
         process.exit(1);
@@ -97,6 +97,59 @@ function checkChrootEnv(architecture, framework) {
     }
 }
 
+function checkClickPackage(prefixDir) {
+    pushd(prefixDir);
+
+    // 13.10 missing click-reviewers-tools package
+    // FIXME: remove this check after EOL
+    if (fs.existsSync('/usr/bin/click-run-checks')) {
+        var cmd = '/usr/bin/click-run-checks *.click';
+        console.log(cmd.green);
+        var output = shell.exec(cmd, { silent: true }).output;
+        var json = '[', b = 0;
+        for (var i = 0; i < output.length; i++) {
+            if (output[i] == '{') {
+                if (json.length > 1 && !b)
+                    json += ', ';
+                b++;
+            } else if (output[i] == '}') {
+                b--;
+                if (b == 0)
+                    json += '} ';
+            }
+            if (b > 0) {
+                json += output[i];
+            }
+        }
+        json += ']';
+        var out = JSON.parse(json);
+        for (var i = 0; i < out.length; i++) {
+            if (out[i].warn) {
+                for (var m in out[i].warn) {
+                    if (out[i].warn[m].text) {
+                        console.warn(out[i].warn[m].text.yellow);
+                        if (out[i].warn[m].link)
+                            console.warn(out[i].warn[m].link);
+                    }
+                }
+            }
+        }
+        for (var i = 0; i < out.length; i++) {
+            if (out[i].error) {
+                for (var m in out[i].error) {
+                    if (out[i].error[m].text) {
+                        console.warn(out[i].error[m].text.yellow);
+                        if (out[i].error[m].link)
+                            console.warn(out[i].error[m].link);
+                    }
+                }
+            }
+        }
+    }
+
+    popd();
+}
+
 function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework) {
     assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
 
@@ -145,6 +198,7 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
 
         return execAsync('click build .');
     }).then(function () {
+        checkClickPackage(prefixDir);
         popd();
 
         popd();


[15/15] git commit: bin/create: create www

Posted by st...@apache.org.
bin/create: create www


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

Branch: refs/heads/master
Commit: a003c32d39a863c33a99843374137a1d21412009
Parents: be0da07
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Aug 19 16:06:26 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 16:06:26 2014 +0400

----------------------------------------------------------------------
 bin/create | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/a003c32d/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index cd99fcc..92a9d61 100755
--- a/bin/create
+++ b/bin/create
@@ -49,6 +49,9 @@ function create(project_path, package_name, project_name, project_template_dir)
 
         shell.cp('-r', path.join(ROOT, 'xml/config.xml'), project_path);
 
+        shell.mkdir(path.join(project_path, 'www'));
+        shell.cp(path.join(ROOT, 'www/cordova.js'), path.join(project_path, 'www'));
+
         shell.cd(project_path);
     }
 


[11/15] git commit: change default to ubuntu-sdk-14.04

Posted by st...@apache.org.
change default to ubuntu-sdk-14.04


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

Branch: refs/heads/master
Commit: 040c8981e11bbe6ca4f9b2648b194368a5bc744d
Parents: fb39616
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sat Jun 28 08:08:49 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:23 2014 +0400

----------------------------------------------------------------------
 Cordovaqt/CordovaViewInternal.qml | 1 -
 bin/build/lib/ubuntu.js           | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/040c8981/Cordovaqt/CordovaViewInternal.qml
----------------------------------------------------------------------
diff --git a/Cordovaqt/CordovaViewInternal.qml b/Cordovaqt/CordovaViewInternal.qml
index bdfbbc9..f662cc8 100644
--- a/Cordovaqt/CordovaViewInternal.qml
+++ b/Cordovaqt/CordovaViewInternal.qml
@@ -121,7 +121,6 @@ Item {
                     webView.experimental.evaluateJavaScript(js);
                 }
                 onQmlExecNeeded: {
-                    console.log("2345");
                     eval(src);
                 }
                 onPluginWantsToBeAdded: {

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/040c8981/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 9283ed5..3fcd02e 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -28,6 +28,8 @@ var colors = require('colors');
 var Q = require("q");
 var os = require("os");
 
+var DEFAULT_FRAMEWORK = "ubuntu-sdk-14.04";
+
 function exec(cmd, silent) {
     console.log(cmd.green);
 
@@ -346,7 +348,7 @@ module.exports.build = function(rootDir, target, nobuild, architecture, framewor
     if (!architecture)
         architecture = 'armhf';
     if (!framework)
-        framework = "ubuntu-sdk-13.10";
+        framework = DEFAULT_FRAMEWORK;
 
     assert.ok(fs.existsSync(ubuntuDir));
     assert.ok(fs.existsSync(campoDir));
@@ -476,7 +478,7 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator
     }
 
     if (!framework)
-        framework = "ubuntu-sdk-13.10";
+        framework = DEFAULT_FRAMEWORK;
 
     if (!target) {
         var devices = deviceList();


[03/15] git commit: add support for non-arm based Ubuntu Touch devices

Posted by st...@apache.org.
add support for non-arm based Ubuntu Touch devices


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

Branch: refs/heads/master
Commit: 290260946db2b447e4d1ea26330a5638edfb2cc6
Parents: 1120af7
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sun Jun 1 23:46:52 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:02 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 57 +++++++++++++++++++++++++++++---------------
 1 file changed, 38 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/29026094/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index e7429fa..ae18659 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -81,30 +81,37 @@ function cpuCount() {
     return os.cpus().length;
 }
 
-function buildArmPackage(campoDir, ubuntuDir, nobuild) {
-    var armhfDir = path.join(ubuntuDir, 'armhf');
-    var prefixDir = path.join(armhfDir, 'prefix');
+function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture) {
+    assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
+
+    var archDir = path.join(ubuntuDir, architecture);
+    var prefixDir = path.join(archDir, 'prefix');
     var framework = "ubuntu-sdk-13.10";
 
+    if (!fs.existsSync(archDir))
+        shell.mkdir(archDir);
+
     if (nobuild && fs.existsSync(path.join(prefixDir, 'cordova-ubuntu'))) {
         return Q();
     }
 
-    shell.rm('-rf', path.join(armhfDir, 'build'));
+    shell.rm('-rf', path.join(archDir, 'build'));
 
     shell.rm('-rf', prefixDir);
-    shell.mkdir(path.join(armhfDir, 'build'));
+    shell.mkdir(path.join(archDir, 'build'));
     shell.mkdir(prefixDir);
 
-    pushd(path.join(armhfDir, 'build'));
+    pushd(path.join(archDir, 'build'));
 
-    return execAsync('click chroot -aarmhf -f ' + framework + ' run cmake ' + campoDir
+    return execAsync('click chroot -a' + architecture + ' -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 -f ' + framework + ' run make -j ' + cpuCount());
+
+        if (architecture != "i386")
+            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 -a' + architecture + ' -f ' + framework + ' run make -j ' + cpuCount());
     }).then(function () {
-        return execAsync('click chroot -aarmhf -f ' + framework + ' run make install');
+        return execAsync('click chroot -a' + architecture + ' -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'));
@@ -113,7 +120,7 @@ function buildArmPackage(campoDir, ubuntuDir, nobuild) {
         cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
 
         var content = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
-        content.architecture = "armhf";
+        content.architecture = architecture;
         fs.writeFileSync(path.join(prefixDir, 'manifest.json'), JSON.stringify(content));
 
         pushd(prefixDir);
@@ -183,19 +190,22 @@ module.exports.ALL = 2;
 module.exports.PHONE = 0;
 module.exports.DESKTOP = 1;
 
-module.exports.build = function(rootDir, target, nobuild) {
+module.exports.build = function(rootDir, target, nobuild, architecture) {
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
     var campoDir = path.join(ubuntuDir, 'build');
 
+    if (!architecture)
+        architecture = 'armhf';
+
     assert.ok(fs.existsSync(ubuntuDir));
     assert.ok(fs.existsSync(campoDir));
 
     if (target === module.exports.PHONE)
-        return buildArmPackage(campoDir, ubuntuDir, nobuild);
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture);
     if (target === module.exports.DESKTOP)
         return buildNative(campoDir, ubuntuDir, nobuild);
     if (target === module.exports.ALL) {
-        return buildArmPackage(campoDir, ubuntuDir, nobuild).then(function () {
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture).then(function () {
             return buildNative(campoDir, ubuntuDir, nobuild);
         });
     }
@@ -253,7 +263,15 @@ function isDeviceAttached(target) {
     return true;
 }
 
-function runOnDevice(rootDir, debug, target) {
+function getDeviceArch(target) {
+    var out = adbExec(target, 'shell dpkg --print-architecture').output.split('\r\n');
+
+    assert.ok(out.length == 2 && out[0].indexOf(' ') == -1);
+
+    return out[0];
+}
+
+function runOnDevice(rootDir, debug, target, architecture) {
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
 
     if (!isDeviceAttached(target)) {
@@ -261,8 +279,8 @@ function runOnDevice(rootDir, debug, target) {
         process.exit(1);
     }
 
-    var armhfDir = path.join(ubuntuDir, 'armhf');
-    var prefixDir = path.join(armhfDir, 'prefix');
+    var archDir = path.join(ubuntuDir, architecture);
+    var prefixDir = path.join(archDir, 'prefix');
 
     pushd(prefixDir);
 
@@ -317,9 +335,10 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild) {
                 console.warn(('running on ' + target).yellow);
             }
         }
+        var arch = getDeviceArch(target);
 
-        return module.exports.build(rootDir, module.exports.PHONE, nobuild).then(function () {
-             return runOnDevice(rootDir, debug, target);
+        return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch).then(function () {
+             return runOnDevice(rootDir, debug, target, arch);
         });
     }
 }


[04/15] git commit: add emulator support

Posted by st...@apache.org.
add emulator support


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

Branch: refs/heads/master
Commit: 11e4cf2d9a0d996832ed1929f0f53a3cd11f3f40
Parents: 2902609
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Jun 2 19:51:49 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:12 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/msg.js    |  3 ++-
 bin/build/lib/ubuntu.js | 42 ++++++++++++++++++++++++++----------------
 bin/build/run           |  4 ++--
 3 files changed, 30 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/11e4cf2d/bin/build/lib/msg.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/msg.js b/bin/build/lib/msg.js
index d45eb61..6125aa5 100644
--- a/bin/build/lib/msg.js
+++ b/bin/build/lib/msg.js
@@ -20,5 +20,6 @@
 */
 
 module.exports = {
-    UBUNTU_TOUCH_DEVICE_NOT_AVALIABLE: 'UbuntuTouch device is not attached'
+    UBUNTU_TOUCH_DEVICE_NOT_AVALIABLE: 'UbuntuTouch device is not attached',
+    EMULATOR_IS_NOT_RUNNING: 'UbuntuTouch emulator is not running'
 };

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/11e4cf2d/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index ae18659..b7f5ed2 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -314,33 +314,43 @@ function runOnDevice(rootDir, debug, target, architecture) {
     });
 }
 
-module.exports.run = function(rootDir, desktop, debug, target, nobuild) {
-    if (desktop) {
+module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator) {
+    if (desktop && !emulator) {
         return module.exports.build(rootDir, module.exports.DESKTOP, nobuild).then(function () {
             return runNative(rootDir, debug);
         });
-    } else {
-        if (!target) {
-            var devices = deviceList();
+    }
+
+    if (!target) {
+        var devices = deviceList();
+
+        if (!devices.length) {
+            console.error(msg.UBUNTU_TOUCH_DEVICE_NOT_AVALIABLE.red)
+            process.exit(1);
+        }
 
+        if (emulator) {
+            devices = devices.filter(function (name) {
+                return name.match(/^emulator-/);
+            });
             if (!devices.length) {
-                console.error(msg.UBUNTU_TOUCH_DEVICE_NOT_AVALIABLE.red)
+                console.error(msg.EMULATOR_IS_NOT_RUNNING.red)
                 process.exit(1);
             }
+        }
 
-            target = devices[0];
+        target = devices[0];
 
-            if (devices.length > 1) {
-                console.warn('you can specify target with --target <device id>'.yellow);
-                console.warn(('running on ' + target).yellow);
-            }
+        if (devices.length > 1) {
+            console.warn('you can specify target with --target <device id>'.yellow);
+            console.warn(('running on ' + target).yellow);
         }
-        var arch = getDeviceArch(target);
-
-        return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch).then(function () {
-             return runOnDevice(rootDir, debug, target, arch);
-        });
     }
+    var arch = getDeviceArch(target);
+
+    return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch).then(function () {
+        return runOnDevice(rootDir, debug, target, arch);
+    });
 }
 
 module.exports.check_reqs = function(rootDir) {

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/11e4cf2d/bin/build/run
----------------------------------------------------------------------
diff --git a/bin/build/run b/bin/build/run
index 923171d..a69b28a 100755
--- a/bin/build/run
+++ b/bin/build/run
@@ -24,9 +24,9 @@ var platform = require('./lib/ubuntu');
 var root = path.resolve();
 var www = path.join(root, 'www');
 
-var argv = require('optimist').boolean(['device', 'debug', 'nobuild']).string(['target']).argv;
+var argv = require('optimist').boolean(['device', 'emulator', 'debug', 'nobuild']).string(['target']).argv;
 
 platform.check_reqs(root).then(function () {
-    return platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild);
+    return platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild, argv.emulator);
 }).done();
 


[09/15] git commit: use different compiler flags for debug/release build

Posted by st...@apache.org.
use different compiler flags for debug/release 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/91aa1ea9
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/91aa1ea9
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/91aa1ea9

Branch: refs/heads/master
Commit: 91aa1ea98977a937193a82594a9128e06ac78dcf
Parents: 8978638
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sun Jun 22 04:36:27 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:10 2014 +0400

----------------------------------------------------------------------
 CMakeLists.txt          |  9 ++++++++-
 bin/build/build         |  2 +-
 bin/build/lib/ubuntu.js | 34 +++++++++++++++++++++++-----------
 3 files changed, 32 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/91aa1ea9/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e9f546..5ffcb09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,14 @@ configure_file (
   "${PROJECT_BINARY_DIR}/CordovaView.qml"
 )
 
-SET(CMAKE_CXX_FLAGS "-std=c++11 -fno-omit-frame-pointer -O2 -g -Wall -Wextra -DCORDOVA_UBUNTU_VERSION=\\\"${VERSION}\\\" -DCORDOVA_UBUNTU_MAJOR_VERSION=${MAJOR_VERSION} -DCORDOVA_UBUNTU_MINOR_VERSION=${MINOR_VERSION} -I ${PROJECT_SOURCE_DIR}/src")
+SET(CMAKE_CXX_FLAGS "-std=c++11 -fno-omit-frame-pointer -Wall -Wextra -DCORDOVA_UBUNTU_VERSION=\\\"${VERSION}\\\" -DCORDOVA_UBUNTU_MAJOR_VERSION=${MAJOR_VERSION} -DCORDOVA_UBUNTU_MINOR_VERSION=${MINOR_VERSION} -I ${PROJECT_SOURCE_DIR}/src")
+
+if(CMAKE_BUILD_TYPE STREQUAL "Release")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -Os")
+endif()
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g")
+endif()
 
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/qml
   COMMAND mkdir -p ${PROJECT_BINARY_DIR}/qml

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/91aa1ea9/bin/build/build
----------------------------------------------------------------------
diff --git a/bin/build/build b/bin/build/build
index e4caeba..e40d98e 100755
--- a/bin/build/build
+++ b/bin/build/build
@@ -28,5 +28,5 @@ var www = path.join(root, 'www');
 var argv = require('optimist').string(['framework']).argv;
 
 platform.check_reqs(root).then(function () {
-    return platform.build(root, platform.ALL, false, undefined, argv.framework);
+    return platform.build(root, platform.ALL, false, undefined, argv.framework, false);
 }).done();

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/91aa1ea9/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 1a0c9c6..dac2114 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -150,7 +150,7 @@ function checkClickPackage(prefixDir) {
     popd();
 }
 
-function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework) {
+function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework, debug) {
     assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
 
     var archDir = path.join(ubuntuDir, framework, architecture);
@@ -173,8 +173,12 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
 
     pushd(path.join(archDir, 'build'));
 
+    var buildType = '"Debug"';
+    if (!debug)
+        buildType = '"Release"';
+
     var cmakeCmd = 'click chroot -a' + architecture + ' -f ' + framework + ' run cmake ' + campoDir
-              + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"';
+              + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"' + ' -DCMAKE_BUILD_TYPE=' + buildType;
     if (framework == 'ubuntu-sdk-13.10')
         cmakeCmd += ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt';
     return execAsync(cmakeCmd).then(function () {
@@ -206,7 +210,7 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
     });
 }
 
-function buildNative(campoDir, ubuntuDir, nobuild) {
+function buildNative(campoDir, ubuntuDir, nobuild, debug) {
     var nativeDir = path.join(ubuntuDir, 'native');
     var prefixDir = path.join(nativeDir, 'prefix');
 
@@ -222,8 +226,13 @@ function buildNative(campoDir, ubuntuDir, nobuild) {
 
     pushd(path.join(nativeDir, 'build'));
 
+    var buildType = '"Debug"';
+    if (!debug)
+        buildType = '"Release"';
+
     var debDir;
-    return execAsync('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"').then(function () {
+    return execAsync('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"'
+                      + ' -DCMAKE_BUILD_TYPE=' + buildType).then(function () {
         return execAsync('make -j ' + cpuCount() + '; make install');
     }).then(function () {
         cp(path.join(ubuntuDir, 'config.xml'), prefixDir);
@@ -263,7 +272,7 @@ module.exports.ALL = 2;
 module.exports.PHONE = 0;
 module.exports.DESKTOP = 1;
 
-module.exports.build = function(rootDir, target, nobuild, architecture, framework) {
+module.exports.build = function(rootDir, target, nobuild, architecture, framework, debug) {
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
     var campoDir = path.join(ubuntuDir, 'build');
 
@@ -278,7 +287,7 @@ module.exports.build = function(rootDir, target, nobuild, architecture, framewor
     if (target === module.exports.PHONE)
         return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework);
     if (target === module.exports.DESKTOP)
-        return buildNative(campoDir, ubuntuDir, nobuild);
+        return buildNative(campoDir, ubuntuDir, nobuild, debug);
     if (target === module.exports.ALL) {
         return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework).then(function () {
             return buildNative(campoDir, ubuntuDir, nobuild);
@@ -292,10 +301,13 @@ function runNative(rootDir, debug) {
 
     pushd(path.join(nativeDir, 'prefix'));
 
-    if (debug)
-        console.error('Debug enabled. Try pointing a WebKit browser to http://127.0.0.1:9222');
+    var cmd = 'QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/';
+    if (debug) {
+        cmd = "DEBUG=1 " + cmd;
+        console.error('Debug enabled. Try pointing a WebKit browser to http://127.0.0.1:9222'.yellow);
+    }
 
-    return execAsync('QTWEBKIT_INSPECTOR_SERVER=9222 ./cordova-ubuntu www/').then(function () {
+    return execAsync(cmd).then(function () {
         popd();
     });
 }
@@ -391,7 +403,7 @@ function runOnDevice(rootDir, debug, target, architecture, framework) {
 
 module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator, framework) {
     if (desktop && !emulator) {
-        return module.exports.build(rootDir, module.exports.DESKTOP, nobuild).then(function () {
+        return module.exports.build(rootDir, module.exports.DESKTOP, nobuild, null, null, debug).then(function () {
             return runNative(rootDir, debug);
         });
     }
@@ -426,7 +438,7 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator
     }
     var arch = getDeviceArch(target);
 
-    return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch, framework).then(function () {
+    return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch, framework, debug).then(function () {
         return runOnDevice(rootDir, debug, target, arch, framework);
     });
 }


[05/15] git commit: bin/build/[build,run] add --framework option

Posted by st...@apache.org.
bin/build/[build,run] add --framework option


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

Branch: refs/heads/master
Commit: bb6b1b4632a68810207a0743434ed290c7d1042f
Parents: 11e4cf2
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Jun 3 01:52:43 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:23 2014 +0400

----------------------------------------------------------------------
 bin/build/build         |  4 +++-
 bin/build/lib/ubuntu.js | 29 +++++++++++++++++------------
 bin/build/run           |  4 ++--
 bin/create              |  1 -
 4 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/bb6b1b46/bin/build/build
----------------------------------------------------------------------
diff --git a/bin/build/build b/bin/build/build
index 81810d3..e4caeba 100755
--- a/bin/build/build
+++ b/bin/build/build
@@ -25,6 +25,8 @@ var platform = require('./lib/ubuntu');
 var root = path.resolve();
 var www = path.join(root, 'www');
 
+var argv = require('optimist').string(['framework']).argv;
+
 platform.check_reqs(root).then(function () {
-    return platform.build(root, platform.ALL);
+    return platform.build(root, platform.ALL, false, undefined, argv.framework);
 }).done();

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/bb6b1b46/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index b7f5ed2..7ef54ba 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -81,15 +81,14 @@ function cpuCount() {
     return os.cpus().length;
 }
 
-function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture) {
+function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework) {
     assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
 
-    var archDir = path.join(ubuntuDir, architecture);
+    var archDir = path.join(ubuntuDir, framework, architecture);
     var prefixDir = path.join(archDir, 'prefix');
-    var framework = "ubuntu-sdk-13.10";
 
     if (!fs.existsSync(archDir))
-        shell.mkdir(archDir);
+        shell.mkdir('-p', archDir);
 
     if (nobuild && fs.existsSync(path.join(prefixDir, 'cordova-ubuntu'))) {
         return Q();
@@ -121,6 +120,7 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture) {
 
         var content = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'manifest.json'), {encoding: "utf8"}));
         content.architecture = architecture;
+        content.framework = framework;
         fs.writeFileSync(path.join(prefixDir, 'manifest.json'), JSON.stringify(content));
 
         pushd(prefixDir);
@@ -190,22 +190,24 @@ module.exports.ALL = 2;
 module.exports.PHONE = 0;
 module.exports.DESKTOP = 1;
 
-module.exports.build = function(rootDir, target, nobuild, architecture) {
+module.exports.build = function(rootDir, target, nobuild, architecture, framework) {
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
     var campoDir = path.join(ubuntuDir, 'build');
 
     if (!architecture)
         architecture = 'armhf';
+    if (!framework)
+        framework = "ubuntu-sdk-13.10";
 
     assert.ok(fs.existsSync(ubuntuDir));
     assert.ok(fs.existsSync(campoDir));
 
     if (target === module.exports.PHONE)
-        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture);
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework);
     if (target === module.exports.DESKTOP)
         return buildNative(campoDir, ubuntuDir, nobuild);
     if (target === module.exports.ALL) {
-        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture).then(function () {
+        return buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework).then(function () {
             return buildNative(campoDir, ubuntuDir, nobuild);
         });
     }
@@ -271,7 +273,7 @@ function getDeviceArch(target) {
     return out[0];
 }
 
-function runOnDevice(rootDir, debug, target, architecture) {
+function runOnDevice(rootDir, debug, target, architecture, framework) {
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
 
     if (!isDeviceAttached(target)) {
@@ -279,7 +281,7 @@ function runOnDevice(rootDir, debug, target, architecture) {
         process.exit(1);
     }
 
-    var archDir = path.join(ubuntuDir, architecture);
+    var archDir = path.join(ubuntuDir, framework, architecture);
     var prefixDir = path.join(archDir, 'prefix');
 
     pushd(prefixDir);
@@ -314,13 +316,16 @@ function runOnDevice(rootDir, debug, target, architecture) {
     });
 }
 
-module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator) {
+module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator, framework) {
     if (desktop && !emulator) {
         return module.exports.build(rootDir, module.exports.DESKTOP, nobuild).then(function () {
             return runNative(rootDir, debug);
         });
     }
 
+    if (!framework)
+        framework = "ubuntu-sdk-13.10";
+
     if (!target) {
         var devices = deviceList();
 
@@ -348,8 +353,8 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator
     }
     var arch = getDeviceArch(target);
 
-    return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch).then(function () {
-        return runOnDevice(rootDir, debug, target, arch);
+    return module.exports.build(rootDir, module.exports.PHONE, nobuild, arch, framework).then(function () {
+        return runOnDevice(rootDir, debug, target, arch, framework);
     });
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/bb6b1b46/bin/build/run
----------------------------------------------------------------------
diff --git a/bin/build/run b/bin/build/run
index a69b28a..8a1d9ca 100755
--- a/bin/build/run
+++ b/bin/build/run
@@ -24,9 +24,9 @@ var platform = require('./lib/ubuntu');
 var root = path.resolve();
 var www = path.join(root, 'www');
 
-var argv = require('optimist').boolean(['device', 'emulator', 'debug', 'nobuild']).string(['target']).argv;
+var argv = require('optimist').boolean(['device', 'emulator', 'debug', 'nobuild']).string(['target', 'framework']).argv;
 
 platform.check_reqs(root).then(function () {
-    return platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild, argv.emulator);
+    return platform.run(root, !argv.device, argv.debug, argv.target, argv.nobuild, argv.emulator, argv.framework);
 }).done();
 

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/bb6b1b46/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index bf5c25f..cd99fcc 100755
--- a/bin/create
+++ b/bin/create
@@ -41,7 +41,6 @@ function create(project_path, package_name, project_name, project_template_dir)
         }
         shell.mkdir(project_path);
         shell.cp('-r', path.join(ROOT, '*'), path.join(project_path, 'build'));
-        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'));


[08/15] git commit: fix build problem with ubuntu-sdk-14.04

Posted by st...@apache.org.
fix build problem with ubuntu-sdk-14.04


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

Branch: refs/heads/master
Commit: 89786384bf9da4f92ef2af63fb38516d0e6b1c6a
Parents: 042ecbe
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Jun 10 00:28:11 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:00 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/89786384/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index d834b79..1a0c9c6 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -173,10 +173,11 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
 
     pushd(path.join(archDir, 'build'));
 
-    return execAsync('click chroot -a' + architecture + ' -f ' + framework + ' run cmake ' + campoDir
-              + ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt -DCMAKE_INSTALL_PREFIX="'
-              + prefixDir + '"').then(function () {
-
+    var cmakeCmd = 'click chroot -a' + architecture + ' -f ' + framework + ' run cmake ' + campoDir
+              + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"';
+    if (framework == 'ubuntu-sdk-13.10')
+        cmakeCmd += ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt';
+    return execAsync(cmakeCmd).then(function () {
         if (architecture != "i386")
             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 -a' + architecture + ' -f ' + framework + ' run make -j ' + cpuCount());


[14/15] git commit: switch to incremental build

Posted by st...@apache.org.
switch to incremental 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/be0da07c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/be0da07c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/be0da07c

Branch: refs/heads/master
Commit: be0da07cf912bc6fe8767f9faf3412be12e9158c
Parents: 24367fe
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Wed Jul 30 02:33:48 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:47 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/be0da07c/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 644856f..48c7725 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -286,7 +286,6 @@ function buildNative(campoDir, ubuntuDir, nobuild, debug) {
 
     checkEnv(ubuntuDir);
 
-    shell.rm('-rf', path.join(nativeDir, 'build'));
     shell.rm('-rf', prefixDir);
 
     shell.mkdir(path.join(nativeDir, 'build'));


[06/15] git commit: bin/build/build: check chroot env before build

Posted by st...@apache.org.
bin/build/build: check chroot env 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/a815d583
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/a815d583
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/a815d583

Branch: refs/heads/master
Commit: a815d5834d4699bed76002b6b7eb83f741de2bc9
Parents: bb6b1b4
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Jun 3 02:21:32 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:31 2014 +0400

----------------------------------------------------------------------
 bin/build/lib/ubuntu.js | 18 ++++++++++++++++++
 bin/check_reqs          | 16 +---------------
 2 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/a815d583/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 7ef54ba..a096c83 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -81,6 +81,22 @@ function cpuCount() {
     return os.cpus().length;
 }
 
+function checkChrootEnv(architecture, framework) {
+    var deps = "cmake libicu-dev:ARCH pkg-config qtbase5-dev:ARCH qtchooser qtdeclarative5-dev:ARCH qtfeedback5-dev:ARCH qtlocation5-dev:ARCH qtmultimedia5-dev:ARCH qtpim5-dev:ARCH qtsensors5-dev:ARCH qtsystems5-dev:ARCH";
+    deps = deps.replace(/ARCH/g, architecture);
+
+    var cmd = "click chroot -a" + architecture + " -f " + framework + " run dpkg-query -Wf'${db:Status-abbrev}' " + deps;
+    console.log(cmd.green);
+    res = shell.exec(cmd);
+
+    if (res.code !== 0 || res.output.indexOf('un') !== -1) {
+        console.error(("Error: missing " + architecture + " chroot").red);
+        console.error(("run:\nsudo click chroot -a" + architecture + " -f " + framework + " create").red);
+        console.error(("sudo click chroot -a" + architecture + " -f " + framework + " install " + deps).red);
+        process.exit(2);
+    }
+}
+
 function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework) {
     assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
 
@@ -94,6 +110,8 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
         return Q();
     }
 
+    checkChrootEnv(architecture, framework);
+
     shell.rm('-rf', path.join(archDir, 'build'));
 
     shell.rm('-rf', prefixDir);

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/a815d583/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
index 08166fb..3b84541 100755
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -21,26 +21,12 @@
 
 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 framework = "ubuntu-sdk-13.10";
 
-exec("dpkg-query -Wf'${db:Status-abbrev}\n' click " + deps, function(error, stdout, stderr) {
+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(2);
     }
-
-    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:\nsudo click chroot -aarmhf -f " + framework + " create\nsudo click chroot -aarmhf -f " + framework + " install " + depsArm);
-            process.exit(2);
-        }
-    })
 });
 


[02/15] git commit: CordovaViewInternal: add overrideScheme

Posted by st...@apache.org.
CordovaViewInternal: add overrideScheme


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

Branch: refs/heads/master
Commit: 1120af7a028dbac7006aef4b6a7f2c4b7f9078aa
Parents: 60a10cd
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Sat May 17 00:59:09 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:18:53 2014 +0400

----------------------------------------------------------------------
 Cordovaqt/CordovaViewInternal.qml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/1120af7a/Cordovaqt/CordovaViewInternal.qml
----------------------------------------------------------------------
diff --git a/Cordovaqt/CordovaViewInternal.qml b/Cordovaqt/CordovaViewInternal.qml
index a6d798a..bdfbbc9 100644
--- a/Cordovaqt/CordovaViewInternal.qml
+++ b/Cordovaqt/CordovaViewInternal.qml
@@ -42,6 +42,20 @@ Item {
         return CordovaWrapper.pluginObjects[plugin];
     }
 
+    function overrideScheme(schemeName, pluginName) {
+        var handler = Qt.createQmlObject("import QtWebKit.experimental 1.0;"
+            + "UrlSchemeDelegate { scheme: '" + schemeName + "';"
+            + "onReceivedRequest: { var data = plugin('" + pluginName + "').handleUri(request.url); reply.data = data; reply.contentType = 'application/octet-stream'; reply.send(); } } ", webView);
+
+        var handlers = [];
+        // QQmlListProperty (qt 5.2) does not support appending items from qml
+        for (var i in webView.experimental.urlSchemeDelegates)
+            handlers.push(webView.experimental.urlSchemeDelegates[i])
+
+        handlers.push(handler);
+        webView.experimental.urlSchemeDelegates = handlers;
+    }
+
     Rectangle {
         id: webViewContainer
         anchors.fill: parent


[10/15] git commit: plugin could specify additional build dependency

Posted by st...@apache.org.
plugin could specify additional build dependency


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

Branch: refs/heads/master
Commit: fb396160a6fb16a8cd08cef6f6e25a0b52a3c554
Parents: 91aa1ea
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Fri Jun 27 04:56:42 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:20:16 2014 +0400

----------------------------------------------------------------------
 CMakeLists.txt          |  8 ++++-
 bin/build/lib/ubuntu.js | 77 +++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 79 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/fb396160/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ffcb09..274e135 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,12 @@ add_custom_target(copy_wwwqmlxml DEPENDS ${PROJECT_BINARY_DIR}/CordovaUbuntu.${V
 
 find_package(Qt5Widgets)
 find_package(Qt5Core)
+find_package(PkgConfig)
+
+pkg_check_modules(PLUGIN_DEPS REQUIRED ${ADDITIONAL_DEPENDECIES})
+
+include_directories(${PLUGIN_DEPS_INCLUDE_DIRS})
+link_directories(${PLUGIN_DEPS_LIBRARY_DIRS})
 
 add_executable(cordova-ubuntu
   main.cpp
@@ -84,7 +90,7 @@ ADD_LIBRARY(coreplugins SHARED
 qt5_use_modules(coreplugins Widgets Location Sensors Feedback SystemInfo Contacts Multimedia Quick MultimediaWidgets)
 
 target_link_libraries(cordova-ubuntu cordovaubuntuplugin)
-target_link_libraries(coreplugins cordovaubuntuplugin)
+target_link_libraries(coreplugins cordovaubuntuplugin ${PLUGIN_DEPS_LIBRARIES})
 
 # Qt5's cmake does not export QT_IMPORTS_DIR, lets query qmake on our own for now
 get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/fb396160/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index dac2114..9283ed5 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -81,8 +81,25 @@ function cpuCount() {
     return os.cpus().length;
 }
 
-function checkChrootEnv(architecture, framework) {
-    var deps = "cmake libicu-dev:ARCH pkg-config qtbase5-dev:ARCH qtchooser qtdeclarative5-dev:ARCH qtfeedback5-dev:ARCH qtlocation5-dev:ARCH qtmultimedia5-dev:ARCH qtpim5-dev:ARCH qtsensors5-dev:ARCH qtsystems5-dev:ARCH";
+function additionalDependencies(ubuntuDir) {
+    var files = [];
+    try {
+        files = fs.readdirSync(path.join(ubuntuDir, 'configs')).filter(function(s) {
+            return s[0] != '.';
+        });
+    } catch (e) {}
+    var deb = [];
+    for (var i = 0; i < files.length; i++) {
+        var config = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'configs', files[i])));
+        if (config.deb)
+            deb = deb.concat(config.deb);
+    }
+    return deb;
+}
+
+function checkChrootEnv(ubuntuDir, architecture, framework) {
+    var deps = "cmake libicu-dev:ARCH pkg-config qtbase5-dev:ARCH qtchooser qtdeclarative5-dev:ARCH qtfeedback5-dev:ARCH qtlocation5-dev:ARCH qtmultimedia5-dev:ARCH qtpim5-dev:ARCH qtsensors5-dev:ARCH qtsystems5-dev:ARCH ";
+    deps += additionalDependencies(ubuntuDir).join(' ');
     deps = deps.replace(/ARCH/g, architecture);
 
     var cmd = "click chroot -a" + architecture + " -f " + framework + " run dpkg-query -Wf'${db:Status-abbrev}' " + deps;
@@ -97,6 +114,23 @@ function checkChrootEnv(architecture, framework) {
     }
 }
 
+function checkEnv(ubuntuDir) {
+    var deps = additionalDependencies(ubuntuDir).join(' ');
+    deps = deps.replace(/:ARCH/g, '');
+
+    if (!deps.length)
+        return;
+
+    var cmd = "dpkg-query -Wf'${db:Status-abbrev}' " + deps;
+    console.log(cmd.green);
+    res = shell.exec(cmd);
+
+    if (res.code !== 0 || res.output.indexOf('un') !== -1) {
+        console.error(("Error: missing packages" + deps).red);
+        process.exit(2);
+    }
+}
+
 function checkClickPackage(prefixDir) {
     pushd(prefixDir);
 
@@ -150,6 +184,24 @@ function checkClickPackage(prefixDir) {
     popd();
 }
 
+function additionalBuildDependencies(ubuntuDir) {
+    var files = [];
+    try {
+        files = fs.readdirSync(path.join(ubuntuDir, 'configs')).filter(function(s) {
+            return s[0] != '.';
+        });
+    } catch (e) {}
+
+    var pkgConfig = [];
+    for (var i = 0; i < files.length; i++) {
+        var config = JSON.parse(fs.readFileSync(path.join(ubuntuDir, 'configs', files[i])));
+        if (config.pkgConfig)
+            pkgConfig = pkgConfig.concat(config.pkgConfig);
+    }
+
+    return pkgConfig;
+}
+
 function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework, debug) {
     assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
 
@@ -163,7 +215,7 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
         return Q();
     }
 
-    checkChrootEnv(architecture, framework);
+    checkChrootEnv(ubuntuDir, architecture, framework);
 
     shell.rm('-rf', path.join(archDir, 'build'));
 
@@ -179,8 +231,15 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
 
     var cmakeCmd = 'click chroot -a' + architecture + ' -f ' + framework + ' run cmake ' + campoDir
               + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"' + ' -DCMAKE_BUILD_TYPE=' + buildType;
+
+
     if (framework == 'ubuntu-sdk-13.10')
         cmakeCmd += ' -DCMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt';
+
+    var deps = additionalBuildDependencies(ubuntuDir).join(' ').replace(/ARCH/g, architecture);
+    if (deps.length)
+        cmakeCmd += ' -DADDITIONAL_DEPENDECIES="' + deps + '"';
+
     return execAsync(cmakeCmd).then(function () {
         if (architecture != "i386")
             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");\'');
@@ -218,6 +277,8 @@ function buildNative(campoDir, ubuntuDir, nobuild, debug) {
         return Q();
     }
 
+    checkEnv(ubuntuDir);
+
     shell.rm('-rf', path.join(nativeDir, 'build'));
     shell.rm('-rf', prefixDir);
 
@@ -230,9 +291,15 @@ function buildNative(campoDir, ubuntuDir, nobuild, debug) {
     if (!debug)
         buildType = '"Release"';
 
+    var cmakeCmd = 'cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"'
+        + ' -DCMAKE_BUILD_TYPE=' + buildType;
+
+    var deps = additionalBuildDependencies(ubuntuDir).join(' ').replace(/ARCH/g, '');
+    if (deps.length)
+        cmakeCmd += ' -DADDITIONAL_DEPENDECIES="' + deps + '"';
+
     var debDir;
-    return execAsync('cmake ' + campoDir + ' -DCMAKE_INSTALL_PREFIX="' + prefixDir + '"'
-                      + ' -DCMAKE_BUILD_TYPE=' + buildType).then(function () {
+    return execAsync(cmakeCmd).then(function () {
         return execAsync('make -j ' + cpuCount() + '; make install');
     }).then(function () {
         cp(path.join(ubuntuDir, 'config.xml'), prefixDir);