Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (45 sloc) 1.559 kb
adf6ce8 @bergie Add documentation generator
bergie authored
1 {exec} = require 'child_process'
2 fs = require 'fs'
3ad8fea @bergie Better API documentation commands, refs #13
bergie authored
3 {series} = require 'async'
4
5 sh = (command) -> (k) ->
6 console.log "Executing #{command}"
7 exec command, (err, sout, serr) ->
8 console.log err if err
9 console.log sout if sout
10 console.log serr if serr
11 do k
4427f30 @bergie Make the build process simpler
bergie authored
12
c5497b1 @bergie Add subdir support for 'build' task, refs #21
bergie authored
13 checkSubDir = (path) ->
14 fs.stat "#{__dirname}/src/#{path}", (err, stat) ->
15 buildDir "#{path}" if stat.isDirectory()
16
4427f30 @bergie Make the build process simpler
bergie authored
17 buildDir = (path) ->
c5497b1 @bergie Add subdir support for 'build' task, refs #21
bergie authored
18 realPath = "#{__dirname}/src/#{path}"
19 targetPath = "#{__dirname}/#{path}"
20 fs.readdir realPath, (err, files) ->
21 hasCoffee = false
22 for file in files
23 if file.indexOf('.coffee') isnt -1
24 hasCoffee = true
25 continue
26 checkSubDir "#{path}/#{file}"
27
28 return unless hasCoffee
29 console.log "Compiling CoffeeScript from 'src/#{path}' to '#{path}"
f7b7dcb @bergie Simplify Travis setup
bergie authored
30 exec "./node_modules/.bin/coffee -c -o #{targetPath} #{realPath}", (err, stdout, stderr) ->
c5497b1 @bergie Add subdir support for 'build' task, refs #21
bergie authored
31 console.log stderr if stderr
4427f30 @bergie Make the build process simpler
bergie authored
32
adf6ce8 @bergie Add documentation generator
bergie authored
33 task 'build', 'transpile CoffeeScript sources to JavaScript', ->
4427f30 @bergie Make the build process simpler
bergie authored
34 buildDir "lib"
35 buildDir "components"
36 buildDir "bin"
1cf1ead @bergie Build command so NoFlo can be run as JS
bergie authored
37
f7b7dcb @bergie Simplify Travis setup
bergie authored
38 task 'test', 'run the unit tests', ->
3ad8fea @bergie Better API documentation commands, refs #13
bergie authored
39 sh('npm test') ->
adf6ce8 @bergie Add documentation generator
bergie authored
40
41 task 'doc', 'generate documentation for *.coffee files', ->
3ad8fea @bergie Better API documentation commands, refs #13
bergie authored
42 sh('./node_modules/docco-husky/bin/generate src') ->
43
44 task 'docpub', 'publish documentation into GitHub pages', ->
45 series [
46 (sh "./node_modules/docco-husky/bin/generate src")
47 (sh "mv docs docs_tmp")
48 (sh "git checkout gh-pages")
49 (sh "cp -R docs_tmp/* docs/")
50 (sh "git add docs/*")
51 (sh "git commit -m 'Documentation update'")
52 (sh "git checkout master")
53 ]
Something went wrong with that request. Please try again.