2013-03-23 00:39:08 +01:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2013-04-18 20:01:21 +02:00
|
|
|
|
|
|
|
curl: {
|
|
|
|
'UI/JsLibraries/backbone.collectionbinder.js': 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.CollectionBinder.js',
|
2013-04-19 01:14:08 +02:00
|
|
|
'UI/JsLibraries/backbone.js': 'http://backbonejs.org/backbone.js',
|
|
|
|
'UI/JsLibraries/backbone.marionette.js': 'http://marionettejs.com/downloads/backbone.marionette.js',
|
2013-04-18 20:01:21 +02:00
|
|
|
'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':
|
2013-04-19 01:14:08 +02:00
|
|
|
'UI/JsLibraries/bootstrap.switch.js': 'http://raw.github.com/nostalgiaz/bootstrap-switch/master/static/js/bootstrapSwitch.js',
|
2013-04-18 20:01:21 +02:00
|
|
|
'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',
|
2013-04-19 01:14:08 +02:00
|
|
|
'UI/JsLibraries/underscore.js': 'http://underscorejs.org/underscore.js'
|
2013-04-18 20:01:21 +02:00
|
|
|
},
|
|
|
|
|
2013-03-23 00:39:08 +01:00
|
|
|
uglify: {
|
2013-03-24 00:24:27 +01:00
|
|
|
files: {
|
|
|
|
expand: true, // Enable dynamic expansion.
|
2013-03-29 20:18:44 +01:00
|
|
|
cwd: 'UI/', // Src matches are relative to this path.
|
2013-03-24 00:24:27 +01:00
|
|
|
src: ['**/*.js'], // Actual pattern(s) to match.
|
|
|
|
dest: 'build/', // Destination path prefix.
|
2013-03-24 01:14:55 +01:00
|
|
|
ext: '.min.js'
|
2013-03-24 00:24:27 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
less:{
|
|
|
|
bootstrap:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: ["UI/Content/bootstrap/bootstrap.less"],
|
2013-03-29 02:49:14 +01:00
|
|
|
dest: "_output/UI/Content/bootstrap.css"
|
2013-03-23 00:39:08 +01:00
|
|
|
}
|
|
|
|
},
|
2013-03-24 00:24:27 +01:00
|
|
|
|
2013-03-23 00:39:08 +01:00
|
|
|
handlebars: {
|
|
|
|
options: {
|
2013-03-30 00:00:38 +01:00
|
|
|
namespace: "Templates",
|
2013-04-19 01:14:08 +02:00
|
|
|
wrapped: true,
|
2013-03-24 00:24:27 +01:00
|
|
|
processName: function(fileName){
|
|
|
|
return fileName
|
2013-03-29 20:18:44 +01:00
|
|
|
.replace('UI/','')
|
2013-03-30 20:13:10 +01:00
|
|
|
.replace('.html','')
|
|
|
|
.toLowerCase();
|
2013-03-24 00:24:27 +01:00
|
|
|
}
|
2013-03-23 00:39:08 +01:00
|
|
|
},
|
|
|
|
files: {
|
2013-03-29 20:18:44 +01:00
|
|
|
src: ['UI/**/*emplate.html'],
|
2013-03-29 02:49:14 +01:00
|
|
|
dest: '_output/UI/templates.js'
|
2013-03-24 00:24:27 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2013-03-29 02:49:14 +01:00
|
|
|
copy:{
|
|
|
|
index:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: 'UI/index.html',
|
2013-03-29 02:49:14 +01:00
|
|
|
dest: '_output/UI/index.html'
|
|
|
|
},
|
|
|
|
scripts:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: 'UI/**/*.js',
|
|
|
|
dest: '_output/'
|
2013-03-29 02:49:14 +01:00
|
|
|
},
|
|
|
|
styles:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: 'UI/**/*.css',
|
|
|
|
dest: '_output/'
|
2013-03-29 02:49:14 +01:00
|
|
|
},
|
|
|
|
images:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: 'UI/**/*.png',
|
|
|
|
dest: '_output/'
|
2013-03-29 02:49:14 +01:00
|
|
|
},
|
|
|
|
fonts:{
|
2013-03-29 20:18:44 +01:00
|
|
|
src: 'UI/**/Fonts/*.*',
|
|
|
|
dest: '_output/',
|
2013-03-29 02:49:14 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-03-24 00:24:27 +01:00
|
|
|
watch:{
|
|
|
|
bootstrap:{
|
2013-03-29 02:49:14 +01:00
|
|
|
files: 'NzbDrone.Backbone/Content/bootstrap/*.less',
|
2013-03-24 00:24:27 +01:00
|
|
|
tasks: ['less:bootstrap']
|
|
|
|
},
|
|
|
|
handlebars:{
|
|
|
|
files: '<%= handlebars.files.src %>',
|
|
|
|
tasks: ['handlebars']
|
2013-03-29 02:49:14 +01:00
|
|
|
},
|
|
|
|
copyIndex:{
|
|
|
|
files: '<%= copy.index.src %>',
|
|
|
|
tasks: ['copy:index']
|
|
|
|
},
|
|
|
|
copyScripts:{
|
2013-03-29 20:18:44 +01:00
|
|
|
files: '<%= copy.scripts.src %>',
|
2013-03-29 02:49:14 +01:00
|
|
|
tasks: ['copy:scripts']
|
|
|
|
},
|
|
|
|
copyStyles:{
|
2013-03-29 20:18:44 +01:00
|
|
|
files: '<%= copy.styles.src %>',
|
2013-03-29 02:49:14 +01:00
|
|
|
tasks: ['copy:styles']
|
|
|
|
},
|
|
|
|
copyImages:{
|
2013-03-29 20:18:44 +01:00
|
|
|
files: '<%= copy.images.src %>',
|
2013-03-29 02:49:14 +01:00
|
|
|
tasks: ['copy:images']
|
|
|
|
},
|
|
|
|
copyFonts:{
|
|
|
|
files: '<%= copy.fonts.src %>',
|
|
|
|
tasks: ['copy:fonts']
|
2013-03-23 00:39:08 +01:00
|
|
|
}
|
2013-03-24 00:24:27 +01:00
|
|
|
}
|
|
|
|
});
|
2013-03-23 00:39:08 +01:00
|
|
|
|
|
|
|
// Load the plugin that provides the "uglify" task.
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-handlebars');
|
2013-03-24 00:24:27 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
2013-03-29 02:49:14 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
2013-03-29 20:17:03 +01:00
|
|
|
grunt.loadNpmTasks('grunt-wrap');
|
2013-04-12 06:39:29 +02:00
|
|
|
grunt.loadNpmTasks('grunt-notify');
|
2013-04-18 20:01:21 +02:00
|
|
|
grunt.loadNpmTasks('grunt-curl');
|
2013-03-23 00:39:08 +01:00
|
|
|
// Default task(s).
|
2013-03-29 02:49:14 +01:00
|
|
|
grunt.registerTask('default', ['copy','less:bootstrap','handlebars', 'watch']);
|
2013-04-19 08:38:26 +02:00
|
|
|
grunt.registerTask('package', ['copy','less:bootstrap','handlebars']);
|
2013-04-19 01:14:08 +02:00
|
|
|
grunt.registerTask('update', ['curl']);
|
2013-03-23 00:39:08 +01:00
|
|
|
|
|
|
|
};
|