blob: f22efe5261d007aee254b93d2146b957284bbbe2 [file] [log] [blame]
/**
* Eclipse Downloads Grunt File
*
* Copyright (c) 2017 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:
* Eric Poirier (Eclipse Foundation) - initial API and implementation
*/
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/oxygen',
src: ['**'],
dest: 'public/images/',
filter: 'isFile'
}
]
}
},
less: {
development: {
options: {
compress: true,
// minifying the result
},
files: {
// compiling styles.less into styles.css
"public/stylesheets/oxygen.min.css": "bower_components/solstice-assets/stylesheets/eclipse_org/oxygen/oxygen.less",
}
}
},
uglify: {
options: {
mangle: false
// Use if you want the names of your functions and variables
// unchanged.
},
js_files: {
files: {
'public/javascript/oxygen.min.js': 'src/javascript/oxygen.js',
}
},
},
watch: {
js_files: {
files: ['src/javascript/oxygen.js'],
tasks: ['uglify:js_files']
},
less: {
files: ['src/stylesheets/**/*.less',
'bower_components/solstice-assets/less/*.less',
'bower_components/solstice-assets/**/*.less',
],
tasks: ['less'],
options: {
livereload: true
// reloads the browser
}
},
}
});
// Plugin loading
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Task definition
grunt.registerTask('default', ['watch']);
grunt.registerTask('init', ['copy','watch']);
};