1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00
Sonarr/Gruntfile.js

201 lines
8.2 KiB
JavaScript
Raw Normal View History

module.exports = function (grunt) {
2013-07-30 02:05:28 +02:00
'use strict';
var outputRoot = '_output/';
var outputDir = outputRoot +'UI/';
var srcContent = 'UI/Content/';
var destContent = outputDir + 'Content/';
2013-03-23 00:39:08 +01:00
grunt.initConfig({
2013-07-30 02:05:28 +02:00
pkg: grunt.file.readJSON('package.json'),
curl: {
2013-05-15 07:49:31 +02:00
'UI/JsLibraries/backbone.js' : 'http://documentcloud.github.io/backbone/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.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
2013-06-08 21:47:34 +02:00
2013-05-15 07:49:31 +02:00
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
'UI/JsLibraries/backbone.backgrid.paginator.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/paginator/backgrid-paginator.js',
'UI/JsLibraries/backbone.backgrid.filter.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/filter/backgrid-filter.js',
'UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
2013-06-27 02:33:54 +02:00
'UI/JsLibraries/handlebars.helpers.js' : 'http://raw.github.com/danharper/Handlebars-Helpers/master/helpers.js',
2013-05-15 07:49:31 +02:00
'UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
'UI/JsLibraries/jquery.backstretch.js' : 'http://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.js',
2013-06-26 07:44:36 +02:00
'UI/JsLibraries/jquery.signalR.js' : 'http://raw.github.com/SignalR/SignalR/master/samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js',
'UI/JsLibraries/jquery.knob.js' : 'http://raw.github.com/aterrien/jQuery-Knob/master/js/jquery.knob.js',
2013-05-15 07:49:31 +02:00
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'UI/JsLibraries/filesize.js' : 'http://cdn.filesizejs.com/filesize.js',
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
2013-05-15 07:49:31 +02:00
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
'UI/Content/Messenger/messenger.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger.css',
'UI/Content/Messenger/messenger.future.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger-theme-future.css',
2013-06-26 07:42:44 +02:00
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
'UI/Content/prefixer.less' : 'http://raw.github.com/JoelSutherland/LESS-Prefixer/master/prefixer.less'
},
clean: {
2013-07-30 02:05:28 +02:00
output: outputDir,
scripts: [ outputDir + '/**.js','!_output/UI/**/templates.js']
},
less : {
2013-06-26 07:42:44 +02:00
options:{
dumpLineNumbers : 'false',
compress : false,
yuicompress : false,
ieCompat : false
},
bootstrap: {
2013-07-30 02:05:28 +02:00
src : srcContent + 'Bootstrap/bootstrap.less',
dest: destContent + 'bootstrap.css'
},
general : {
files: [
{
expand: true,
2013-06-26 02:33:17 +02:00
src : [
'UI/Content/base.less',
'UI/Content/overrides.less',
'UI/Series/series.less',
2013-06-26 02:33:17 +02:00
'UI/AddSeries/addSeries.less',
'UI/Calendar/calendar.less',
'UI/Cells/cells.less',
2013-07-14 04:40:47 +02:00
'UI/Logs/logs.less',
2013-06-26 02:33:17 +02:00
'UI/Settings/settings.less',
],
2013-07-30 02:05:28 +02:00
dest : outputRoot,
ext : '.css'
}
]
}
},
handlebars: {
options: {
2013-07-30 02:05:28 +02:00
namespace : 'T',
partialRegex: /Partial.html/,
wrapped : true,
amd : true,
processName: function (fileName) {
return fileName
.replace('UI/', '')
.replace('.html', '')
.toLowerCase();
}
},
files : {
2013-07-30 02:05:28 +02:00
src : ['UI/**/*Template.html','UI/**/*Partial.html'],
dest: outputDir + 'templates.js'
}
},
copy: {
index : {
2013-06-08 21:47:51 +02:00
src : 'UI/*ndex.html',
2013-07-30 02:05:28 +02:00
dest: outputRoot
},
scripts: {
src : 'UI/**/*.js',
2013-07-30 02:05:28 +02:00
dest: outputRoot
},
styles : {
src : 'UI/**/*.css',
2013-07-30 02:05:28 +02:00
dest: outputRoot
},
images : {
src : 'UI/**/*.png',
2013-07-30 02:05:28 +02:00
dest: outputRoot
},
jpg : {
src : 'UI/**/*.jpg',
2013-07-30 02:05:28 +02:00
dest: outputRoot
},
2013-07-07 00:46:11 +02:00
icon : {
src : 'UI/**/*.ico',
2013-07-30 02:05:28 +02:00
dest: outputRoot
2013-07-07 00:46:11 +02:00
},
2013-06-15 02:29:38 +02:00
fontAwesome : {
src : 'UI/**/FontAwesome/*.*',
2013-07-30 02:05:28 +02:00
dest: outputRoot
2013-06-15 02:29:38 +02:00
},
fonts : {
src : 'UI/**/fonts/*.*',
2013-07-30 02:05:28 +02:00
dest: outputRoot
}
},
2013-03-29 02:49:14 +01:00
watch: {
options: {
nospawn: false,
},
bootstrap : {
2013-07-30 02:05:28 +02:00
files: [ srcContent + 'Bootstrap/**', srcContent +'FontAwesome/**'],
tasks: ['less:bootstrap','less:general']
},
generalLess: {
2013-07-30 02:05:28 +02:00
files: '<%= less.general.files[0].src %>',
tasks: ['less:general']
},
handlebars : {
files: '<%= handlebars.files.src %>',
tasks: ['handlebars']
},
copyIndex : {
files: '<%= copy.index.src %>',
tasks: ['copy:index']
},
copyScripts: {
files: '<%= copy.scripts.src %>',
tasks: ['copy:scripts']
},
copyStyles : {
files: '<%= copy.styles.src %>',
tasks: ['copy:styles']
},
copyImages : {
files: '<%= copy.images.src %>',
tasks: ['copy:images']
},
copyJpg : {
files: '<%= copy.jpg.src %>',
tasks: ['copy:jpg']
},
2013-07-30 02:05:28 +02:00
copyIcon : {
2013-07-07 00:46:11 +02:00
files: '<%= copy.icon.src %>',
tasks: ['copy:icon']
},
2013-06-15 02:29:38 +02:00
copyFontAwesome : {
files: '<%= copy.fontAwesome.src %>',
tasks: ['copy:fontAwesome']
},
copyFonts : {
files: '<%= copy.fonts.src %>',
tasks: ['copy:fonts']
}
}
});
2013-03-23 00:39:08 +01:00
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
2013-07-30 02:05:28 +02:00
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-curl');
2013-07-30 02:05:28 +02:00
grunt.registerTask('package', ['clean:output', 'copy', 'less', 'handlebars']);
grunt.registerTask('default', ['package', 'watch']);
grunt.registerTask('update', ['curl']);
2013-03-23 00:39:08 +01:00
2013-06-08 21:47:34 +02:00
};