Precompile CoffeeScript files

This commit is contained in:
Juan Cruz Viotti 2015-02-26 11:46:57 -04:00
parent 2085e71f33
commit 01d2edb819
6 changed files with 14 additions and 24 deletions

1
.gitignore vendored
View File

@ -30,3 +30,4 @@ node_modules
bin/node
build/
release/

View File

@ -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

View File

@ -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" %*

View File

@ -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' ])

View File

@ -1,3 +0,0 @@
// http://coffeescript.org/documentation/docs/register.html
require('coffee-script/register');
require('./app.coffee');

View File

@ -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