Skip to content

Commit

Permalink
Clarify Cakefile task names (again).
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Oct 15, 2017
1 parent 90c75fd commit b56c0f5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit b56c0f5

Please sign in to comment.