Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*global module:false*/
- module.exports = function(grunt) {
- grunt.loadNpmTasks('grunt-composer');
- // These plugins provide necessary tasks.
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-concat-css');
- grunt.loadNpmTasks('grunt-contrib-less');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-nodeunit');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-bower-task');
- grunt.loadNpmTasks('grunt-githooks');
- grunt.loadNpmTasks('grunt-parallel-behat');
- // Project configuration.
- grunt.initConfig({
- // Metadata.
- pkg: grunt.file.readJSON('package.json'),
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
- // Task configuration.
- less: {
- development: {
- options: {
- compress: false, // true, //minifying the result
- },
- files: {
- //"../app/assets/stylesheets/styles.css": "../app/assets/less/styles.less",
- "../app/assets/stylesheets/bootstrap.css": "../app/assets/less/bootstrap.less",
- }
- }
- },
- concat_css: {
- options: {
- // Task-specific options go here.
- },
- styles: {
- src: [
- '../app/assets/stylesheets/bootstrap.css',
- './assets/jquery-ui/themes/smoothness/jquery-ui.css'
- ],
- dest: '../public/simple-blue/assets/stylesheets/styles.css'
- }
- },
- concat: {
- options: {
- separator: ';',
- },
- scripts: {
- src: [
- './assets/jquery/dist/jquery.js',
- './assets/jquery-ui/jquery-ui.js',
- './lib/jquery-ui/jquery-ui.js',
- './assets/matchHeight/jquery.matchHeight.js',
- './assets/bootstrap/dist/js/bootstrap.js',
- '../app/assets/js/scripts.js'
- ],
- dest: './assets/js/scripts_final.js'
- },
- },
- uglify: {
- options: {
- mangle: true
- },
- scripts: {
- src: './assets/js/scripts_final.js',
- dest: '../public/simple-blue/assets/js/scripts.js'
- }
- },
- jshint: {
- options: {
- curly: true,
- eqeqeq: true,
- immed: true,
- latedef: true,
- newcap: true,
- noarg: true,
- sub: true,
- undef: true,
- unused: true,
- boss: true,
- eqnull: true,
- globals: {}
- },
- gruntfile: {
- src: 'Gruntfile.js'
- },
- },
- copy: {
- bootstrap_fonts: {
- files: [
- // includes files within path
- {
- expand: true,
- flatten: true,
- src: ['./lib/bootstrap/fonts/*'],
- dest: '../public/simple-blue/assets/fonts/',
- filter: 'isFile'
- },
- {
- expand: true,
- flatten: true,
- src: ['./assets/jquery-ui/themes/smoothness/images/*'],
- dest: '../public/simple-blue/assets/stylesheets/images/',
- filter: 'isFile'
- },
- ]
- }
- },
- bower: {
- install: {
- //just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
- }
- },
- behat: {
- options: {
- config: '../behat.yml',
- maxProcesses: 5,
- bin: '../vendor/bin/behat'
- }
- },
- run: {
- options: {
- config: '../behat.yml',
- maxProcesses: 5,
- bin: '../vendor/bin/behat'
- }
- },
- composer: {
- options: {
- usePhp: true,
- flags: [],
- composerLocation: '/usr/local/bin/composer',
- cwd: '../'
- }
- },
- githooks: {
- all: {
- options: {
- dest: '../.git/hooks/'
- },
- 'pre-commit': 'pre-commit',
- 'merge': 'merge',
- }
- },
- shell: {
- multiple: {
- command: [
- 'mkdir test',
- 'cd test',
- 'ls'
- ].join(';')
- }
- },
- watch: {
- js_frontend: {
- files: [
- //watched files
- './lib/jquery/dist/jquery.js',
- './lib/jquery-ui/jquery-ui.js',
- './lib/matchHeight/jquery.matchHeight-min.js',
- './lib/bootstrap/dist/js/bootstrap.js',
- '../app/assets/js/scripts.js'
- ],
- tasks: ['concat', 'uglify'], //tasks to run
- options: {
- livereload: true //reloads the browser
- }
- },
- styles: {
- files: ['./lib/bootstrap/less/*.less',
- '../app/assets/less/*.less'
- ], //watched files
- tasks: ['less', 'concat_css'], //tasks to run
- options: {
- livereload: true //reloads the browser
- }
- },
- fonts: {
- files: ['./lib/bootstrap/fonts/*'],
- tasks: ['copy'],
- options: {
- livereload: true
- }
- }
- //tests: {
- // files: ['app/controllers/*.php','app/models/*.php'], //the task will run only when you save files in this location
- // tasks: ['phpunit']
- //}
- }
- });
- // Default task.
- //grunt.registerTask('default', ['jshint', 'nodeunit', 'concat', 'uglify', 'less']);
- grunt.registerTask('default', ['concat', 'uglify', 'less', 'concat_css', 'copy']);
- grunt.registerTask('pre-commit', ['composer:install', 'behat', 'phpspec']);
- grunt.registerTask('merge', ['concat', 'uglify', 'less', 'concat_css', 'copy', 'behat']);
- grunt.registerTask('build', ['bower:install', 'concat', 'uglify', 'less', 'concat_css', 'copy']);
- };
Advertisement
Add Comment
Please, Sign In to add comment