morris.js/Gruntfile.js

77 lines
1.7 KiB
JavaScript
Raw Normal View History

2012-06-26 08:15:54 +02:00
module.exports = function (grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
2012-06-26 08:15:54 +02:00
grunt.initConfig({
coffee: {
lib: {
options: { bare: false },
files: {
'morris.js': ['build/morris.coffee']
}
2012-06-26 08:15:54 +02:00
},
spec: {
options: { bare: true },
files: {
'build/spec.js': ['build/spec.coffee']
}
},
2012-06-26 08:15:54 +02:00
},
concat: {
2012-10-28 19:55:37 +01:00
'build/morris.coffee': [
'lib/morris.coffee',
'lib/morris.grid.coffee',
'lib/morris.hover.coffee',
2012-10-28 19:55:37 +01:00
'lib/morris.line.coffee',
'lib/morris.area.coffee',
'lib/morris.bar.coffee',
2012-10-28 19:55:37 +01:00
'lib/morris.donut.coffee'
],
'build/spec.coffee': ['spec/support/**/*.coffee', 'spec/lib/**/*.coffee']
2012-06-26 08:15:54 +02:00
},
less: {
all: {
src: 'less/*.less',
dest: 'morris.css',
options: {
compress: true
}
}
},
uglify: {
build: {
files: {
'morris.min.js': 'morris.js'
}
}
2012-06-26 08:15:54 +02:00
},
mocha: {
index: ['spec/specs.html'],
options: {run: true}
},
watch: {
all: {
files: ['lib/**/*.coffee', 'spec/lib/**/*.coffee', 'spec/support/**/*.coffee', 'less/**/*.less'],
tasks: 'default'
},
dev: {
files: 'lib/*.coffee' ,
tasks: ['concat:build/morris.coffee', 'coffee:lib']
2012-06-26 08:15:54 +02:00
}
2012-10-19 10:07:30 +02:00
},
shell: {
visual_spec: {
command: './run.sh',
options: {
stdout: true,
2013-11-11 08:02:58 +01:00
failOnError: true,
execOptions: {
cwd: 'spec/viz'
}
}
}
}
2012-06-26 08:15:54 +02:00
});
grunt.registerTask('default', ['concat', 'coffee', 'less', 'uglify', 'mocha', 'shell:visual_spec']);
};