You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.2 KiB

11 years ago
'use strict';
module.exports = function(grunt){
10 years ago
require('jit-grunt')(grunt);
require('time-grunt')(grunt);
11 years ago
// Configurable paths
var config = {
tmp: '.tmp',
11 years ago
base: 'couchpotato',
css_dest: 'couchpotato/static/style/combined.min.css'
11 years ago
};
grunt.initConfig({
// Project settings
config: config,
// Make sure code styles are up to par and there are no obvious mistakes
jshint: {
options: {
reporter: require('jshint-stylish'),
unused: false,
camelcase: false,
devel: true
},
all: [
'<%= config.base %>/{,**/}*.js',
'!<%= config.base %>/static/scripts/vendor/{,**/}*.js'
11 years ago
]
},
// Compiles Sass to CSS and generates necessary files if requested
sass: {
options: {
11 years ago
compass: true,
10 years ago
update: true,
sourcemap: 'none'
11 years ago
},
server: {
files: [{
expand: true,
cwd: '<%= config.base %>/',
src: ['**/*.scss'],
11 years ago
dest: '<%= config.tmp %>/styles/',
11 years ago
ext: '.css'
}]
}
},
// Add vendor prefixed styles
autoprefixer: {
options: {
10 years ago
browsers: ['last 2 versions'],
remove: false,
cascade: false
11 years ago
},
dist: {
files: [{
expand: true,
cwd: '<%= config.tmp %>/styles/',
src: '{,**/}*.css',
dest: '<%= config.tmp %>/styles/'
}]
}
},
11 years ago
cssmin: {
11 years ago
dist: {
options: {
keepBreaks: true
},
11 years ago
files: {
'<%= config.css_dest %>': ['<%= config.tmp %>/styles/**/*.css']
}
11 years ago
}
},
shell: {
runCouchPotato: {
command: 'python CouchPotato.py',
maxBuffer: 1048576
}
},
11 years ago
// COOL TASKS ==============================================================
watch: {
scss: {
11 years ago
files: ['<%= config.base %>/**/*.{scss,sass}'],
10 years ago
tasks: ['sass:server', 'autoprefixer']
11 years ago
},
js: {
files: [
11 years ago
'<%= config.base %>/**/*.js'
11 years ago
],
tasks: ['jshint']
11 years ago
},
livereload: {
options: {
livereload: 35729
},
files: [
'<%= config.css_dest %>'
11 years ago
]
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
tasks: ['shell:runCouchPotato', 'watch']
11 years ago
}
});
grunt.registerTask('default', ['sass:server', 'autoprefixer', 'cssmin', 'concurrent']);
11 years ago
};