2012-06-26 08:15:54 +02:00
|
|
|
module.exports = function (grunt) {
|
2013-09-25 08:27:24 +02:00
|
|
|
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
|
|
|
|
2012-06-26 08:15:54 +02:00
|
|
|
grunt.initConfig({
|
|
|
|
coffee: {
|
|
|
|
lib: {
|
2013-09-25 21:26:31 +02:00
|
|
|
options: { bare: false },
|
|
|
|
files: {
|
|
|
|
'morris.js': ['build/morris.coffee']
|
|
|
|
}
|
2012-06-26 08:15:54 +02:00
|
|
|
},
|
|
|
|
spec: {
|
2013-09-25 21:26:31 +02:00
|
|
|
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',
|
2012-11-18 20:02:46 +01:00
|
|
|
'lib/morris.hover.coffee',
|
2012-10-28 19:55:37 +01:00
|
|
|
'lib/morris.line.coffee',
|
|
|
|
'lib/morris.area.coffee',
|
2012-10-31 20:38:09 +01:00
|
|
|
'lib/morris.bar.coffee',
|
2012-10-28 19:55:37 +01:00
|
|
|
'lib/morris.donut.coffee'
|
|
|
|
],
|
2012-10-25 08:51:13 +02:00
|
|
|
'build/spec.coffee': ['spec/support/**/*.coffee', 'spec/lib/**/*.coffee']
|
2012-06-26 08:15:54 +02:00
|
|
|
},
|
2012-11-18 20:02:46 +01:00
|
|
|
less: {
|
|
|
|
all: {
|
|
|
|
src: 'less/*.less',
|
|
|
|
dest: 'morris.css',
|
|
|
|
options: {
|
|
|
|
compress: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2013-09-25 21:26:31 +02:00
|
|
|
uglify: {
|
|
|
|
build: {
|
|
|
|
files: {
|
|
|
|
'morris.min.js': 'morris.js'
|
|
|
|
}
|
|
|
|
}
|
2012-06-26 08:15:54 +02:00
|
|
|
},
|
|
|
|
mocha: {
|
2013-09-25 21:26:31 +02:00
|
|
|
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
|
|
|
},
|
2013-11-10 23:09:01 +01:00
|
|
|
shell: {
|
|
|
|
visual_spec: {
|
|
|
|
command: './run.sh',
|
|
|
|
options: {
|
|
|
|
stdout: true,
|
2013-11-11 08:02:58 +01:00
|
|
|
failOnError: true,
|
2013-11-10 23:09:01 +01:00
|
|
|
execOptions: {
|
|
|
|
cwd: 'spec/viz'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-06-26 08:15:54 +02:00
|
|
|
});
|
|
|
|
|
2013-11-10 23:09:01 +01:00
|
|
|
grunt.registerTask('default', ['concat', 'coffee', 'less', 'uglify', 'mocha', 'shell:visual_spec']);
|
|
|
|
};
|