2013-10-23 12:35:07 +08:00
|
|
|
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,
|
2013-11-04 11:00:44 +08:00
|
|
|
base: 'demo_docs/build',
|
|
|
|
livereload: true
|
2013-11-04 05:37:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-10-23 12:35:07 +08:00
|
|
|
compass: {
|
2013-11-04 11:00:44 +08:00
|
|
|
prod: {
|
2013-10-23 12:35:07 +08:00
|
|
|
options: {
|
2013-11-04 11:00:44 +08:00
|
|
|
config: 'compass.rb',
|
|
|
|
environment: 'production',
|
2013-11-04 05:37:56 +08:00
|
|
|
force: true
|
|
|
|
}
|
|
|
|
},
|
2013-11-04 11:00:44 +08:00
|
|
|
debug: {
|
2013-11-04 05:37:56 +08:00
|
|
|
options: {
|
2013-11-04 11:00:44 +08:00
|
|
|
config: 'compass.rb',
|
2013-10-23 12:35:07 +08:00
|
|
|
force: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2013-11-04 05:37:56 +08:00
|
|
|
|
2013-10-23 12:35:07 +08:00
|
|
|
exec: {
|
2013-11-04 05:37:56 +08:00
|
|
|
bower_update: {
|
2013-10-23 12:35:07 +08:00
|
|
|
cmd: 'bower update'
|
2013-11-04 05:37:56 +08:00
|
|
|
},
|
|
|
|
build_sphinx: {
|
2013-11-04 11:00:44 +08:00
|
|
|
cmd: 'sphinx-build demo_docs/source demo_docs/build'
|
2013-10-23 12:35:07 +08:00
|
|
|
}
|
2013-11-04 05:37:56 +08:00
|
|
|
},
|
|
|
|
clean: {
|
2013-11-04 11:00:44 +08:00
|
|
|
build: ["demo_docs/build"]
|
2013-11-04 05:37:56 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
2013-11-04 11:00:44 +08:00
|
|
|
/* Compile sass changes into theme directory */
|
2013-11-04 05:37:56 +08:00
|
|
|
sass: {
|
2013-11-04 11:00:44 +08:00
|
|
|
files: ['sass/*.sass', 'bower_components/**/*.sass'],
|
|
|
|
tasks: ['compass:debug']
|
2013-11-04 05:37:56 +08:00
|
|
|
},
|
2013-11-04 11:00:44 +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
|
|
|
},
|
2013-11-04 11:00:44 +08:00
|
|
|
/* live-reload the demo_docs if sphinx re-builds */
|
2013-11-04 05:37:56 +08:00
|
|
|
livereload: {
|
2013-11-04 11:00:44 +08:00
|
|
|
files: ['demo_docs/build/**/*'],
|
|
|
|
options: { livereload: true }
|
|
|
|
}
|
2013-10-23 12:35:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-exec');
|
2013-11-04 05:37:56 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2013-10-23 12:35:07 +08:00
|
|
|
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');
|
2013-10-23 12:35:07 +08:00
|
|
|
|
2013-11-04 11:00:44 +08:00
|
|
|
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']);
|
2013-10-23 12:35:07 +08:00
|
|
|
}
|
|
|
|
|