From 01d2edb819363bcb69a7409829dbbb2e2e90b9fa Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 26 Feb 2015 11:46:57 -0400 Subject: [PATCH] Precompile CoffeeScript files --- .gitignore | 1 + bin/resin | 4 ++-- bin/resin.cmd | 2 +- gulpfile.coffee | 14 +++----------- lib/resin.js | 3 --- scripts/distribute.sh | 14 +++++++------- 6 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 lib/resin.js diff --git a/.gitignore b/.gitignore index 90b36c1f..6dbca000 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ node_modules bin/node build/ +release/ diff --git a/bin/resin b/bin/resin index 9675e4bd..118fea65 100755 --- a/bin/resin +++ b/bin/resin @@ -47,7 +47,7 @@ fi # Support calling bin/resin from within bin/ if [ `dirname $0` == '.' ]; then - $NODE_PATH "../lib/resin.js" "$@" + $NODE_PATH "../build/app.js" "$@" else - $NODE_PATH "./lib/resin.js" "$@" + $NODE_PATH "./build/app.js" "$@" fi diff --git a/bin/resin.cmd b/bin/resin.cmd index 85f349f7..74105040 100755 --- a/bin/resin.cmd +++ b/bin/resin.cmd @@ -9,4 +9,4 @@ set NODE_PATH="%~dp0\node\node-win32-%ARCH%.exe" set NODE_PATH="node.exe" ) -%NODE_PATH% "%~dp0\..\lib\resin.js" %* +%NODE_PATH% "%~dp0\..\build\app.js" %* diff --git a/gulpfile.coffee b/gulpfile.coffee index e2ec101a..b35eba34 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -33,7 +33,7 @@ gulp.task 'test', -> reporter: mochaNotifierReporter.decorate('landing') })) -gulp.task 'coffee', [ 'test', 'lint' ], -> +gulp.task 'coffee', [ 'test', 'lint', 'json' ], -> gulp.src(OPTIONS.files.app) .pipe(coffee()) .pipe(gulp.dest(OPTIONS.directories.build)) @@ -49,19 +49,11 @@ gulp.task 'lint', -> })) .pipe(coffeelint.reporter()) -gulp.task 'release', [ 'coffee', 'json' ], -> - mkdirp.sync('build/Release') - gulp.src('') - .pipe(shell "jx package app.js Release/#{packageJSON.name} -native", { - cwd: path.join(process.cwd(), OPTIONS.directories.build) - }) - gulp.task 'build', [ - 'lint' - 'test' + 'coffee' 'man' ] gulp.task 'watch', [ 'test', 'lint' ], -> - gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'test', 'lint' ]) + gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'coffee' ]) gulp.watch([ OPTIONS.files.man ], [ 'man' ]) diff --git a/lib/resin.js b/lib/resin.js deleted file mode 100644 index acb6f0d1..00000000 --- a/lib/resin.js +++ /dev/null @@ -1,3 +0,0 @@ -// http://coffeescript.org/documentation/docs/register.html -require('coffee-script/register'); -require('./app.coffee'); diff --git a/scripts/distribute.sh b/scripts/distribute.sh index 744b8725..b068e061 100755 --- a/scripts/distribute.sh +++ b/scripts/distribute.sh @@ -32,19 +32,19 @@ function distribute() { print_banner "Copying necessary files" # Copy all needed files - mkdir -p build/$package + mkdir -p release/$package - cp -rf bin build/$package + cp -rf bin release/$package # TODO: Omit bin/node in a better way - rm -rf build/$package/bin/node + rm -rf release/$package/bin/node - cp -rf lib build/$package - cp -rf package.json build/$package + cp -rf build release/$package + cp -rf package.json release/$package print_banner "Running npm install" - cd build/$package + cd release/$package RESIN_BUNDLE=$os npm install --production --force flatten-packages . @@ -70,4 +70,4 @@ function distribute() { distribute "win32" # distribute "sunos" -tree build/distrib +tree release/distrib