2013-04-20 23:48:29 +00:00
|
|
|
module.exports = function (grunt) {
|
2013-03-22 23:39:08 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
2013-04-18 18:01:21 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
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/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',
|
|
|
|
//'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-22 02:40:39 +00:00
|
|
|
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js',
|
2013-04-23 00:35:04 +00:00
|
|
|
'UI/JsLibraries/backbone.pageable.js' : 'https://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
|
|
|
|
'UI/JsLibraries/backbone.backgrid.js' : 'https://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js'
|
2013-04-20 23:48:29 +00:00
|
|
|
},
|
2013-04-18 18:01:21 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
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'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
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'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2013-03-23 23:24:27 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
handlebars: {
|
|
|
|
options: {
|
|
|
|
namespace : "Templates",
|
|
|
|
wrapped : true,
|
|
|
|
processName: function (fileName) {
|
|
|
|
return fileName
|
|
|
|
.replace('UI/', '')
|
|
|
|
.replace('.html', '')
|
|
|
|
.toLowerCase();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
files : {
|
|
|
|
src : ['UI/**/*emplate.html'],
|
|
|
|
dest: '_output/UI/templates.js'
|
|
|
|
}
|
|
|
|
},
|
2013-03-23 23:24:27 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
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/'
|
|
|
|
}
|
|
|
|
},
|
2013-03-29 01:49:14 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
watch: {
|
|
|
|
bootstrap : {
|
|
|
|
files: '<%= less.bootstrap.src %>',
|
|
|
|
tasks: ['less:bootstrap']
|
|
|
|
},
|
|
|
|
generalLess: {
|
|
|
|
files: ['UI/**/*.less', '!**/Bootstrap/**'],
|
|
|
|
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']
|
|
|
|
},
|
|
|
|
copyFonts : {
|
|
|
|
files: '<%= copy.fonts.src %>',
|
|
|
|
tasks: ['copy:fonts']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2013-03-22 23:39:08 +00:00
|
|
|
|
2013-04-20 23:48:29 +00:00
|
|
|
// Load the plugin that provides the "uglify" task.
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-handlebars');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
|
|
grunt.loadNpmTasks('grunt-wrap');
|
|
|
|
grunt.loadNpmTasks('grunt-notify');
|
|
|
|
grunt.loadNpmTasks('grunt-curl');
|
|
|
|
// Default task(s).
|
|
|
|
grunt.registerTask('default', ['copy', 'less', 'handlebars', 'watch']);
|
|
|
|
grunt.registerTask('package', ['copy', 'less', 'handlebars']);
|
|
|
|
grunt.registerTask('update', ['curl']);
|
2013-03-22 23:39:08 +00:00
|
|
|
|
|
|
|
};
|