2013-05-14 19:04:22 +04:00
|
|
|
(function () {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var configureGrunt = function (grunt) {
|
|
|
|
|
|
|
|
var cfg = {
|
|
|
|
// JSLint all the things!
|
|
|
|
jslint: {
|
|
|
|
directives: {
|
2013-05-14 19:07:41 +04:00
|
|
|
node: true,
|
|
|
|
browser: true,
|
2013-05-14 19:04:22 +04:00
|
|
|
nomen: true,
|
2013-05-25 20:48:15 +04:00
|
|
|
todo: true,
|
|
|
|
unparam: true
|
2013-05-14 19:04:22 +04:00
|
|
|
},
|
|
|
|
files: [
|
|
|
|
// Lint files in the root, including Gruntfile.js
|
|
|
|
"*.js",
|
|
|
|
// Lint core files, but not libs
|
|
|
|
["core/**/*.js", "!**/assets/lib/**/*.js"]
|
|
|
|
]
|
2013-05-13 23:18:20 +04:00
|
|
|
},
|
2013-05-14 19:04:22 +04:00
|
|
|
|
|
|
|
// Unit test all the things!
|
|
|
|
nodeunit: {
|
2013-05-20 08:22:00 +04:00
|
|
|
all: ['core/test/ghost/**/test-*.js'],
|
|
|
|
api: ['core/test/ghost/test-api.js']
|
2013-05-13 23:18:20 +04:00
|
|
|
},
|
|
|
|
|
2013-05-25 20:48:15 +04:00
|
|
|
mochaTest: {
|
|
|
|
options: {
|
|
|
|
ui: "bdd",
|
|
|
|
reporter: "spec"
|
|
|
|
},
|
|
|
|
|
|
|
|
all: {
|
|
|
|
src: ['core/test/**/*_spec.js']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
// Compile all the SASS!
|
|
|
|
compass: {
|
|
|
|
options: {
|
|
|
|
config: "config.rb"
|
|
|
|
},
|
|
|
|
// No need for config, but separated for future options
|
|
|
|
admin: {}
|
|
|
|
}
|
|
|
|
};
|
2013-05-13 23:18:20 +04:00
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
grunt.initConfig(cfg);
|
2013-05-13 23:18:20 +04:00
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
grunt.loadNpmTasks("grunt-jslint");
|
|
|
|
grunt.loadNpmTasks("grunt-contrib-nodeunit");
|
2013-05-25 20:48:15 +04:00
|
|
|
grunt.loadNpmTasks("grunt-mocha-test");
|
2013-05-14 19:04:22 +04:00
|
|
|
grunt.loadNpmTasks("grunt-contrib-compass");
|
|
|
|
|
|
|
|
// Prepare the project for development
|
|
|
|
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
|
|
|
|
grunt.registerTask("init", ["compass:admin"]);
|
|
|
|
|
2013-05-20 08:22:00 +04:00
|
|
|
// Run API tests only
|
2013-05-25 20:48:15 +04:00
|
|
|
grunt.registerTask("test-api", ["nodeunit:api", "mochaTest:all"]);
|
2013-05-20 08:22:00 +04:00
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
// Run tests and lint code
|
2013-05-25 20:48:15 +04:00
|
|
|
grunt.registerTask("validate", ["jslint", "mochaTest:all"]);
|
2013-05-14 19:04:22 +04:00
|
|
|
};
|
2013-05-13 23:18:20 +04:00
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
module.exports = configureGrunt;
|
2013-05-12 17:40:59 +04:00
|
|
|
|
2013-05-14 19:04:22 +04:00
|
|
|
}());
|