sol2/Gruntfile.js

82 lines
1.9 KiB
JavaScript
Raw Normal View History

module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
2013-11-04 05:59:15 +08:00
open : {
dev: {
path: 'http://localhost:1919'
}
},
2013-11-04 05:37:56 +08:00
connect: {
server: {
options: {
2013-11-04 05:59:15 +08:00
port: 1919,
base: 'demo_docs/build',
livereload: true
2013-11-04 05:37:56 +08:00
}
}
},
compass: {
prod: {
options: {
config: 'compass.rb',
environment: 'production',
2013-11-04 05:37:56 +08:00
force: true
}
},
debug: {
2013-11-04 05:37:56 +08:00
options: {
config: 'compass.rb',
force: true
}
}
},
2013-11-04 05:37:56 +08:00
exec: {
2013-11-04 05:37:56 +08:00
bower_update: {
cmd: 'bower update'
2013-11-04 05:37:56 +08:00
},
build_sphinx: {
cmd: 'sphinx-build demo_docs/source demo_docs/build'
}
2013-11-04 05:37:56 +08:00
},
clean: {
build: ["demo_docs/build"]
2013-11-04 05:37:56 +08:00
},
watch: {
/* Compile sass changes into theme directory */
2013-11-04 05:37:56 +08:00
sass: {
files: ['sass/*.sass', 'bower_components/**/*.sass'],
tasks: ['compass:debug']
2013-11-04 05:37:56 +08:00
},
/* Changes in theme dir rebuild sphinx */
sphinx: {
files: ['sphinx_rtd_theme/**/*'],
tasks: ['exec:build_sphinx']
2013-11-04 05:37:56 +08:00
},
/* live-reload the demo_docs if sphinx re-builds */
2013-11-04 05:37:56 +08:00
livereload: {
files: ['demo_docs/build/**/*'],
options: { livereload: true }
}
}
});
grunt.loadNpmTasks('grunt-exec');
2013-11-04 05:37:56 +08:00
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
2013-11-04 05:37:56 +08:00
grunt.loadNpmTasks('grunt-contrib-clean');
2013-11-04 05:59:15 +08:00
grunt.loadNpmTasks('grunt-open');
grunt.registerTask('default', ['exec:bower_update','clean:build','compass:debug','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['exec:bower_update','clean:build','compass:prod','exec:build_sphinx']);
}