blob: e4a5c43fa84bfbd95bbf591bc3025b4bc04fb76a [file] [log] [blame]
/**
* Eclipse Downloads Grunt File
*
* Copyright (c) 2015 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christopher Guindon (Eclipse Foundation)- initial API and implementation
* Eric Poirier (Eclipse Foundation)
*/
module.exports = function(grunt) {
// Initializing the configuration object
grunt.initConfig({
// Task configuration
copy: {
main: {
files: [
// includes files within path
{
expand: true,
cwd: 'bower_components/solstice-assets/images/eclipse_org/downloads',
src: ['**'],
dest: 'public/images/',
filter: 'isFile'
}
]
}
},
less: {
development: {
options: {
compress: true,
// minifying the result
},
files: {
// compiling styles.less into styles.css
"./public/stylesheets/downloads.min.css": "./bower_components/solstice-assets/less/quicksilver/packages/components/downloads.less",
"./public/stylesheets/thankyou.min.css": "./bower_components/solstice-assets/less/quicksilver/packages/components/thankyou.less",
"./public/stylesheets/mirror.min.css": "./bower_components/solstice-assets/less/quicksilver/packages/components/mirror.less"
}
}
},
concat: {
options: {
//separator: ';',
},
css_thankyou: {
src: ['./public/stylesheets/thankyou.min.css', './bower_components/jquery-ui/base/minified/jquery-ui.min.css'],
dest: './public/stylesheets/thankyou.min.css',
},
css_download: {
src: ['./public/stylesheets/downloads.min.css'],
dest: './public/stylesheets/downloads.min.css',
},
},
uglify: {
options: {
mangle: false
// Use if you want the names of your functions and variables
// unchanged.
},
js_files: {
files: {
'./public/javascript/mirror.min.js': './src/javascript/mirror.js'
}
},
},
watch: {
js_files: {
files: [
'./src/javascript/mirror.js', './src/javascript/compare.js', './src/javascript/packages.js'],
tasks: ['concat:js_download', 'uglify:js_files']
},
less: {
files: ['./src/stylesheets/**/*.less',
'./bower_components/solstice-assets/less/*.less',
'./bower_components/solstice-assets/**/*.less',
],
tasks: ['less','concat'],
options: {
livereload: true
// reloads the browser
}
},
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Task definition
grunt.registerTask('default', ['watch']);
grunt.registerTask('init', ['copy','watch']);
};