blob: 5c9616a7b9c09b4812c9343877f05e6c96cd79d3 [file] [log] [blame]
Eric Poirier3e32d382016-08-19 15:27:25 -04001/**
2 * Eclipse Donate Grunt File
3 *
4 * Copyright (c) 2015 Eclipse Foundation and others.
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors:
11 * Christopher Guindon (Eclipse Foundation)- initial API and implementation
12 * Eric Poirier (Eclipse Foundation)
13 */
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040014module.exports = function(grunt) {
15 // Initializing the configuration object
16 grunt.initConfig({
Eric Poirier3e32d382016-08-19 15:27:25 -040017 // Task configuration
18 copy: {
19 main: {
20 files: [
21 // includes files within path
22 {
23 expand: true,
24 cwd: 'bower_components/solstice-assets/images/eclipse_org/donate',
25 src: ['**'],
26 dest: 'images/',
27 filter: 'isFile'
28 }
29 ]
30 }
31 },
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040032 less: {
33 development: {
34 options: {
35 compress: true,
36 // minifying the result
37 },
Eric Poirier3e32d382016-08-19 15:27:25 -040038 files: {
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040039 // compiling styles.less into styles.css
Eric Poirierf8cff912018-04-03 09:43:22 -040040 "./assets/public/stylesheets/credit.min.css": "./bower_components/solstice-assets/stylesheets/_components/eclipse_org/donate/credit.less",
41 "./assets/public/stylesheets/donorlist.min.css": "./bower_components/solstice-assets/stylesheets/_components/eclipse_org/donate/donorlist.less",
42 "./assets/public/stylesheets/improve.min.css": "./bower_components/solstice-assets/stylesheets/_components/eclipse_org/donate/improve.less",
43 "./assets/public/stylesheets/support.min.css": "./bower_components/solstice-assets/stylesheets/_components/eclipse_org/donate/support.less"
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040044 }
45 }
46 },
47 uglify: {
Eric Poirier3e32d382016-08-19 15:27:25 -040048 options: {
49 mangle: true
50 // Use if you want the names of your functions and variables
51 // unchanged.
52 },
53 js_files: {
54 files: {
55 './assets/public/javascript/scripts.min.js': './assets/src/javascript/scripts.js',
56 }
57 },
58 },
Eric Poirierb96d35c2016-08-24 11:49:41 -040059 concat: {
60 options: {
61 //separator: ';',
62 },
63 js_donate: {
64 src: ['./bower_components/range-slider/dist/rangeslider.min.js', './assets/public/javascript/scripts.min.js'],
65 dest: './assets/public/javascript/scripts.min.js',
66 },
67 css_donate: {
68 src: ['./bower_components/range-slider/dist/rangeslider.css', './assets/public/stylesheets/improve.min.css'],
69 dest: './assets/public/stylesheets/improve.min.css',
70 },
71 },
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040072 watch: {
73 js_files: {
Eric Poirierb96d35c2016-08-24 11:49:41 -040074 files: ['./assets/src/javascript/scripts.js'],
75 tasks: ['uglify:js_files', 'concat:js_donate']
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040076 },
77 less: {
Eric Poirier3e32d382016-08-19 15:27:25 -040078 files: ['./assets/src/stylesheets/**/*.less',
79 './bower_components/solstice-assets/less/*.less',
80 './bower_components/solstice-assets/**/*.less'
81 ],
Eric Poirierb96d35c2016-08-24 11:49:41 -040082 tasks: ['less','concat:css_donate'],
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040083 options: {
Eric Poirier3e32d382016-08-19 15:27:25 -040084 livereload: true
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040085 // reloads the browser
86 }
87 },
88 }
89 });
90 // Plugin loading
Eric Poirier3e32d382016-08-19 15:27:25 -040091 grunt.loadNpmTasks('grunt-contrib-concat');
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040092 grunt.loadNpmTasks('grunt-contrib-watch');
Eric Poirier3e32d382016-08-19 15:27:25 -040093 grunt.loadNpmTasks('grunt-contrib-copy');
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040094 grunt.loadNpmTasks('grunt-contrib-less');
95 grunt.loadNpmTasks('grunt-contrib-uglify');
96 // Task definition
97 grunt.registerTask('default', ['watch']);
Eric Poirier3e32d382016-08-19 15:27:25 -040098 grunt.registerTask('init', ['copy','watch']);
Christopher Guindonf0e8ccd2015-06-17 11:49:23 -040099};