sol2/Gruntfile.js

101 lines
2.5 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,
2013-11-04 05:37:56 +08:00
base: 'demo_docs/build/html'
}
}
},
compass: {
2013-11-04 05:37:56 +08:00
src: {
options: {
2013-11-04 05:37:56 +08:00
config: 'src/sphinx_rtd_theme/sass/config.rb',
basePath: 'src/sphinx_rtd_theme/sass',
force: true
}
},
dist: {
options: {
config: 'src/sphinx_rtd_theme/sass/config.rb',
basePath: 'src/sphinx_rtd_theme/sass',
outputStyle: 'compressed',
force: true
}
}
},
2013-11-04 05:37:56 +08:00
// I use this to build the sphinx_rtd_theme available at https://github.com/snide/sphinx_rtd_theme
copy: {
2013-11-04 05:37:56 +08:00
dist : {
files: [
{
expand: true,
2013-11-04 05:37:56 +08:00
cwd: 'src/sphinx_rtd_theme',
2013-11-04 06:11:18 +08:00
src: ['**', '!**/sass/**'],
2013-11-04 05:37:56 +08:00
dest: 'dist/sphinx_rtd_theme'
}
]
}
},
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: 'cd demo_docs && make html'
}
2013-11-04 05:37:56 +08:00
},
clean: {
src: ["demo_docs/build"],
dist: ["dist/sphinx_rtd_theme"]
},
watch: {
sass: {
files: ['src/sphinx_rtd_theme/*.sass', 'bower_components/**/*.sass'],
tasks: ['compass:src']
},
/* watch and see if our javascript files change, or new packages are installed */
sphinx_update: {
files: ['src/sphinx_rtd_theme/static/*.css', 'src/sphinx_rtd_theme/*.js', 'demo_docs/source/*.rst', 'src/sphinx_theme/*.html'],
tasks: ['clean:src','exec:build_sphinx']
},
/* watch our files for change, reload */
livereload: {
files: ['demo_docs/build/html/**/*.html', 'demo_docs/build/html/_static/*.css', 'demo_docs/build/html/_static/*.js'],
options: {
livereload: true
}
},
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
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');
2013-11-04 05:59:15 +08:00
grunt.registerTask('default', ['exec:bower_update','clean:src','exec:build_sphinx','connect','open','watch']);
2013-11-04 06:11:18 +08:00
grunt.registerTask('dist', ['clean:dist','compass:dist','copy:dist']);
}