diff --git a/Cakefile b/Cakefile index fb04ad3..801b905 100644 --- a/Cakefile +++ b/Cakefile @@ -3,16 +3,12 @@ CoffeeScript = require 'coffee-script' nodeunit = require 'nodeunit' UglifyJS = require 'uglify-js' -task 'all', 'test everything and build minified code', build = (cb) -> +task 'build', 'build javascript files from sources', (cb) -> source = fs.readFileSync 'src/ipaddr.coffee', 'utf-8' fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString() - invoke 'test' - invoke 'compress' + source = fs.readFileSync 'lib/ipaddr.js', 'utf-8' + fs.writeFileSync('ipaddr.min.js', UglifyJS.minify(source).code) task 'test', 'run the bundled tests', (cb) -> nodeunit.reporters.default.run ['test'] - -task 'compress', 'uglify the resulting javascript', (cb) -> - source = fs.readFileSync 'lib/ipaddr.js', 'utf-8' - fs.writeFileSync('ipaddr.min.js', UglifyJS.minify(source).code)