From e8f0c3b509ca7307e012f933fb4b69393128b6a1 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sun, 2 Mar 2014 17:56:42 +0100 Subject: [PATCH 1/3] add build for node-webkit --- .gitignore | 2 +- Gruntfile.js | 14 ++++++++++++-- src/package.json | 4 ++++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/package.json diff --git a/.gitignore b/.gitignore index feb0aaa..2e20e0d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ test/lib/ .sass-cache src/css/ dist/ -*.zip +release/ test/integration/src/ src/lib/*.js src/js/crypto/aes-cbc.js diff --git a/Gruntfile.js b/Gruntfile.js index 6f4f542..588ff61 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -210,15 +210,25 @@ module.exports = function(grunt) { } }, compress: { - main: { + chrome: { options: { mode: 'zip', - archive: zipName + '.zip' + archive: 'release/whiteout_mail_' + zipName + '.zip' }, expand: true, cwd: 'dist/', src: ['**/*'], dest: 'release/' + }, + nodeWebkit: { + options: { + mode: 'zip', + archive: 'release/whiteout_mail_' + zipName + '.nw' + }, + expand: true, + cwd: 'dist/', + src: ['**/*'], + dest: '/' } } }); diff --git a/src/package.json b/src/package.json new file mode 100644 index 0000000..f9f0ab1 --- /dev/null +++ b/src/package.json @@ -0,0 +1,4 @@ +{ + "name": "Whiteout Mail", + "main": "chrome.html" +} \ No newline at end of file From 65bfc6c44c977468cd63344717fd5c161a1adbb1 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sun, 2 Mar 2014 23:05:09 +0100 Subject: [PATCH 2/3] get requirejs bootstrapping working --- .jshintrc | 1 + src/js/app.js | 18 ++++++++++++++++-- src/require-config.js | 3 ++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.jshintrc b/.jshintrc index 04ce718..5753443 100644 --- a/.jshintrc +++ b/.jshintrc @@ -29,6 +29,7 @@ "deepEqual", "start", "chrome", + "requirejs", "define", "self", "describe", diff --git a/src/js/app.js b/src/js/app.js index c1974db..d0ec6ac 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,7 +1,7 @@ // hey Angular, we're bootstrapping manually! window.name = 'NG_DEFER_BOOTSTRAP!'; -require([ +requirejs([ 'angular', 'js/controller/dialog', 'js/controller/popover', @@ -18,7 +18,21 @@ require([ 'cryptoLib/util', 'angularRoute', 'angularTouch' -], function(angular, DialogCtrl, PopoverCtrl, AddAccountCtrl, AccountCtrl, LoginCtrl, LoginInitialCtrl, LoginNewDeviceCtrl, LoginExistingCtrl, MailListCtrl, ReadCtrl, WriteCtrl, NavigationCtrl, util) { +], function( + angular, + DialogCtrl, + PopoverCtrl, + AddAccountCtrl, + AccountCtrl, + LoginCtrl, + LoginInitialCtrl, + LoginNewDeviceCtrl, + LoginExistingCtrl, + MailListCtrl, + ReadCtrl, + WriteCtrl, + NavigationCtrl, + util) { 'use strict'; // reset window.name diff --git a/src/require-config.js b/src/require-config.js index 4107ffb..ea5e10f 100644 --- a/src/require-config.js +++ b/src/require-config.js @@ -1,7 +1,8 @@ (function() { 'use strict'; - require.config({ + requirejs.config({ + nodeRequire: (typeof module !== 'undefined' && module.exports) ? require : undefined, baseUrl: 'lib', paths: { js: '../js', From 9e460b99cc416208a262daece5ee73dc3a1d4787 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sun, 2 Mar 2014 23:50:16 +0100 Subject: [PATCH 3/3] add grunt build step --- Gruntfile.js | 26 +++++++++++++++----------- package.json | 5 +++-- src/package.json | 8 +++++++- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 588ff61..bc66235 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -209,6 +209,7 @@ module.exports = function(grunt) { dest: 'test/integration/src/' } }, + compress: { chrome: { options: { @@ -219,18 +220,20 @@ module.exports = function(grunt) { cwd: 'dist/', src: ['**/*'], dest: 'release/' - }, - nodeWebkit: { - options: { - mode: 'zip', - archive: 'release/whiteout_mail_' + zipName + '.nw' - }, - expand: true, - cwd: 'dist/', - src: ['**/*'], - dest: '/' } - } + }, + + nodewebkit: { + options: { + version: '0.9.2', // node-webkit version + build_dir: './release', // Where the build version of my node-webkit app is saved + mac: true, // We want to build it for mac + win: false, // We want to build it for win + linux32: false, // We don't need linux32 + linux64: false, // We don't need linux64 + }, + src: ['./dist/**/*'] // Your node-webkit app + }, }); // Load the plugin(s) @@ -245,6 +248,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadNpmTasks('grunt-node-webkit-builder'); // Build tasks grunt.registerTask('dist-npm', ['copy:npm', 'copy:npmDev', 'copy:cryptoLib']); diff --git a/package.json b/package.json index 04c4347..46c0b4d 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "grunt-autoprefixer": "~0.3.0", "grunt-contrib-watch": "~0.5.3", "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-compress": "~0.5.2" + "grunt-contrib-compress": "~0.5.2", + "grunt-node-webkit-builder": "~0.1.17" } -} +} \ No newline at end of file diff --git a/src/package.json b/src/package.json index f9f0ab1..7ce989f 100644 --- a/src/package.json +++ b/src/package.json @@ -1,4 +1,10 @@ { "name": "Whiteout Mail", - "main": "chrome.html" + "version": "0.0.1", + "main": "chrome.html", + "window": { + "toolbar": false, + "width": 1024, + "height": 768 + } } \ No newline at end of file