mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-26 01:37:07 +00:00
added support for less file to grunt runner.
This commit is contained in:
parent
27f45cfdee
commit
33aad6e8ef
2 changed files with 137 additions and 123 deletions
136
Gruntfile.js
136
Gruntfile.js
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(grunt) {
|
||||
module.exports = function (grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
|
@ -6,106 +6,120 @@ module.exports = function(grunt) {
|
|||
|
||||
curl: {
|
||||
'UI/JsLibraries/backbone.collectionbinder.js': 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.CollectionBinder.js',
|
||||
'UI/JsLibraries/backbone.js': 'http://backbonejs.org/backbone.js',
|
||||
'UI/JsLibraries/backbone.marionette.js': 'http://marionettejs.com/downloads/backbone.marionette.js',
|
||||
'UI/JsLibraries/backbone.modelbinder.js': 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
|
||||
'UI/JsLibraries/backbone.mutators.js': 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
|
||||
'UI/JsLibraries/backbone.shortcuts.js': 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
|
||||
'UI/JsLibraries/backbone.js' : 'http://backbonejs.org/backbone.js',
|
||||
'UI/JsLibraries/backbone.marionette.js' : 'http://marionettejs.com/downloads/backbone.marionette.js',
|
||||
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
|
||||
'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
|
||||
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
|
||||
//'UI/JsLibraries/bootstrap.js':
|
||||
//'UI/JsLibraries/bootstrap.slider.js':
|
||||
'UI/JsLibraries/bootstrap.switch.js': 'http://raw.github.com/nostalgiaz/bootstrap-switch/master/static/js/bootstrapSwitch.js',
|
||||
'UI/JsLibraries/handlebars.runtime.js': 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
|
||||
'UI/JsLibraries/jquery.cookie.js': 'http://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js',
|
||||
'UI/JsLibraries/jquery.js': 'http://code.jquery.com/jquery.js',
|
||||
'UI/JsLibraries/bootstrap.switch.js' : 'http://raw.github.com/nostalgiaz/bootstrap-switch/master/static/js/bootstrapSwitch.js',
|
||||
'UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
|
||||
'UI/JsLibraries/jquery.cookie.js' : 'http://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js',
|
||||
'UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
|
||||
//'NzbDrone.Backbone/JsLibraries/jquery.tablesorter.bootstrap.js':
|
||||
//'NzbDrone.Backbone/JsLibraries/jquery.tablesorter.js':
|
||||
'UI/JsLibraries/require.js': 'http://raw.github.com/jrburke/requirejs/master/require.js',
|
||||
'UI/JsLibraries/sugar.js': 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
|
||||
'UI/JsLibraries/underscore.js': 'http://underscorejs.org/underscore.js'
|
||||
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
|
||||
'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
|
||||
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js'
|
||||
},
|
||||
|
||||
uglify: {
|
||||
files: {
|
||||
expand: true, // Enable dynamic expansion.
|
||||
cwd: 'UI/', // Src matches are relative to this path.
|
||||
src: ['**/*.js'], // Actual pattern(s) to match.
|
||||
dest: 'build/', // Destination path prefix.
|
||||
ext: '.min.js'
|
||||
cwd : 'UI/', // Src matches are relative to this path.
|
||||
src : ['**/*.js'], // Actual pattern(s) to match.
|
||||
dest : 'build/', // Destination path prefix.
|
||||
ext : '.min.js'
|
||||
}
|
||||
},
|
||||
less:{
|
||||
bootstrap:{
|
||||
src: ["UI/Content/bootstrap/bootstrap.less"],
|
||||
less : {
|
||||
bootstrap: {
|
||||
src : "UI/Content/bootstrap/bootstrap.less",
|
||||
dest: "_output/UI/Content/bootstrap.css"
|
||||
},
|
||||
general : {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
src : ['UI/**/*.less', '!**/Bootstrap/**'],
|
||||
dest : '_output/',
|
||||
ext : '.css'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
handlebars: {
|
||||
options: {
|
||||
namespace: "Templates",
|
||||
wrapped: true,
|
||||
processName: function(fileName){
|
||||
namespace : "Templates",
|
||||
wrapped : true,
|
||||
processName: function (fileName) {
|
||||
return fileName
|
||||
.replace('UI/','')
|
||||
.replace('.html','')
|
||||
.replace('UI/', '')
|
||||
.replace('.html', '')
|
||||
.toLowerCase();
|
||||
}
|
||||
},
|
||||
files: {
|
||||
src: ['UI/**/*emplate.html'],
|
||||
files : {
|
||||
src : ['UI/**/*emplate.html'],
|
||||
dest: '_output/UI/templates.js'
|
||||
},
|
||||
},
|
||||
|
||||
copy:{
|
||||
index:{
|
||||
src: 'UI/index.html',
|
||||
dest: '_output/UI/index.html'
|
||||
},
|
||||
scripts:{
|
||||
src: 'UI/**/*.js',
|
||||
dest: '_output/'
|
||||
},
|
||||
styles:{
|
||||
src: 'UI/**/*.css',
|
||||
dest: '_output/'
|
||||
},
|
||||
images:{
|
||||
src: 'UI/**/*.png',
|
||||
dest: '_output/'
|
||||
},
|
||||
fonts:{
|
||||
src: 'UI/**/Fonts/*.*',
|
||||
dest: '_output/',
|
||||
}
|
||||
},
|
||||
|
||||
watch:{
|
||||
bootstrap:{
|
||||
files: 'NzbDrone.Backbone/Content/bootstrap/*.less',
|
||||
copy: {
|
||||
index : {
|
||||
src : 'UI/index.html',
|
||||
dest: '_output/UI/index.html'
|
||||
},
|
||||
scripts: {
|
||||
src : 'UI/**/*.js',
|
||||
dest: '_output/'
|
||||
},
|
||||
styles : {
|
||||
src : 'UI/**/*.css',
|
||||
dest: '_output/'
|
||||
},
|
||||
images : {
|
||||
src : 'UI/**/*.png',
|
||||
dest: '_output/'
|
||||
},
|
||||
fonts : {
|
||||
src : 'UI/**/Fonts/*.*',
|
||||
dest: '_output/'
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
bootstrap : {
|
||||
files: '<%= less.bootstrap.src %>',
|
||||
tasks: ['less:bootstrap']
|
||||
},
|
||||
handlebars:{
|
||||
generalLess: {
|
||||
files: ['UI/**/*.less', '!**/Bootstrap/**'],
|
||||
tasks: ['less:general']
|
||||
},
|
||||
handlebars : {
|
||||
files: '<%= handlebars.files.src %>',
|
||||
tasks: ['handlebars']
|
||||
},
|
||||
copyIndex:{
|
||||
copyIndex : {
|
||||
files: '<%= copy.index.src %>',
|
||||
tasks: ['copy:index']
|
||||
},
|
||||
copyScripts:{
|
||||
copyScripts: {
|
||||
files: '<%= copy.scripts.src %>',
|
||||
tasks: ['copy:scripts']
|
||||
},
|
||||
copyStyles:{
|
||||
copyStyles : {
|
||||
files: '<%= copy.styles.src %>',
|
||||
tasks: ['copy:styles']
|
||||
},
|
||||
copyImages:{
|
||||
copyImages : {
|
||||
files: '<%= copy.images.src %>',
|
||||
tasks: ['copy:images']
|
||||
},
|
||||
copyFonts:{
|
||||
copyFonts : {
|
||||
files: '<%= copy.fonts.src %>',
|
||||
tasks: ['copy:fonts']
|
||||
}
|
||||
|
@ -123,8 +137,8 @@ module.exports = function(grunt) {
|
|||
grunt.loadNpmTasks('grunt-notify');
|
||||
grunt.loadNpmTasks('grunt-curl');
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['copy','less:bootstrap','handlebars', 'watch']);
|
||||
grunt.registerTask('package', ['copy','less:bootstrap','handlebars']);
|
||||
grunt.registerTask('default', ['copy', 'less', 'handlebars', 'watch']);
|
||||
grunt.registerTask('package', ['copy', 'less', 'handlebars']);
|
||||
grunt.registerTask('update', ['curl']);
|
||||
|
||||
};
|
Loading…
Reference in a new issue