From d803e88c93b846e719a6f66b6779dd162004eb30 Mon Sep 17 00:00:00 2001 From: Filipe Vieira Date: Mon, 28 Apr 2014 22:13:44 +0100 Subject: [PATCH 1/5] added node-webkit to generate standalone app. --- Gruntfile.js | 20 +++++++++++++++++--- build/closure/closure_compiler_20130823.jar | Bin build/closure/piskel-closure-externs.js | 0 package.json | 10 ++++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) mode change 100644 => 100755 build/closure/closure_compiler_20130823.jar mode change 100644 => 100755 build/closure/piskel-closure-externs.js diff --git a/Gruntfile.js b/Gruntfile.js index 1f65ddf0..9fdc708e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -146,8 +146,18 @@ module.exports = function(grunt) { // This generated JS binary is currently not used and even excluded from source control using .gitignore. dest: 'build/closure/closure_compiled_binary.js' - } - } + }, + }, + nodewebkit: { + options: { + build_dir: './build', // Where the build version of my node-webkit app is saved + mac: true, + win: true, + linux32: true, + linux64: true + }, + src: ['./**/*'] + }, }); grunt.config.set('leadingIndent.indentation', 'spaces'); @@ -168,7 +178,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-closure-tools'); grunt.loadNpmTasks('grunt-ghost'); grunt.loadNpmTasks('grunt-leading-indent'); - + grunt.loadNpmTasks('grunt-node-webkit-builder'); + // Validate grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']); @@ -188,4 +199,7 @@ module.exports = function(grunt) { // Start webserver grunt.registerTask('serve', ['connect:serve']); + + // Build stand alone app with nodewebkit + grunt.registerTask('nw', ['nodewebkit']); }; diff --git a/build/closure/closure_compiler_20130823.jar b/build/closure/closure_compiler_20130823.jar old mode 100644 new mode 100755 diff --git a/build/closure/piskel-closure-externs.js b/build/closure/piskel-closure-externs.js old mode 100644 new mode 100755 diff --git a/package.json b/package.json index eb77b76e..805859d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "author": "Julian Descottes, Vincent Renaudin", "name": "piskel", + "main": "./src/index.html", "description": "Web based 2d animations editor", "version": "0.0.1", "homepage": "http://github.com/juliandescottes/piskel", @@ -9,7 +10,8 @@ "url": "http://github.com/juliandescottes/piskel.git" }, "scripts": { - "test": "grunt test" + "test": "grunt test", + "start": "nodewebkit" }, "devDependencies": { "grunt": "~0.4.1", @@ -19,6 +21,10 @@ "grunt-contrib-uglify": "0.2.2", "grunt-ghost": "1.0.12", "grunt-leading-indent": "0.1.0", - "grunt-closure-tools": "~0.8.3" + "grunt-closure-tools": "~0.8.3", + "grunt-node-webkit-builder": "~0.1.21" + }, + "window": { + "toolbar": false } } From 7fb5fe93faf4bfa2fb8ab1f3dd91640cba49d1ae Mon Sep 17 00:00:00 2001 From: Filipe Vieira Date: Thu, 1 May 2014 01:00:10 +0100 Subject: [PATCH 2/5] Make desktop app directory with all nedded files before build it. --- Gruntfile.js | 16 +++++++++++++--- package.json | 7 ++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9fdc708e..88fd11c6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -157,7 +157,15 @@ module.exports = function(grunt) { linux64: true }, src: ['./**/*'] - }, + }, + copy: { + desktop: { + files: [ + {expand: true, cwd: "build/", src: ['*'], dest: 'desktop/build/', filter: 'isFile'}, + {expand: true, cwd: "src/", src: ['**'], dest: 'desktop/'}, + ] + } + } }); grunt.config.set('leadingIndent.indentation', 'spaces'); @@ -179,7 +187,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-ghost'); grunt.loadNpmTasks('grunt-leading-indent'); grunt.loadNpmTasks('grunt-node-webkit-builder'); - + grunt.loadNpmTasks('grunt-contrib-copy'); + // Validate grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']); @@ -201,5 +210,6 @@ module.exports = function(grunt) { grunt.registerTask('serve', ['connect:serve']); // Build stand alone app with nodewebkit - grunt.registerTask('nw', ['nodewebkit']); + grunt.registerTask('desktop', ['compile', 'merge', 'copy:desktop', 'nodewebkit']); + }; diff --git a/package.json b/package.json index 805859d1..efb86839 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Julian Descottes, Vincent Renaudin", "name": "piskel", - "main": "./src/index.html", + "main": "./desktop/index.html", "description": "Web based 2d animations editor", "version": "0.0.1", "homepage": "http://github.com/juliandescottes/piskel", @@ -22,9 +22,10 @@ "grunt-ghost": "1.0.12", "grunt-leading-indent": "0.1.0", "grunt-closure-tools": "~0.8.3", - "grunt-node-webkit-builder": "~0.1.21" + "grunt-node-webkit-builder": "~0.1.21", + "grunt-contrib-copy": "~0.5.0" }, "window": { - "toolbar": false + "toolbar": false } } From 7ad836f9f92c996e43e22f809de203956b91349e Mon Sep 17 00:00:00 2001 From: Filipe Vieira Date: Tue, 6 May 2014 03:16:51 +0100 Subject: [PATCH 3/5] Setup nw releases destinations to build folder. --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 4f0a2f90..d5bf2f34 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -191,7 +191,7 @@ module.exports = function(grunt) { }, nodewebkit: { options: { - build_dir: './dest', // Where the build version of my node-webkit app is saved + build_dir: './build', // destination folder of releases. mac: true, win: true, linux32: true, From db6dff0564f761c2232d75cd006930532073331a Mon Sep 17 00:00:00 2001 From: Filipe Vieira Date: Tue, 6 May 2014 19:27:24 +0100 Subject: [PATCH 4/5] change node webkit versions to work with older node versions. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a9cd874c..96768189 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "grunt-open": "0.2.3", "grunt-leading-indent": "0.1.0", "grunt-closure-tools": "~0.8.3", - "grunt-node-webkit-builder": "~0.1.21" + "grunt-node-webkit-builder": "0.1.19", + "nodewebkit": "0.8.4" }, "window": { "toolbar": false From 8eb0374351101578e37cd7c3b415d0e6e4e3dc8f Mon Sep 17 00:00:00 2001 From: fsvieira Date: Sun, 11 May 2014 21:16:57 +0100 Subject: [PATCH 5/5] Change node webkit releases location, ignore unecessary files. --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d5bf2f34..ea72fe39 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -191,13 +191,13 @@ module.exports = function(grunt) { }, nodewebkit: { options: { - build_dir: './build', // destination folder of releases. + build_dir: './dest/desktop/', // destination folder of releases. mac: true, win: true, linux32: true, linux64: true }, - src: ['./**/*'] + src: ['./dest/**/*', "./package.json", "!./dest/desktop/"] } });