1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 12:32:31 +01:00
Radarr/Gruntfile.js

242 lines
10 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 srcRoot = 'src/UI/'
var srcContent = srcRoot + 'Content/';
2013-07-30 02:05:28 +02:00
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: {
'src/UI/JsLibraries/backbone.js' : 'http://documentcloud.github.io/backbone/backbone.js',
'src/UI/JsLibraries/backbone.marionette.js' : 'http://marionettejs.com/downloads/backbone.marionette.js',
'src/UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
'src/UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
2013-06-08 21:47:34 +02:00
'src/UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'src/UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
'src/UI/JsLibraries/backbone.backgrid.paginator.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/paginator/backgrid-paginator.js',
'src/UI/JsLibraries/backbone.backgrid.filter.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/filter/backgrid-filter.js',
2013-05-15 07:49:31 +02:00
'src/UI/JsLibraries/backbone.backgrid.selectall.js' : 'http://raw.github.com/wyuenho/backgrid-select-all/master/backgrid-select-all.js',
'src/UI/Content/Backgrid/selectall.css' : 'http://raw.github.com/wyuenho/backgrid-select-all/master/backgrid-select-all.css',
'src/UI/JsLibraries/backbone.validation.js' : 'https://raw.github.com/thedersen/backbone.validation/master/dist/backbone-validation.js',
'src/UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
'src/UI/JsLibraries/handlebars.helpers.js' : 'http://raw.github.com/danharper/Handlebars-Helpers/master/helpers.js',
2013-05-15 07:49:31 +02:00
'src/UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
'src/UI/JsLibraries/jquery.backstretch.js' : 'http://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.js',
'src/UI/JsLibraries/jquery.signalR.js' : 'http://raw.github.com/SignalR/SignalR/master/samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js',
'src/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
'src/UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'src/UI/JsLibraries/filesize.js' : 'http://cdn.filesizejs.com/filesize.js',
'src/UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
2013-05-15 07:49:31 +02:00
'src/UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
'src/UI/Content/Messenger/messenger.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger.css',
'src/UI/Content/Messenger/messenger.future.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger-theme-future.css',
2013-05-15 07:49:31 +02:00
'src/UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
'src/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',
2013-09-12 01:33:34 +02:00
compress : true,
2013-06-26 07:42:44 +02:00
yuicompress : false,
2013-09-12 01:33:34 +02:00
ieCompat : true,
strictImports : true
2013-06-26 07:42:44 +02:00
},
bootstrap: {
2013-07-30 02:05:28 +02:00
src : srcContent + 'Bootstrap/bootstrap.less',
dest: destContent + 'bootstrap.css'
},
general : {
cwd : srcRoot,
expand : true,
src :[
'Content/theme.less',
'Content/overrides.less',
'Series/series.less',
'AddSeries/addSeries.less',
'Calendar/calendar.less',
'Cells/cells.less',
'Settings/settings.less',
'System/Logs/logs.less',
'System/Update/update.less'
2013-08-02 03:00:30 +02:00
],
dest : outputDir,
2013-08-02 03:00:30 +02:00
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(srcRoot, '')
.replace('.html', '')
.toLowerCase();
}
},
files : {
src : [ srcRoot + '**/*Template.html', srcRoot + '**/*Partial.html'],
2013-07-30 02:05:28 +02:00
dest: outputDir + 'templates.js'
}
},
copy: {
index : {
cwd : srcRoot,
expand: true,
src : '*ndex.html',
dest : outputDir
},
scripts: {
cwd : srcRoot,
expand: true,
src : '**/*.js',
dest : outputDir
},
styles : {
cwd : srcRoot,
expand: true,
src : '**/*.css',
dest : outputDir
},
images : {
cwd : srcRoot,
expand: true,
src : '**/*.png',
dest : outputDir
},
jpg : {
cwd : srcRoot,
expand: true,
src : '**/*.jpg',
dest : outputDir
},
2013-07-07 00:46:11 +02:00
icon : {
cwd : srcRoot,
expand: true,
src : '**/*.ico',
dest : outputDir
2013-07-07 00:46:11 +02:00
},
2013-06-15 02:29:38 +02:00
fontAwesome : {
cwd : srcRoot,
expand: true,
src : '**/FontAwesome/*.*',
dest : outputDir
2013-06-15 02:29:38 +02:00
},
fonts : {
cwd : srcRoot,
expand: true,
src : '**/fonts/*.*',
dest : outputDir
}
},
2013-03-29 02:49:14 +01:00
2013-10-09 03:43:41 +02:00
requirejs: {
compile:{
options: {
mainConfigFile: "_output/UI/app.js",
fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/,
preserveLicenseComments: true,
dir: "rjs/",
optimize: 'none',
removeCombined: true,
inlineText: false,
modules: [{
name: 'app',
exclude: ['JsLibraries/jquery']
}],
}
}
},
watch: {
options: {
nospawn: false,
},
bootstrap : {
2013-07-30 02:05:28 +02:00
files: [ srcContent + 'Bootstrap/**', srcContent +'FontAwesome/**'],
tasks: ['less:bootstrap','less:general']
},
generalLess: {
files: [ srcRoot + '**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**'],
tasks: ['less:general']
},
handlebars : {
files: '<%= handlebars.files.src %>',
tasks: ['handlebars']
},
copyIndex : {
files: '<%= copy.index.cwd %><%= copy.index.src %>',
tasks: ['copy:index']
},
copyScripts: {
files: '<%= copy.scripts.cwd %><%= copy.scripts.src %>',
tasks: ['copy:scripts']
},
copyStyles : {
files: '<%= copy.styles.cwd %><%= copy.styles.src %>',
tasks: ['copy:styles']
},
copyImages : {
files: '<%= copy.images.cwd %><%= copy.images.src %>',
tasks: ['copy:images']
},
copyJpg : {
files: '<%= copy.jpg.cwd %><%= copy.jpg.src %>',
tasks: ['copy:jpg']
},
2013-07-30 02:05:28 +02:00
copyIcon : {
files: '<%= copy.icon.cwd %><%= copy.icon.src %>',
2013-07-07 00:46:11 +02:00
tasks: ['copy:icon']
},
2013-06-15 02:29:38 +02:00
copyFontAwesome : {
files: '<%= copy.fontAwesome.cwd %><%= copy.fontAwesome.src %>',
2013-06-15 02:29:38 +02:00
tasks: ['copy:fontAwesome']
},
copyFonts : {
files: '<%= copy.fonts.cwd %><%= 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-10-09 03:43:41 +02:00
grunt.loadNpmTasks('grunt-contrib-requirejs');
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
};