Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

110 lines (96 sloc) 2.896 kb
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# CoffeeScript compilation
coffee:
spec:
options:
bare: true
expand: true
cwd: 'spec'
src: ['**.coffee']
dest: 'spec'
ext: '.js'
# Browser version building
component:
install:
options:
action: 'install'
component_build:
'noflo-semanticsthree':
output: './browser/'
config: './component.json'
scripts: true
styles: false
plugins: ['coffee']
configure: (builder) ->
# Enable Component plugins
json = require 'component-json'
builder.use json()
# Fix broken Component aliases, as mentioned in
# https://github.com/anthonyshort/component-coffee/issues/3
combine:
browser:
input: 'browser/noflo-semanticsthree.js'
output: 'browser/noflo-semanticsthree.js'
tokens: [
token: '.coffee'
string: '.js'
]
# JavaScript minification for the browser
uglify:
options:
report: 'min'
noflo:
files:
'./browser/noflo-semanticsthree.min.js': ['./browser/noflo-semanticsthree.js']
# Automated recompilation and testing when developing
watch:
files: ['spec/*.coffee', 'components/*.coffee']
tasks: ['test']
# BDD tests on Node.js
cafemocha:
nodejs:
src: ['spec/*.coffee']
options:
reporter: 'dot'
# BDD tests on browser
mocha_phantomjs:
options:
output: 'spec/result.xml'
reporter: 'dot'
all: ['spec/runner.html']
# Coding standards
coffeelint:
components: ['components/*.coffee']
# Grunt plugins used for building
@loadNpmTasks 'grunt-contrib-coffee'
@loadNpmTasks 'grunt-component'
@loadNpmTasks 'grunt-component-build'
@loadNpmTasks 'grunt-combine'
@loadNpmTasks 'grunt-contrib-uglify'
# Grunt plugins used for testing
@loadNpmTasks 'grunt-contrib-watch'
@loadNpmTasks 'grunt-cafe-mocha'
@loadNpmTasks 'grunt-mocha-phantomjs'
@loadNpmTasks 'grunt-coffeelint'
# Our local tasks
@registerTask 'build', 'Build NoFlo for the chosen target platform', (target = 'all') =>
@task.run 'coffee'
if target is 'all' or target is 'browser'
@task.run 'component'
@task.run 'component_build'
@task.run 'combine'
@task.run 'uglify'
@registerTask 'test', 'Build NoFlo and run automated tests', (target = 'none') =>
@task.run 'coffeelint'
@task.run 'coffee'
if target is 'all' or target is 'nodejs'
@task.run 'cafemocha'
if target is 'all' or target is 'browser'
@task.run 'component'
@task.run 'component_build'
@task.run 'combine'
@task.run 'mocha_phantomjs'
@registerTask 'default', ['test']
Jump to Line
Something went wrong with that request. Please try again.