Ghost/Gruntfile.js

75 lines
2.1 KiB
JavaScript
Raw Normal View History

2013-05-14 17:04:22 +02:00
(function () {
"use strict";
var configureGrunt = function (grunt) {
var cfg = {
// JSLint all the things!
jslint: {
directives: {
node: true,
browser: true,
2013-05-14 17:04:22 +02:00
nomen: true,
todo: true,
unparam: true
2013-05-14 17:04:22 +02:00
},
files: [
// Lint files in the root, including Gruntfile.js
"*.js",
// Lint core files, but not libs
["core/**/*.js", "!**/assets/lib/**/*.js"]
]
},
2013-05-14 17:04:22 +02:00
mochaTest: {
options: {
ui: "bdd",
reporter: "spec"
},
all: {
src: ['core/test/**/*_spec.js']
},
api: {
src: ['core/test/**/api*_spec.js']
}
},
2013-05-14 17:04:22 +02:00
// Compile all the SASS!
sass: {
admin: {
files: {
'core/admin/assets/css/screen.css': 'core/admin/assets/sass/screen.scss'
}
}
},
2013-05-25 18:55:23 +02:00
shell: {
bourbon: {
command: 'bourbon install --path core/admin/assets/sass/modules/'
}
2013-05-14 17:04:22 +02:00
}
};
2013-05-14 17:04:22 +02:00
grunt.initConfig(cfg);
2013-05-14 17:04:22 +02:00
grunt.loadNpmTasks("grunt-jslint");
grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.loadNpmTasks("grunt-shell");
2013-05-14 17:04:22 +02:00
// Prepare the project for development
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask("init", ["shell:bourbon", "sass:admin"]);
2013-05-14 17:04:22 +02:00
2013-05-20 06:22:00 +02:00
// Run API tests only
grunt.registerTask("test-api", ["mochaTest:api"]);
2013-05-20 06:22:00 +02:00
2013-05-14 17:04:22 +02:00
// Run tests and lint code
grunt.registerTask("validate", ["jslint", "mochaTest:all"]);
2013-05-14 17:04:22 +02:00
};
2013-05-14 17:04:22 +02:00
module.exports = configureGrunt;
2013-05-12 15:40:59 +02:00
2013-05-14 17:04:22 +02:00
}());