Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 1 | /** |
| 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 Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 14 | module.exports = function(grunt) { |
| 15 | // Initializing the configuration object |
| 16 | grunt.initConfig({ |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 17 | // 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 Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 32 | less: { |
| 33 | development: { |
| 34 | options: { |
| 35 | compress: true, |
| 36 | // minifying the result |
| 37 | }, |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 38 | files: { |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 39 | // compiling styles.less into styles.css |
Eric Poirier | f8cff91 | 2018-04-03 09:43:22 -0400 | [diff] [blame] | 40 | "./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 Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | }, |
| 47 | uglify: { |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 48 | 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 Poirier | b96d35c | 2016-08-24 11:49:41 -0400 | [diff] [blame] | 59 | 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 Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 72 | watch: { |
| 73 | js_files: { |
Eric Poirier | b96d35c | 2016-08-24 11:49:41 -0400 | [diff] [blame] | 74 | files: ['./assets/src/javascript/scripts.js'], |
| 75 | tasks: ['uglify:js_files', 'concat:js_donate'] |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 76 | }, |
| 77 | less: { |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 78 | files: ['./assets/src/stylesheets/**/*.less', |
| 79 | './bower_components/solstice-assets/less/*.less', |
| 80 | './bower_components/solstice-assets/**/*.less' |
| 81 | ], |
Eric Poirier | b96d35c | 2016-08-24 11:49:41 -0400 | [diff] [blame] | 82 | tasks: ['less','concat:css_donate'], |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 83 | options: { |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 84 | livereload: true |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 85 | // reloads the browser |
| 86 | } |
| 87 | }, |
| 88 | } |
| 89 | }); |
| 90 | // Plugin loading |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 91 | grunt.loadNpmTasks('grunt-contrib-concat'); |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 92 | grunt.loadNpmTasks('grunt-contrib-watch'); |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 93 | grunt.loadNpmTasks('grunt-contrib-copy'); |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 94 | grunt.loadNpmTasks('grunt-contrib-less'); |
| 95 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
| 96 | // Task definition |
| 97 | grunt.registerTask('default', ['watch']); |
Eric Poirier | 3e32d38 | 2016-08-19 15:27:25 -0400 | [diff] [blame] | 98 | grunt.registerTask('init', ['copy','watch']); |
Christopher Guindon | f0e8ccd | 2015-06-17 11:49:23 -0400 | [diff] [blame] | 99 | }; |