diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4afffa9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cache +dist +build +node_modules diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..709d5d9 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,71 @@ +var Builder = require('nw-builder'), + gulp = require('gulp'), + gutil = require('gulp-util'), + zip = require('gulp-zip'); + + +gulp.task('nw', function() { + var builder = new Builder({ + files: [ + 'favicon.png', + 'index.html', + 'math.min.js', + 'package.json', + 'recalc.js', + 'style.css' + ], + platforms: ['osx32', 'osx64', 'linux32', 'linux64', 'win32', 'win64'] + }); + builder.on('log', function (msg) { + gutil.log('\'' + 'node-webkit-builder'.cyan + '\':', msg); + }); + + return builder.build().catch(function (err) { + gutil.log('\'' + 'node-webkit-builder'.cyan + '\':', err); + }); +}); + +gulp.task('dist-linux32', ['nw'], function () { + return gulp.src('build/calque/linux32/**/**') + .pipe(zip('Linux32.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist-linux64', ['nw'], function () { + return gulp.src('build/calque/linux64/**/**') + .pipe(zip('Linux64.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist-osx32', ['nw'], function () { + return gulp.src('build/calque/osx32/**/**') + .pipe(zip('OSX32.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist-osx64', ['nw'], function () { + return gulp.src('build/calque/osx64/**/**') + .pipe(zip('OSX64.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist-win32', ['nw'], function () { + return gulp.src('build/calque/win32/**/**') + .pipe(zip('Windows32.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist-win64', ['nw'], function () { + return gulp.src('build/calque/win64/**/**') + .pipe(zip('Windows64.zip')) + .pipe(gulp.dest('dist/')); +}); + +gulp.task('dist', [ + 'dist-linux32', + 'dist-linux64', + 'dist-osx32', + 'dist-osx64', + 'dist-win32', + 'dist-win64' +]); diff --git a/package.json b/package.json new file mode 100644 index 0000000..c76d0db --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "calque", + "version": "0.0.1", + "main": "index.html", + + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + + "repository": { + "type": "git", + "url": "git://github.com/grimalschi/calque.git" + }, + + "bugs": { + "url": "https://github.com/grimalschi/calque/issues" + }, + + "author": "Veaceslav Grimalschi", + "license": "MIT", + "homepage": "https://github.com/grimalschi/calque", + + "window": { + "title": "calque", + "icon": "favicon.png", + "width": 800, + "height": 450, + "min_width": 800, + "min_height": 450, + "toolbar": false + }, + + "chromium-args": "--child-clean-exit", + + "dependencies": { + "gulp-util": "^3.0.6", + "gulp": "^3.9.0", + "gulp-zip": "^3.0.2", + "nw": "^0.12.3", + "nw-builder": "^2.0.2" + }, + "devDependencies": {} +}