sol2/Gruntfile.js

106 lines
2.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
}
}
},
2014-02-01 00:58:37 +08:00
copy: {
fonts: {
files: [
// includes files within path
{expand: true, flatten: true, src: ['bower_components/font-awesome/fonts/*'], dest: 'sphinx_rtd_theme/static/fonts/', filter: 'isFile'}
]
}
},
2013-11-04 05:37:56 +08:00
sass: {
dev: {
options: {
style: 'expanded',
loadPath: ['bower_components/bourbon/app/assets/stylesheets', 'bower_components/neat/app/assets/stylesheets', 'bower_components/font-awesome/scss', 'bower_components/wyrm/sass']
},
files: [{
expand: true,
cwd: 'sass',
src: ['*.sass'],
dest: 'sphinx_rtd_theme/static/css',
ext: '.css'
}]
2013-11-04 05:37:56 +08:00
},
build: {
2013-11-04 05:37:56 +08:00
options: {
style: 'compressed',
loadPath: ['bower_components/bourbon/app/assets/stylesheets', 'bower_components/neat/app/assets/stylesheets', 'bower_components/font-awesome/scss', 'bower_components/wyrm/sass']
},
files: [{
expand: true,
cwd: 'sass',
src: ['*.sass'],
dest: 'sphinx_rtd_theme/static/css',
ext: '.css'
}]
}
},
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: {
2014-02-01 00:58:37 +08:00
build: ["demo_docs/build"],
fonts: ["sphinx_rtd_theme/static/fonts"]
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: ['sass:dev']
2013-11-04 05:37:56 +08:00
},
/* Changes in theme dir rebuild sphinx */
sphinx: {
files: ['sphinx_rtd_theme/**/*', 'demo_docs/**/*.rst', 'demo_docs/**/*.py'],
2013-11-05 01:13:03 +08:00
tasks: ['clean:build','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-sass');
2013-11-04 05:37:56 +08:00
grunt.loadNpmTasks('grunt-contrib-clean');
2014-02-01 00:58:37 +08:00
grunt.loadNpmTasks('grunt-contrib-copy');
2013-11-04 05:59:15 +08:00
grunt.loadNpmTasks('grunt-open');
2014-02-01 00:58:37 +08:00
grunt.registerTask('fonts', ['clean:fonts','copy:fonts']);
grunt.registerTask('default', ['exec:bower_update','clean:build','sass:dev','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['exec:bower_update','clean:build','sass:build','exec:build_sphinx']);
}