<commit_before>/* jshint node: true */
'use strict';
var path = require('path');

function autoBuild(project, verbose, stack) {
  var args = ['auto-build'];

  if (verbose) { args.unshift('--verbose'); }
  if (stack) { args.unshift('--stack'); }

  return {
    opts: {
      cwd: path.resolve(__dirname, '../'+ project)
    },
    // cmd: './node_modules/grunt-cli/bin/grunt',
    cmd: 'grunt',
    args: args
  };
}

function clone(project) {
  return {
    opts: {
      cwd: __dirname +'/../'
    },
    cmd: 'git',
    args: [
      'clone',
      'git@github.com:camunda/'+ project +'.git',
    ]
  };
}

function linkFrom(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'npm',
    args: [
      'link'
    ]
  };
}

function bonerInstall(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'bower',
    args: [
      'install'
    ]
  };
}

function linkTo(project) {
  return {
    opts: {},
    cmd: 'npm',
    args: [
      'link',
      project
    ]
  };
}

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var verbose = grunt.option('verbose');
  var stack = grunt.option('stack');

  grunt.initConfig({
    parallel: {
      clone: {
        options: {
          stream: true
        },
        tasks: [
          clone('camunda-bpm-sdk-js'),
          clone('camunda-commons-ui'),
          clone('camunda-admin-ui'),
          clone('camunda-cockpit-ui'),
          clone('camunda-tasklist-ui'),
          clone('camunda-cockpit-plugin-base')
        ]
      },

      linkFrom: {
        options: {
          stream: true
        },
        tasks: [
          linkFrom('camunda-bpm-sdk-js'),
          linkFrom('camunda-commons-ui'),
          linkFrom('camunda-admin-ui'),
          linkFrom('camunda-cockpit-ui'),
          linkFrom('camunda-tasklist-ui'),
          linkFrom('camunda-cockpit-plugin-base')
        ]
      },

      bonerInstall: {
        options: {
          stream: true
        },
        tasks: [
          bonerInstall('camunda-bpm-sdk-js'),
          bonerInstall('camunda-commons-ui'),
          bonerInstall('camunda-admin-ui'),
          bonerInstall('camunda-cockpit-ui'),
          bonerInstall('camunda-tasklist-ui'),
          bonerInstall('camunda-cockpit-plugin-base')
        ]
      },

      linkTo: {
        options: {
          stream: true
        },
        tasks: [
          linkTo('camunda-bpm-sdk-js'),
          linkTo('camunda-commons-ui'),
          linkTo('camunda-admin-ui'),
          linkTo('camunda-cockpit-ui'),
          linkTo('camunda-tasklist-ui'),
          linkTo('camunda-cockpit-plugin-base')
        ]
      },

      develop: {
        options: {
          stream: true
        },
        tasks: [
          {
            opts: {
              cwd: path.resolve(__dirname, './webapp')
            },
            cmd: 'mvn',
            args: [
              'clean',
              'install',
              'jetty:run',
              '-DskipTests',
              '-Pdevelop'
            ]
          },
          autoBuild('camunda-bpm-sdk-js', verbose, stack),
          // // autoBuild('camunda-commons-ui', verbose, stack),
          autoBuild('camunda-admin-ui', verbose, stack),
          autoBuild('camunda-cockpit-ui', verbose, stack),
          autoBuild('camunda-tasklist-ui', verbose, stack)
        ]
      }
    }
  });

  grunt.registerTask('setup', [
    'parallel:clone',
    'parallel:linkFrom',
    'parallel:bonerInstall',
    'parallel:linkTo'
  ]);

  grunt.registerTask('default', ['parallel:develop']);
};
<commit_msg>refactor(grunt): add livereload to the maven command<commit_after>/* jshint node: true */
'use strict';
var path = require('path');

function autoBuild(project, verbose, stack) {
  var args = ['auto-build'];

  if (verbose) { args.unshift('--verbose'); }
  if (stack) { args.unshift('--stack'); }

  return {
    opts: {
      cwd: path.resolve(__dirname, '../'+ project)
    },
    // cmd: './node_modules/grunt-cli/bin/grunt',
    cmd: 'grunt',
    args: args
  };
}

function clone(project) {
  return {
    opts: {
      cwd: __dirname +'/../'
    },
    cmd: 'git',
    args: [
      'clone',
      'git@github.com:camunda/'+ project +'.git',
    ]
  };
}

function linkFrom(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'npm',
    args: [
      'link'
    ]
  };
}

function bonerInstall(project) {
  return {
    opts: {
      cwd: __dirname +'/../'+ project
    },
    cmd: 'bower',
    args: [
      'install'
    ]
  };
}

function linkTo(project) {
  return {
    opts: {},
    cmd: 'npm',
    args: [
      'link',
      project
    ]
  };
}

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var verbose = grunt.option('verbose');
  var stack = grunt.option('stack');

  grunt.initConfig({
    parallel: {
      clone: {
        options: {
          stream: true
        },
        tasks: [
          clone('camunda-bpm-sdk-js'),
          clone('camunda-commons-ui'),
          clone('camunda-admin-ui'),
          clone('camunda-cockpit-ui'),
          clone('camunda-tasklist-ui'),
          clone('camunda-cockpit-plugin-base')
        ]
      },

      linkFrom: {
        options: {
          stream: true
        },
        tasks: [
          linkFrom('camunda-bpm-sdk-js'),
          linkFrom('camunda-commons-ui'),
          linkFrom('camunda-admin-ui'),
          linkFrom('camunda-cockpit-ui'),
          linkFrom('camunda-tasklist-ui'),
          linkFrom('camunda-cockpit-plugin-base')
        ]
      },

      bonerInstall: {
        options: {
          stream: true
        },
        tasks: [
          bonerInstall('camunda-bpm-sdk-js'),
          bonerInstall('camunda-commons-ui'),
          bonerInstall('camunda-admin-ui'),
          bonerInstall('camunda-cockpit-ui'),
          bonerInstall('camunda-tasklist-ui'),
          bonerInstall('camunda-cockpit-plugin-base')
        ]
      },

      linkTo: {
        options: {
          stream: true
        },
        tasks: [
          linkTo('camunda-bpm-sdk-js'),
          linkTo('camunda-commons-ui'),
          linkTo('camunda-admin-ui'),
          linkTo('camunda-cockpit-ui'),
          linkTo('camunda-tasklist-ui'),
          linkTo('camunda-cockpit-plugin-base')
        ]
      },

      develop: {
        options: {
          stream: true
        },
        tasks: [
          {
            opts: {
              cwd: path.resolve(__dirname, './webapp')
            },
            cmd: 'mvn',
            args: [
              'clean',
              'install',
              'jetty:run',
              '-DskipTests',
              '-Pdevelop,livereload'
            ]
          },
          autoBuild('camunda-bpm-sdk-js', verbose, stack),
          // // autoBuild('camunda-commons-ui', verbose, stack),
          autoBuild('camunda-admin-ui', verbose, stack),
          autoBuild('camunda-cockpit-ui', verbose, stack),
          autoBuild('camunda-tasklist-ui', verbose, stack)
        ]
      }
    }
  });

  grunt.registerTask('setup', [
    'parallel:clone',
    'parallel:linkFrom',
    'parallel:bonerInstall',
    'parallel:linkTo'
  ]);

  grunt.registerTask('default', ['parallel:develop']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function( grunt ) {

	// 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.
		clean: {
			build: [ 'build' ]
		},
		// production pipeline tasks
		concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
			js: {
				src: [ 'src/<%= pkg.name %>.js' ],
				dest: 'app/js/<%= pkg.name %>.js'
			},
			css: {
				src: [
					'build/css/init.css',
					'build/css/clock-layout.css',
					'build/css/card.css'
				],
				dest: 'app/css/<%= pkg.name %>.css'
			},
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: '<%= concat.dist.dest %>',
				dest: 'app/js/<%= pkg.name %>.js'
			},
		},
		compass: {
			src: {
				options: {
					sassDir: 'src/sass',
					cssDir: 'build/css',
					environment: 'production'
				}
			}
		},
		// code quality tasks
		csslint: {
			src: {
				options: {
					csslintrc: 'src/.csslintrc'
				},
				src: [ 'build/**/*.css' ]
			},
			app: {
				options: {
					csslintrc: 'src/.csslintrc'
				},
				src: [ 'app/**/*.css' ]
			},
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: 'Gruntfile.js'
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'src/**/*.js' ]
			},
			app: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'app/**/*.js' ]
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: [ 'jshint:gruntfile' ]
			},
			srcJs: {
				files: '<%= jshint.src.src %>',
				tasks: [ 'jshint:src' ]
			},
			srcCss: {
				files: 'src/sass/*.scss',
				tasks: [ 'compass', 'csslint:src' ]
			},
			appJs: {
				files: '<%= jshint.app.src %>',
				tasks: [ 'jshint:app' ]
			},
			appCss: {
				files: '<%= csslint.app.src %>',
				tasks: [ 'csslint:app' ]
			}
		}
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-compass' );
	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-csslint' );
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	// Default task.
	grunt.registerTask( 'compile', [ 'clean', 'compass' ]);
	grunt.registerTask( 'test', [ 'csslint', 'jshint' ]);
	grunt.registerTask( 'produce', [ 'concat' ]);
	// TODO uglify and pass jshint
	grunt.registerTask( 'quality-control', [ 'csslint:app', 'jshint:app' ]);
	grunt.registerTask( 'default', [ 'compile', 'test', 'produce', 'quality-control' ]);

};
<commit_msg>added development css option<commit_after>'use strict';

module.exports = function( grunt ) {

	// 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.
		clean: {
			build: [ 'build' ]
		},
		// production pipeline tasks
		concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
			js: {
				src: [ 'src/<%= pkg.name %>.js' ],
				dest: 'app/js/<%= pkg.name %>.js'
			},
			css: {
				src: [
					'build/css/init.css',
					'build/css/clock-layout.css',
					'build/css/card.css'
				],
				dest: 'app/css/<%= pkg.name %>.css'
			},
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: '<%= concat.dist.dest %>',
				dest: 'app/js/<%= pkg.name %>.js'
			},
		},
		compass: {
			// TODO compass concat
			// http://stackoverflow.com/questions/9293646/can-compass-merge-css-files
			src: {
				options: {
					sassDir: 'src/sass',
					cssDir: 'build/css',
					environment: 'development'
				}
			},
			app: {
				options: {
					sassDir: 'src/sass',
					cssDir: 'build/css',
					environment: 'production'
				}
			}
		},
		// code quality tasks
		csslint: {
			src: {
				options: {
					csslintrc: 'src/.csslintrc'
				},
				src: [ 'build/**/*.css' ]
			},
			app: {
				options: {
					csslintrc: 'src/.csslintrc'
				},
				src: [ 'app/**/*.css' ]
			},
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: 'Gruntfile.js'
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'src/**/*.js' ]
			},
			app: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'app/**/*.js' ]
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: [ 'jshint:gruntfile' ]
			},
			srcJs: {
				files: '<%= jshint.src.src %>',
				tasks: [ 'jshint:src' ]
			},
			srcCss: {
				files: 'src/sass/*.scss',
				tasks: [ 'compass', 'csslint:src' ]
			},
			appJs: {
				files: '<%= jshint.app.src %>',
				tasks: [ 'jshint:app' ]
			},
			appCss: {
				files: '<%= csslint.app.src %>',
				tasks: [ 'csslint:app' ]
			}
		}
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-compass' );
	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-csslint' );
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	// Default task.
	grunt.registerTask( 'compile', [ 'clean', 'compass:src' ]);
	grunt.registerTask( 'test', [ 'csslint', 'jshint' ]);
	grunt.registerTask( 'produce', [ 'clean', 'compass:app', 'concat' ]);
	// TODO uglify and pass jshint
	grunt.registerTask( 'quality-control', [ 'csslint:app', 'jshint:app' ]);
	grunt.registerTask( 'default', [ 'compile', 'test', 'produce', 'quality-control' ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        info: grunt.file.readJSON('info.json'),
        dirs: {
            bower: 'bower_components',
            build: 'build/assets/js',
            css: 'assets/css',
            js: 'assets/js',
            images: 'assets/images',
            icons: 'assets/icons'
        },

        // SCSS
        sass: {
            dev: {
                options: {
                    outputStyle: 'expanded',
                    loadPath: '.'
                },
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.scss',
                    '<%= dirs.css %>/print.css': '<%= dirs.css %>/print.scss'
                }
            },
            build: {
                options: {
                    outputStyle: 'compressed',
                    loadPath: '.'
                },
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.scss',
                    '<%= dirs.css %>/print.css': '<%= dirs.css %>/print.scss'
                }
            }
        },

        // CSS autoprefixer
        autoprefixer: {
            options: {
                browsers: ['last 2 versions']
            },
            dist: {
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.css'
                }
            }
        },

        // Connect Server
        connect: {
            server: {
                options: {
                    port: 9001,
                    base: ''
                }
            }
        },

        // Concat
        concat: {
            options: {
                separator: ';',
            },
            dist: {
                src: [
                    '<%= dirs.bower %>/jquery/dist/jquery.js',
                    '<%= dirs.bower %>/headroom.js/dist/headroom.js',
                    '<%= dirs.bower %>/headroom.js/dist/jQuery.headroom.js',
                    '<%= dirs.bower %>/clipboard/dist/clipboard.js',
                    '<%= dirs.js %>/*.js',
                    '!<%= dirs.js %>/build.js'
                ],
                dest: '<%= dirs.js %>/build.js',
            },
        },

        // Replace
        replace: {
            dist: {
                options: {
                    patterns: [
                        {
                            match: 'DISQUS_PUBLIC_KEY',
                            replacement: '<%= info.disqusPublicKey %>'
                        }
                    ]
                },
                files: [
                    {expand: true, flatten: true, src: ['<%= dirs.build %>/build.js'], dest: '<%= dirs.build %>/'}
                ]
            }
        },

        // JShint
        jshint: {
            all: [
                'Gruntfile.js',
                '<%= dirs.js %>/*.js',
                '!<%= dirs.js %>/highlight.pack.js',
                '!<%= dirs.js %>/build.js'
            ]
        },

        // HTMLhint
        htmlhint: {
            html: {
                options: {
                    'tag-pair': true
                },
                src: ['*.html']
            }
        },

        // Uglify
        uglify: {
            all: {
                files: {
                    '<%= dirs.js %>/build.js': ['<%= dirs.js %>/build.js']
                }
            }
        },

        // Imagemin
        imagemin: {
            dynamic: {
                files: [{
                    expand: true,
                    cwd: '<%= dirs.images %>',
                    src: ['**/*.{png,jpg,gif}'],
                    dest: '<%= dirs.images %>'
                }]
            }
        },

        // Grunticon
        grunticon: {
            icons: {
                files: [{
                    expand: true,
                    cwd: '<%= dirs.icons %>',
                    src: ['*.svg', '*.png'],
                    dest: "<%= dirs.icons %>/grunticon"
                }],
                options: {
                    cssprefix: ".icon--",
                    customselectors: {
                      "*": [".icon--$1:before"]
                    }
                }
            }
        },

        // Browser Sync
        browser_sync: {
            dev: {
                bsFiles: {
                    src : 'assets/css/style.css'
                },
                options: {
                    watchTask: true,
                    server: {
                        baseDir: ""
                    },
                    ghostMode: {
                        clicks: true,
                        scroll: true,
                        links: true,
                        forms: true
                    },
                }
            }
        },

        // Execute metalsmith
        execute: {
            build: {
                src: ['index.js']
            },
            dev: {
                src: ['copy_dev_assets.js']
            }
        },

        // Watch
        watch: {
            options: {
                livereload: true
            },
            sass: {
                files: ['<%= dirs.css %>/*.scss'],
                tasks: ['sass:dev', 'autoprefixer', 'execute:dev', 'replace']
            },
            images: {
                files: ['<%= dirs.images %>/*.{png,jpg,gif}'],
                tasks: ['imagemin']
            },
            icons: {
                files: ['<%= dirs.icons %>/*'],
                tasks: ['grunticon']
            },
            html: {
                files: ['*.html'],
                tasks: ['htmlhint', 'execute:dev', 'replace']
            },
            templates: {
                files: ['templates/**/*.hbt'],
                tasks: ['execute:build', 'replace']
            },
            content: {
                files: ['src/**/*.md'],
                tasks: ['execute:build', 'replace']
            },
            scripts: {
                files: ['Gruntfile.js', '<%= dirs.js %>/*.js'],
                tasks: ['jshint', 'concat', 'execute:dev', 'replace'],
                options: {
                    spawn: false
                }
            }
        }
    });

    grunt.registerTask('default', ['sass:build', 'autoprefixer', 'concat', 'uglify', 'imagemin', 'grunticon', 'execute', 'replace']);
    grunt.registerTask('dev', ['connect', 'watch', 'notify']);
    grunt.registerTask('dev:sync', ['browser_sync', 'watch', 'notify']);
};
<commit_msg>Adjust grunt default task<commit_after>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        info: grunt.file.readJSON('info.json'),
        dirs: {
            bower: 'bower_components',
            build: 'build/assets/js',
            css: 'assets/css',
            js: 'assets/js',
            images: 'assets/images',
            icons: 'assets/icons'
        },

        // SCSS
        sass: {
            dev: {
                options: {
                    outputStyle: 'expanded',
                    loadPath: '.'
                },
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.scss',
                    '<%= dirs.css %>/print.css': '<%= dirs.css %>/print.scss'
                }
            },
            build: {
                options: {
                    outputStyle: 'compressed',
                    loadPath: '.'
                },
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.scss',
                    '<%= dirs.css %>/print.css': '<%= dirs.css %>/print.scss'
                }
            }
        },

        // CSS autoprefixer
        autoprefixer: {
            options: {
                browsers: ['last 2 versions']
            },
            dist: {
                files: {
                    '<%= dirs.css %>/style.css': '<%= dirs.css %>/style.css'
                }
            }
        },

        // Connect Server
        connect: {
            server: {
                options: {
                    port: 9001,
                    base: ''
                }
            }
        },

        // Concat
        concat: {
            options: {
                separator: ';',
            },
            dist: {
                src: [
                    '<%= dirs.bower %>/jquery/dist/jquery.js',
                    '<%= dirs.bower %>/headroom.js/dist/headroom.js',
                    '<%= dirs.bower %>/headroom.js/dist/jQuery.headroom.js',
                    '<%= dirs.bower %>/clipboard/dist/clipboard.js',
                    '<%= dirs.js %>/*.js',
                    '!<%= dirs.js %>/build.js'
                ],
                dest: '<%= dirs.js %>/build.js',
            },
        },

        // Replace
        replace: {
            dist: {
                options: {
                    patterns: [
                        {
                            match: 'DISQUS_PUBLIC_KEY',
                            replacement: '<%= info.disqusPublicKey %>'
                        }
                    ]
                },
                files: [
                    {expand: true, flatten: true, src: ['<%= dirs.build %>/build.js'], dest: '<%= dirs.build %>/'}
                ]
            }
        },

        // JShint
        jshint: {
            all: [
                'Gruntfile.js',
                '<%= dirs.js %>/*.js',
                '!<%= dirs.js %>/highlight.pack.js',
                '!<%= dirs.js %>/build.js'
            ]
        },

        // HTMLhint
        htmlhint: {
            html: {
                options: {
                    'tag-pair': true
                },
                src: ['*.html']
            }
        },

        // Uglify
        uglify: {
            all: {
                files: {
                    '<%= dirs.js %>/build.js': ['<%= dirs.js %>/build.js']
                }
            }
        },

        // Imagemin
        imagemin: {
            dynamic: {
                files: [{
                    expand: true,
                    cwd: '<%= dirs.images %>',
                    src: ['**/*.{png,jpg,gif}'],
                    dest: '<%= dirs.images %>'
                }]
            }
        },

        // Grunticon
        grunticon: {
            icons: {
                files: [{
                    expand: true,
                    cwd: '<%= dirs.icons %>',
                    src: ['*.svg', '*.png'],
                    dest: "<%= dirs.icons %>/grunticon"
                }],
                options: {
                    cssprefix: ".icon--",
                    customselectors: {
                      "*": [".icon--$1:before"]
                    }
                }
            }
        },

        // Browser Sync
        browser_sync: {
            dev: {
                bsFiles: {
                    src : 'assets/css/style.css'
                },
                options: {
                    watchTask: true,
                    server: {
                        baseDir: ""
                    },
                    ghostMode: {
                        clicks: true,
                        scroll: true,
                        links: true,
                        forms: true
                    },
                }
            }
        },

        // Execute metalsmith
        execute: {
            build: {
                src: ['index.js']
            },
            dev: {
                src: ['copy_dev_assets.js']
            }
        },

        // Watch
        watch: {
            options: {
                livereload: true
            },
            sass: {
                files: ['<%= dirs.css %>/*.scss'],
                tasks: ['sass:dev', 'autoprefixer', 'execute:dev', 'replace']
            },
            images: {
                files: ['<%= dirs.images %>/*.{png,jpg,gif}'],
                tasks: ['imagemin']
            },
            icons: {
                files: ['<%= dirs.icons %>/*'],
                tasks: ['grunticon']
            },
            html: {
                files: ['*.html'],
                tasks: ['htmlhint', 'execute:dev', 'replace']
            },
            templates: {
                files: ['templates/**/*.hbt'],
                tasks: ['execute:build', 'replace']
            },
            content: {
                files: ['src/**/*.md'],
                tasks: ['execute:build', 'replace']
            },
            scripts: {
                files: ['Gruntfile.js', '<%= dirs.js %>/*.js'],
                tasks: ['jshint', 'concat', 'execute:dev', 'replace'],
                options: {
                    spawn: false
                }
            }
        }
    });

    grunt.registerTask('default', ['sass:build', 'autoprefixer', 'concat', 'uglify', 'imagemin', 'grunticon', 'execute:build', 'replace']);
    grunt.registerTask('dev', ['connect', 'watch', 'notify']);
    grunt.registerTask('dev:sync', ['browser_sync', 'watch', 'notify']);
};
<|endoftext|>


<commit_before>(function() {
  module.exports = function() {

    var banner = "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %> (<%= grunt.template.date('longTime') %>)\n* Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>; Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";

    this.initConfig({
      pkg: this.file.readJSON('package.json'),
      concat: {
        options: {
          stripBanners: true,
          banner: banner
        },
        dist: {
          src: [
            // Libs
            'libs/actionbar/js/actionbar.js',
            // Main
            'src/dataflow.js',
            // Models
            "src/modules/graph.js",
            "src/modules/node.js",
            "src/modules/input.js",
            "src/modules/output.js",
            "src/modules/edge.js",
            "src/modules/card.js",
            // Views
            "src/modules/graph-view.js",
            "src/modules/node-view.js",
            "src/modules/input-view.js",
            "src/modules/output-view.js",
            "src/modules/edge-view.js",
            "src/modules/card-view.js",
            // Plugins
            "src/plugins/edit.js",
            "src/plugins/elements.js",
            "src/plugins/library.js",
            "src/plugins/view-source.js",
            "src/plugins/log.js",
            "src/plugins/inspector.js"
          ],
          dest: 'build/<%= pkg.name %>.build.js'
        }
      },
      uglify: {
        options: {
          banner: banner,
          report: 'min'
        },
        dist: {
          files: {
            'build/<%= pkg.name %>.min.js': ['build/<%= pkg.name %>.build.js']
          }
        }
      },
      jshint: {
        all: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'],
        force: {
          options: { force: true },
          files: { src: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'] }
        }
      },
      connect: {
        options : {
          port : 8000,
          hostname : '*' // available from ipaddress:8000 on same network (or name.local:8000)
        },
        uses_defaults: {}
      },
      watch: {
        scripts: {
          files: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'],
          tasks: ['jshint:force'],
          options: {
            nospawn: true
          }
        }
      },
      cssmin: {
        dist: {
          options: {
            banner: '/* meemoo/dataflow compressed styles. See debug.html for uncompressed. */',
            keepSpecialComments: 0
          },
          files: {
            'build/dataflow.min.css': [
              'style/dataflow.css',
              'style/modules/node.css',
              'style/modules/edge.css',
              'style/modules/port.css',
              'style/modules/menu.css',
              'style/modules/actionbar.css',
              'style/modules/jqui.css',
              'libs/actionbar/vendor/css/font-awesome.min.css'
            ]
          }
        }
      }
    });

    this.loadNpmTasks('grunt-contrib-concat');
    this.loadNpmTasks('grunt-contrib-uglify');
    this.loadNpmTasks('grunt-contrib-jshint');
    this.loadNpmTasks('grunt-contrib-connect');
    this.loadNpmTasks('grunt-contrib-watch');
    this.loadNpmTasks('grunt-contrib-cssmin');

    this.registerTask('dev', ['connect', 'watch']);
    this.registerTask('build', ['concat:dist', 'uglify:dist', 'cssmin:dist']);
    this.registerTask('test', ['jshint']);
    this.registerTask('default', ['test', 'build']);
  };

}).call(this);
<commit_msg>Rebuild on watch<commit_after>(function() {
  module.exports = function() {

    var banner = "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today('yyyy-mm-dd') %> (<%= grunt.template.date('longTime') %>)\n* Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>; Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";

    this.initConfig({
      pkg: this.file.readJSON('package.json'),
      concat: {
        options: {
          stripBanners: true,
          banner: banner
        },
        dist: {
          src: [
            // Libs
            'libs/actionbar/js/actionbar.js',
            // Main
            'src/dataflow.js',
            // Models
            "src/modules/graph.js",
            "src/modules/node.js",
            "src/modules/input.js",
            "src/modules/output.js",
            "src/modules/edge.js",
            "src/modules/card.js",
            // Views
            "src/modules/graph-view.js",
            "src/modules/node-view.js",
            "src/modules/input-view.js",
            "src/modules/output-view.js",
            "src/modules/edge-view.js",
            "src/modules/card-view.js",
            // Plugins
            "src/plugins/edit.js",
            "src/plugins/elements.js",
            "src/plugins/library.js",
            "src/plugins/view-source.js",
            "src/plugins/log.js",
            "src/plugins/inspector.js"
          ],
          dest: 'build/<%= pkg.name %>.build.js'
        }
      },
      uglify: {
        options: {
          banner: banner,
          report: 'min'
        },
        dist: {
          files: {
            'build/<%= pkg.name %>.min.js': ['build/<%= pkg.name %>.build.js']
          }
        }
      },
      jshint: {
        all: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'],
        force: {
          options: { force: true },
          files: { src: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'] }
        }
      },
      connect: {
        options : {
          port : 8000,
          hostname : '*' // available from ipaddress:8000 on same network (or name.local:8000)
        },
        uses_defaults: {}
      },
      watch: {
        scripts: {
          files: ['Gruntfile.js', 'src/*.js', 'src/**/*.js'],
          tasks: ['jshint:force', 'build'],
          options: {
            nospawn: true
          }
        }
      },
      cssmin: {
        dist: {
          options: {
            banner: '/* meemoo/dataflow compressed styles. See debug.html for uncompressed. */',
            keepSpecialComments: 0
          },
          files: {
            'build/dataflow.min.css': [
              'style/dataflow.css',
              'style/modules/node.css',
              'style/modules/edge.css',
              'style/modules/port.css',
              'style/modules/menu.css',
              'style/modules/actionbar.css',
              'style/modules/jqui.css',
              'libs/actionbar/vendor/css/font-awesome.min.css'
            ]
          }
        }
      }
    });

    this.loadNpmTasks('grunt-contrib-concat');
    this.loadNpmTasks('grunt-contrib-uglify');
    this.loadNpmTasks('grunt-contrib-jshint');
    this.loadNpmTasks('grunt-contrib-connect');
    this.loadNpmTasks('grunt-contrib-watch');
    this.loadNpmTasks('grunt-contrib-cssmin');

    this.registerTask('dev', ['connect', 'watch']);
    this.registerTask('build', ['concat:dist', 'uglify:dist', 'cssmin:dist']);
    this.registerTask('test', ['jshint']);
    this.registerTask('default', ['test', 'build']);
  };

}).call(this);
<|endoftext|>


<commit_before>
var uglifyConf = {
    options: {
      banner: comment
    },
    build: {
      src: 'build/sapien.js',
      dest: 'build/sapien.min.js'
    }
}

module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);
    // Project configuration.
    grunt.initConfig({
            pkg         : grunt.file.readJSON('package.json'),
            webpack     : browserifyConf,
            uglify      : uglifyConf,
            ts          : typescriptConf
        });

    // Load the plugin that provides the "uglify" task.
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //grunt typescript for transpiling typescript into javascript
    grunt.loadNpmTasks('grunt-ts');
    // Default task(s).
    grunt.registerTask('default', ['ts','browserify:dist', 'uglify']);

};<commit_msg>Update  Gruntfile.js:  registering webpack and uglify tasks<commit_after>

let comment = '/**\n <%= pkg.name %>:<%= pkg.version %> \n Copyright 2017 <%= pkg.author %> \n Released Under The <%= pkg.license %> License\n <%= pkg.url %> \n */';
const uglifyConf = {
    options: {
      banner: comment
    },
    build: {
      src: 'dist/bundle.js',
      dest: 'dist/bundle.min.js'
    }
}

const webpackConf = {
    dist: require("./webpack.config.js")
}

module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);
    // Project configuration.
    grunt.initConfig({
            pkg         : grunt.file.readJSON('package.json'),
            webpack     : webpackConf,
            uglify      : uglifyConf
        });

    // Load the plugin that provides the "uglify" task.
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //grunt typescript for transpiling typescript into javascript
    grunt.loadNpmTasks('grunt-webpack');
    // Default task(s).
    grunt.registerTask('default', ['webpack', 'uglify']);

};<|endoftext|>


<commit_before>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      app: {
        src: ['src/client/app/js/*.js'],
        dest: 'dist/client/app/js/app.js'
      },
      lib: {
        src: ['src/client/app/bower_components/angular/angular.js',
              'src/client/app/bower_components/angular-route/angular-route.js',
              'src/client/app/bower_components/angular-cookies/angular-cookies.js',
              'src/client/app/bower_components/angular-resource/angular-resource.js',
              'src/client/app/bower_components/autofill-event/src/autofill-event.js'],
        dest: 'dist/client/app/js/lib.js'
      }
    },
    uglify: {
      app: {
        files: {'dist/client/app/js/app.min.js': ['dist/client/app/js/app.js']}
      },
      lib: {
        files: {'dist/client/app/js/lib.min.js': ['dist/client/app/js/lib.js']}
      }
    },
    copy: {
      app: {
        files: [
          { expand: true, src: 'src/client/app/*', dest: 'dist/client/app/', filter: 'isFile', flatten: true },
          { expand: true, cwd: 'src/client/app/', src: 'partials/*', dest: 'dist/client/app/' }
        ]
      }
    },
    sass: {
      dev: {
        options: {
          includePaths: ['bower_components/foundation/scss']
        },
        files: {
          'dist/client/app/css/app.css': 'src/client/app/sass/app.sass',
          'dist/client/app/css/theme.css': 'src/client/app/sass/theme.sass'
        }
      },
      deploy: {
        options: {
          includePaths: ['bower_components/foundation/scss'],
          outputStyle: 'compressed'
        },
        files: {
          'dist/client/app/css/app.min.css': 'src/client/app/sass/app.sass',
          'dist/client/app/css/theme.min.css': 'src/client/app/sass/theme.sass'
        }
      }
    },
    cssmin: {
      combine: {
        files: {
          'dist/client/app/css/stylesheets.css': [
            'src/client/app/bower_components/html5-boilerplate/css/normalize.css',
            'src/client/app/bower_components/html5-boilerplate/css/main.css',
            'src/client/app/bower_components/bootstrap/dist/css/bootstrap.css',
            'src/client/app/bower_components/bootstrap/dist/css/bootstrap-theme.css',
          ]
        }
      },
      minify: {
        expand: true,
        cwd: 'dist/client/app/css',
        src: ['*.css', '!*.min.css'],
        dest: 'dist/client/app/css',
        ext: '.min.css'
      }
    }
  });

  // Load the plugin that provides the "concat" task.
  grunt.loadNpmTasks('grunt-contrib-concat');
  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  // Load the plugin that provides the "copy" task.
  grunt.loadNpmTasks('grunt-contrib-copy');
  // Load the plugin that provides the "sass" task.
  grunt.loadNpmTasks('grunt-sass');
  // Load the plugin that provides the "cssmin" task.
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  // Default task(s).
  grunt.registerTask('default', ['concat', 'uglify', 'copy', 'sass', 'cssmin']);

};
<commit_msg>Add the modernizr to the Grunt concatenated Javascripts<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
      app: {
        src: ['src/client/app/js/*.js'],
        dest: 'dist/client/app/js/app.js'
      },
      lib: {
        src: ['src/client/app/bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js',
              'src/client/app/bower_components/angular/angular.js',
              'src/client/app/bower_components/angular-route/angular-route.js',
              'src/client/app/bower_components/angular-cookies/angular-cookies.js',
              'src/client/app/bower_components/angular-resource/angular-resource.js',
              'src/client/app/bower_components/autofill-event/src/autofill-event.js'],
        dest: 'dist/client/app/js/lib.js'
      }
    },
    uglify: {
      app: {
        files: {'dist/client/app/js/app.min.js': ['dist/client/app/js/app.js']}
      },
      lib: {
        files: {'dist/client/app/js/lib.min.js': ['dist/client/app/js/lib.js']}
      }
    },
    copy: {
      app: {
        files: [
          { expand: true, src: 'src/client/app/*', dest: 'dist/client/app/', filter: 'isFile', flatten: true },
          { expand: true, cwd: 'src/client/app/', src: 'partials/*', dest: 'dist/client/app/' }
        ]
      }
    },
    sass: {
      dev: {
        options: {
          includePaths: ['bower_components/foundation/scss']
        },
        files: {
          'dist/client/app/css/app.css': 'src/client/app/sass/app.sass',
          'dist/client/app/css/theme.css': 'src/client/app/sass/theme.sass'
        }
      },
      deploy: {
        options: {
          includePaths: ['bower_components/foundation/scss'],
          outputStyle: 'compressed'
        },
        files: {
          'dist/client/app/css/app.min.css': 'src/client/app/sass/app.sass',
          'dist/client/app/css/theme.min.css': 'src/client/app/sass/theme.sass'
        }
      }
    },
    cssmin: {
      combine: {
        files: {
          'dist/client/app/css/stylesheets.css': [
            'src/client/app/bower_components/html5-boilerplate/css/normalize.css',
            'src/client/app/bower_components/html5-boilerplate/css/main.css',
            'src/client/app/bower_components/bootstrap/dist/css/bootstrap.css',
            'src/client/app/bower_components/bootstrap/dist/css/bootstrap-theme.css',
          ]
        }
      },
      minify: {
        expand: true,
        cwd: 'dist/client/app/css',
        src: ['*.css', '!*.min.css'],
        dest: 'dist/client/app/css',
        ext: '.min.css'
      }
    }
  });

  // Load the plugin that provides the "concat" task.
  grunt.loadNpmTasks('grunt-contrib-concat');
  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  // Load the plugin that provides the "copy" task.
  grunt.loadNpmTasks('grunt-contrib-copy');
  // Load the plugin that provides the "sass" task.
  grunt.loadNpmTasks('grunt-sass');
  // Load the plugin that provides the "cssmin" task.
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  // Default task(s).
  grunt.registerTask('default', ['concat', 'uglify', 'copy', 'sass', 'cssmin']);

};
<|endoftext|>


<commit_before>/*
 * NakedItchyFeet
 * http://nakeditchyfeet.com/
 *
 * Copyright (c) 2013 Kelvin Luck
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

    clean: ['out/'],
    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: 'assets/',
            src: ['**'],
            dest: 'out/'
          }
        ]
      }
    },
    stylus: {
      site: {
        files: {
          'out/styles/styles.css': 'src/styles/styles.stylus'
        }
      }
    },
    haggerston: {
      dev: {
        options: {
          minify: false
        }
      },
      production: {
        options: {
          minify: true
        }
      }
    },
    watch: {
      content: {
        files: [
          'src/content/**/*.json',
          'src/content/**/*.md',
          'src/templates/**/*.html'
        ],
        tasks: 'build'
      },
      styles: {
        files: [
          'src/styles/**/*.stylus'
        ],
        tasks: 'stylus'
      }
    },
    connect: {
      site: {
        options: {
          base: 'out/'
        }
      }
    }

  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-haggerston');
  grunt.loadNpmTasks('grunt-contrib-stylus');

  var target = grunt.option('target') || 'dev';

  grunt.registerTask('build', ['clean', 'copy', 'stylus', 'haggerston:' + target]);
  grunt.registerTask('serve', ['build', 'connect', 'watch']);

  grunt.registerTask('default', ['build']);

};
<commit_msg>Minifying the JS code in production<commit_after>/*
 * NakedItchyFeet
 * http://nakeditchyfeet.com/
 *
 * Copyright (c) 2013 Kelvin Luck
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  var target = grunt.option('target') || 'dev';
  var compress = target !== 'dev';

  // Project configuration.
  grunt.initConfig({

    clean: ['out/'],
    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: 'assets/',
            src: ['**'],
            dest: 'out/'
          }
        ]
      },
      js: {
        files: {
          'out/js/nif.js': 'src/js/nif.js'
        }
      }
    },
    uglify: {
      nif: {
        src: ['src/js/nif.js'],
        dest: 'out/js/nif.min.js'
      }
    },
    stylus: {
      site: {
        options: {
          compress: compress
        },
        files: {
          'out/styles/styles.css': 'src/styles/styles.stylus'
        }
      }
    },
    haggerston: {
      options: {
        minify: compress
      }
    },
    watch: {
      content: {
        files: [
          'src/content/**/*.json',
          'src/content/**/*.md',
          'src/templates/**/*.html'
        ],
        tasks: 'build'
      },
      styles: {
        files: [
          'src/styles/**/*.stylus'
        ],
        tasks: 'stylus'
      }
    },
    connect: {
      site: {
        options: {
          base: 'out/'
        }
      }
    }

  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-haggerston');
  grunt.loadNpmTasks('grunt-contrib-stylus');
  grunt.loadNpmTasks('grunt-contrib-uglify');

  grunt.registerTask('build', ['clean', 'copy:main', (compress ? 'uglify' : 'copy:js'), 'stylus', 'haggerston']);
  grunt.registerTask('serve', ['build', 'connect', 'watch']);

  grunt.registerTask('default', ['build']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		watch: {
			sass: {
				files: ['includes/css/sass/compile/**/*.{scss,sass}','includes/css/sass/include/**/*.{scss,sass}'],
				tasks: ['sass:dist']
			},
			javascript: {
                files: 'includes/js/**/*.js',
                tasks: ['uglify:applibs']
            },
			livereload: {
				files: ['css/*.css'],
				options: {
					livereload: false
				}
			}
		},
		sass: {
			options: {
				sourceMap: true,
				outputStyle: 'compressed'
			},
			dist: {
				files: {
					'includes/css/styles.css': 'includes/css/sass/compile/styles.scss'
				}
			}
		},
		uglify: {
			applibs:{
			  options: {
			  	//beautify: true,
			  	//mangle: false,
			    // the banner is inserted at the top of the output
			    banner: '/*! Coldbox Dependency Management Prezi <%= grunt.template.today("dd-mm-yyyy") %> */\n'
			  },
			  files: {
			  	'includes/js/app.js': ['include/js/lib/_globals.js','include/js/lib/**/*.js']
			  }
			},
			libraries:{
				options:{
					preserveComments: true,
					banner: '/*! Coldbox Dependency Management Prezi - Consolidated Open Source Libraries. Generated: <%= grunt.template.today("dd-mm-yyyy") %> */\n\n'
				},
				files: {
					'includes/javascript/lib.js':
					[
				      	'bower_components/jquery/dist/jquery.min.js',
				      	'bower_components/bootstrap/dist/js/bootstrap.min.js',
				      	'bower_components/jQuery.mmenu/src/js/jquery.mmenu.min.js',
				      	'bower_components/arrive/src/arrive.js',
				      	'bower_components/angular/angular.min.js',
				      	'bower_components/angular-sanitize/angular-sanitize.min.js',
				      	'includes/js/vendor/*.js',
				      	'includes/js/vendor/**/*.js'
				    ]
				}

			}

		}

	});
	grunt.registerTask('default', ['sass:dist', 'uglify', 'watch']);
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
};<commit_msg>file updates<commit_after>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		watch: {
			sass: {
				files: ['includes/css/sass/compile/**/*.{scss,sass}','includes/css/sass/include/**/*.{scss,sass}'],
				tasks: ['sass:dist']
			},
			javascript: {
                files: 'includes/js/lib/**/*.js',
                tasks: ['uglify:applibs']
            },
			livereload: {
				files: ['css/*.css'],
				options: {
					livereload: false
				}
			}
		},
		sass: {
			options: {
				sourceMap: true,
				outputStyle: 'compressed'
			},
			dist: {
				files: {
					'includes/css/styles.css': 'includes/css/sass/compile/styles.scss'
				}
			}
		},
		uglify: {
			applibs:{
			  options: {
			  	//beautify: true,
			  	//mangle: false,
			    // the banner is inserted at the top of the output
			    banner: '/*! Coldbox Dependency Management Prezi <%= grunt.template.today("dd-mm-yyyy") %> */\n'
			  },
			  files: {
			  	'includes/js/app.js': ['include/js/lib/_globals.js','include/js/lib/**/*.js']
			  }
			},
			libraries:{
				options:{
					preserveComments: true,
					banner: '/*! Coldbox Dependency Management Prezi - Consolidated Open Source Libraries. Generated: <%= grunt.template.today("dd-mm-yyyy") %> */\n\n'
				},
				files: {
					'includes/js/lib.js':
					[
				      	'bower_components/jquery/dist/jquery.min.js',
				      	'bower_components/bootstrap/dist/js/bootstrap.min.js',
				      	'bower_components/jQuery.mmenu/src/js/jquery.mmenu.min.js',
				      	'bower_components/arrive/src/arrive.js',
				      	'bower_components/angular/angular.min.js',
				      	'bower_components/angular-sanitize/angular-sanitize.min.js',
				      	'includes/js/vendor/*.js',
				      	'includes/js/vendor/**/*.js'
				    ]
				}

			}

		}

	});
	grunt.registerTask('default', ['sass:dist', 'uglify', 'watch']);
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
};<|endoftext|>


<commit_before>module.exports = function( grunt ) {

"use strict";

var
	// files
	coreFiles = [
		"jquery.ui.core.js",
		"jquery.ui.widget.js",
		"jquery.ui.mouse.js",
		"jquery.ui.draggable.js",
		"jquery.ui.droppable.js",
		"jquery.ui.resizable.js",
		"jquery.ui.selectable.js",
		"jquery.ui.sortable.js",
		"jquery.ui.effect.js"
	],

	uiFiles = coreFiles.map(function( file ) {
		return "ui/" + file;
	}).concat( expandFiles( "ui/*.js" ).filter(function( file ) {
		return coreFiles.indexOf( file.substring(3) ) === -1;
	})),

	allI18nFiles = expandFiles( "ui/i18n/*.js" ),

	cssFiles = [
		"core",
		"accordion",
		"autocomplete",
		"button",
		"datepicker",
		"dialog",
		"menu",
		"progressbar",
		"resizable",
		"selectable",
		"selectmenu",
		"slider",
		"spinner",
		"tabs",
		"tooltip",
		"theme"
	].map(function( component ) {
		return "themes/base/jquery.ui." + component + ".css";
	}),

	// minified files
	minify = {
		options: {
			preserveComments: false
		},
		main: {
			options: {
				banner: createBanner( uiFiles )
			},
			files: {
				"dist/jquery-ui.min.js": "dist/jquery-ui.js"
			}
		},
		i18n: {
			options: {
				banner: createBanner( allI18nFiles )
			},
			files: {
				"dist/i18n/jquery-ui-i18n.min.js": "dist/i18n/jquery-ui-i18n.js"
			}
		}
	},

	compareFiles = {
		all: [
			"dist/jquery-ui.js",
			"dist/jquery-ui.min.js"
		]
	};

function mapMinFile( file ) {
	return "dist/" + file.replace( /\.js$/, ".min.js" ).replace( /ui\//, "minified/" );
}

function expandFiles( files ) {
	return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) {
		return values[ 0 ];
	});
}

uiFiles.concat( allI18nFiles ).forEach(function( file ) {
	minify[ file ] = {
		options: {
			banner: createBanner()
		},
		files: {}
	};
	minify[ file ].files[ mapMinFile( file ) ] = file;
});

uiFiles.forEach(function( file ) {
	// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
	compareFiles[ file ] = [ file,  mapMinFile( file ) ];
});

// grunt plugins
grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-contrib-uglify" );
grunt.loadNpmTasks( "grunt-contrib-concat" );
grunt.loadNpmTasks( "grunt-contrib-qunit" );
grunt.loadNpmTasks( "grunt-contrib-csslint" );
grunt.loadNpmTasks( "grunt-jscs-checker" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-compare-size" );
grunt.loadNpmTasks( "grunt-git-authors" );
// local testswarm and build tasks
grunt.loadTasks( "build/tasks" );

function stripDirectory( file ) {
	return file.replace( /.+\/(.+?)>?$/, "$1" );
}

function createBanner( files ) {
	// strip folders
	var fileNames = files && files.map( stripDirectory );
	return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
		"<%= grunt.template.today('isoDate') %>\n" +
		"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
		(files ? "* Includes: " + fileNames.join(", ") + "\n" : "")+
		"* Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
		" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";
}

grunt.initConfig({
	pkg: grunt.file.readJSON("package.json"),
	files: {
		dist: "<%= pkg.name %>-<%= pkg.version %>"
	},
	compare_size: compareFiles,
	concat: {
		ui: {
			options: {
				banner: createBanner( uiFiles ),
				stripBanners: {
					block: true
				}
			},
			src: uiFiles,
			dest: "dist/jquery-ui.js"
		},
		i18n: {
			options: {
				banner: createBanner( allI18nFiles )
			},
			src: allI18nFiles,
			dest: "dist/i18n/jquery-ui-i18n.js"
		},
		css: {
			options: {
				banner: createBanner( cssFiles ),
				stripBanners: {
					block: true
				}
			},
			src: cssFiles,
			dest: "dist/jquery-ui.css"
		}
	},
	jscs: {
		// datepicker, sortable, resizable and draggable are getting rewritten, ignore until that's done
		ui: [ "ui/jquery.ui.*.js", "!ui/jquery.ui.datepicker.js", "!ui/jquery.ui.sortable.js", "!ui/jquery.ui.resizable.js", "!ui/jquery.ui.draggable.js" ],
		// TODO enable this once we have a tool that can help with fixing formatting of existing files
		// tests: "tests/unit/**/*.js",
		grunt: "Gruntfile.js"
	},
	uglify: minify,
	htmllint: {
		// ignore files that contain invalid html, used only for ajax content testing
		all: grunt.file.expand( [ "demos/**/*.html", "tests/**/*.html" ] ).filter(function( file ) {
			return !/(?:ajax\/content\d\.html|tabs\/data\/test\.html|tests\/unit\/core\/core.*\.html)/.test( file );
		})
	},
	qunit: {
		files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
			// disabling everything that doesn't (quite) work with PhantomJS for now
			// TODO except for all|index|test, try to include more as we go
			return !( /(all|index|test|dialog|tooltip|draggable)\.html$/ ).test( file );
		})
	},
	jshint: {
		options: {
			jshintrc: true
		},
		all: [
			"ui/*.js",
			"Gruntfile.js",
			"build/**/*.js",
			"tests/unit/**/*.js"
		]
	},
	csslint: {
		base_theme: {
			src: "themes/base/*.css",
			options: {
				csslintrc: ".csslintrc"
			}
		}
	}
});

grunt.registerTask( "default", [ "lint", "test" ] );
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ] );
grunt.registerTask( "test", [ "qunit" ] );
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ] );
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ] );

};
<commit_msg>Gruntfile: Formatting<commit_after>module.exports = function( grunt ) {

"use strict";

var
	// files
	coreFiles = [
		"jquery.ui.core.js",
		"jquery.ui.widget.js",
		"jquery.ui.mouse.js",
		"jquery.ui.draggable.js",
		"jquery.ui.droppable.js",
		"jquery.ui.resizable.js",
		"jquery.ui.selectable.js",
		"jquery.ui.sortable.js",
		"jquery.ui.effect.js"
	],

	uiFiles = coreFiles.map(function( file ) {
		return "ui/" + file;
	}).concat( expandFiles( "ui/*.js" ).filter(function( file ) {
		return coreFiles.indexOf( file.substring( 3 ) ) === -1;
	}) ),

	allI18nFiles = expandFiles( "ui/i18n/*.js" ),

	cssFiles = [
		"core",
		"accordion",
		"autocomplete",
		"button",
		"datepicker",
		"dialog",
		"menu",
		"progressbar",
		"resizable",
		"selectable",
		"selectmenu",
		"slider",
		"spinner",
		"tabs",
		"tooltip",
		"theme"
	].map(function( component ) {
		return "themes/base/jquery.ui." + component + ".css";
	}),

	// minified files
	minify = {
		options: {
			preserveComments: false
		},
		main: {
			options: {
				banner: createBanner( uiFiles )
			},
			files: {
				"dist/jquery-ui.min.js": "dist/jquery-ui.js"
			}
		},
		i18n: {
			options: {
				banner: createBanner( allI18nFiles )
			},
			files: {
				"dist/i18n/jquery-ui-i18n.min.js": "dist/i18n/jquery-ui-i18n.js"
			}
		}
	},

	compareFiles = {
		all: [
			"dist/jquery-ui.js",
			"dist/jquery-ui.min.js"
		]
	};

function mapMinFile( file ) {
	return "dist/" + file.replace( /\.js$/, ".min.js" ).replace( /ui\//, "minified/" );
}

function expandFiles( files ) {
	return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) {
		return values[ 0 ];
	});
}

uiFiles.concat( allI18nFiles ).forEach(function( file ) {
	minify[ file ] = {
		options: {
			banner: createBanner()
		},
		files: {}
	};
	minify[ file ].files[ mapMinFile( file ) ] = file;
});

uiFiles.forEach(function( file ) {
	// TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13
	compareFiles[ file ] = [ file, mapMinFile( file ) ];
});

// grunt plugins
grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-contrib-uglify" );
grunt.loadNpmTasks( "grunt-contrib-concat" );
grunt.loadNpmTasks( "grunt-contrib-qunit" );
grunt.loadNpmTasks( "grunt-contrib-csslint" );
grunt.loadNpmTasks( "grunt-jscs-checker" );
grunt.loadNpmTasks( "grunt-html" );
grunt.loadNpmTasks( "grunt-compare-size" );
grunt.loadNpmTasks( "grunt-git-authors" );
// local testswarm and build tasks
grunt.loadTasks( "build/tasks" );

function stripDirectory( file ) {
	return file.replace( /.+\/(.+?)>?$/, "$1" );
}

function createBanner( files ) {
	// strip folders
	var fileNames = files && files.map( stripDirectory );
	return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
		"<%= grunt.template.today('isoDate') %>\n" +
		"<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" +
		(files ? "* Includes: " + fileNames.join(", ") + "\n" : "")+
		"* Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
		" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n";
}

grunt.initConfig({
	pkg: grunt.file.readJSON( "package.json" ),
	files: {
		dist: "<%= pkg.name %>-<%= pkg.version %>"
	},
	compare_size: compareFiles,
	concat: {
		ui: {
			options: {
				banner: createBanner( uiFiles ),
				stripBanners: {
					block: true
				}
			},
			src: uiFiles,
			dest: "dist/jquery-ui.js"
		},
		i18n: {
			options: {
				banner: createBanner( allI18nFiles )
			},
			src: allI18nFiles,
			dest: "dist/i18n/jquery-ui-i18n.js"
		},
		css: {
			options: {
				banner: createBanner( cssFiles ),
				stripBanners: {
					block: true
				}
			},
			src: cssFiles,
			dest: "dist/jquery-ui.css"
		}
	},
	jscs: {
		// datepicker, sortable, resizable and draggable are getting rewritten, ignore until that's done
		ui: [ "ui/jquery.ui.*.js", "!ui/jquery.ui.datepicker.js", "!ui/jquery.ui.sortable.js", "!ui/jquery.ui.resizable.js", "!ui/jquery.ui.draggable.js" ],
		// TODO enable this once we have a tool that can help with fixing formatting of existing files
		// tests: "tests/unit/**/*.js",
		grunt: "Gruntfile.js"
	},
	uglify: minify,
	htmllint: {
		// ignore files that contain invalid html, used only for ajax content testing
		all: grunt.file.expand( [ "demos/**/*.html", "tests/**/*.html" ] ).filter(function( file ) {
			return !/(?:ajax\/content\d\.html|tabs\/data\/test\.html|tests\/unit\/core\/core.*\.html)/.test( file );
		})
	},
	qunit: {
		files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
			// disabling everything that doesn't (quite) work with PhantomJS for now
			// TODO except for all|index|test, try to include more as we go
			return !( /(all|index|test|dialog|tooltip|draggable)\.html$/ ).test( file );
		})
	},
	jshint: {
		options: {
			jshintrc: true
		},
		all: [
			"ui/*.js",
			"Gruntfile.js",
			"build/**/*.js",
			"tests/unit/**/*.js"
		]
	},
	csslint: {
		base_theme: {
			src: "themes/base/*.css",
			options: {
				csslintrc: ".csslintrc"
			}
		}
	}
});

grunt.registerTask( "default", [ "lint", "test" ]);
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
grunt.registerTask( "test", [ "qunit" ]);
grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ]);
grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		concat: {
			options: {
				separator: ';'
			},
			dist: {
				src: ['src/**/*.js'],
				dest: 'dist/<%= pkg.name %>.js'
			}
		},
		uglify: {
			options: {
				banner: '/*! <%= pkg.name %> <%= pkg.version %> by <%= pkg.author %>*/',
				sourceMap: true
			},
			dist: {
				files: {
					'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
				}
			}
		},
		qunit: {
			files: ['test/**/*.html']
		},
		jshint: {
			files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
			options: {
				// options here to override JSHint defaults
				globals: {
					jQuery: true,
					console: true,
					module: true,
					document: true
				}
			}
		},
		watch: {
			files: ['<%= jshint.files %>'],
			tasks: ['jshint', 'concat', 'uglify']
		}
	});

	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-concat');

	grunt.registerTask('test', ['jshint']);

	grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'watch']);

};<commit_msg>Removed concat, left uglify only + source maps<commit_after>module.exports = function(grunt) {

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		uglify: {
			options: {
				banner: '<%= banner %>',
				sourceMap: true
			},
			dist: {
				src: 'src/lazyload.js',
				dest: 'dist/lazyload.min.js'
			}
		},
		jshint: {
			files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
			options: {
				// options here to override JSHint defaults
				globals: {
					jQuery: true,
					console: true,
					module: true,
					document: true
				}
			}
		},
		watch: {
			files: ['<%= jshint.files %>'],
			tasks: ['jshint', 'concat', 'uglify']
		}
	});

	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.registerTask('default', ['jshint', 'uglify', 'watch']);

};<|endoftext|>


<commit_before>// Generated on 2015-01-02 using generator-angular 0.10.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'client/app',
    test: require('./bower.json').appPath || 'client/test',
    dist: 'dist',
    api: {
      development: 'http://0.0.0.0:3000/api/',
      production: '/api/'
    },
    host: '0.0.0.0'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    nggettext_extract: {
      pot: {
        files: {
          'po/template.pot': [
            '<%= yeoman.app %>/modules/**/*.js',
            '<%= yeoman.app %>/modules/*/views/*.html',
            '<%= yeoman.app %>/modules/*/views/**/*.html'
          ]
        }
      }
    },
    nggettext_compile: {
      all: {
        options: {
          module: 'loopbackApp'
        },
        files: {
          '<%= yeoman.app %>/js/translations.js': ['po/*.po']
        }
      }
    },
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['!<%= yeoman.app %>/modules/**/tests/**', '<%= yeoman.app %>/modules/**/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['<%= yeoman.test %>/spec/{,*/}*.js'],
        tasks: [
          'newer:jshint:test',
          'karma'
        ]
      },
      styles: {
        files: ['<%= yeoman.app %>/css/{,*/}*.css'],
        tasks: [
          'newer:copy:styles',
          'autoprefixer'
        ]
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/css/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      },
      includeSource: {
        files: ['<%= yeoman.app %>/index.html'],
        tasks: ['includeSource:server']
      }
    },

    // include sources into index.html
    includeSource: {
      options: {
        basePath: 'client/app',
        baseUrl: '/',
      },
      server: {
        files: {
          '.tmp/index.html': '<%= yeoman.app %>/index.html'
        }
      },
      dist: {
        files: {
          '<%= yeoman.dist %>/index.html': '<%= yeoman.app %>/index.html'
        }
      }
    },

    ngconstant: {
      // Options for all targets
      options: {
        space: '  ',
        wrap: '"use strict";\n\n {%= __ngModule %}',
        name: 'config'
      },
      // Environment targets
      development: {
        options: {
          dest: '<%= yeoman.app %>/js/config.js'
        },
        constants: {
          ENV: {
            name: 'development',
            apiUrl: '<%= yeoman.api.development %>'
          }
        }
      },
      production: {
        options: {
          dest: '<%= yeoman.dist %>/js/config.js'
        },
        constants: {
          ENV: {
            name: 'production',
            apiUrl: '<%= yeoman.api.production %>'
          }
        }
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: '<%= yeoman.host %>',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/modules/**/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: '<%= yeoman.test %>/.jshintrc'
        },
        src: ['<%= yeoman.test %>/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [
          {
            dot: true,
            src: [
              '.tmp',
              '<%= yeoman.dist %>/{,*/}*',
              '!<%= yeoman.dist %>/.git{,*/}*'
            ]
          }
        ]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [
          {
            expand: true,
            cwd: '.tmp/css/',
            src: '{,*/}*.css',
            dest: '.tmp/css/'
          }
        ]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath: /\.\.\//
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/js/{,*/}*.js',
          '<%= yeoman.dist %>/css/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/css/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.dist %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        root: '<%= yeoman.app %>',
        flow: {
          html: {
            steps: {
              js: [
                'concat',
                'uglifyjs'
              ],
              css: [
                'cssmin'
              ]
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/css/{,*/}*.css'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images'
        ]
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/css/main.css': [
    //         '.tmp/css/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= yeoman.dist %>/images'
          }
        ]
      }
    },

    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            src: '{,*/}*.svg',
            dest: '<%= yeoman.dist %>/images'
          }
        ]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true,
          removeAttributeQuotes: true,
          removeComments: true,
          removeEmptyAttributes: true,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: true,
          removeStyleLinkTypeAttributes: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.dist %>',
            src: [
              '*.html',
              'modules/**/views/{,*/}*.html'
            ],
            dest: '<%= yeoman.dist %>'
          }
        ]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '.tmp/concat/scripts',
            src: [
              '*.js',
              '!lb-services.js',
              '!oldieshim.js'
            ],
            dest: '.tmp/concat/scripts'
          }
        ]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= yeoman.app %>',
            dest: '<%= yeoman.dist %>',
            src: [
              '*.{ico,png,txt}',
              '.htaccess',
              //'*.html',
              'modules/**/{,*/}*.html',
              'modules/**/{,*/}*.js',
              'images/{,*/}*.*',
              'css/{,*/}*.*',
              'fonts/{,*/}*.*'
            ]
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            dest: '<%= yeoman.dist %>/images',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/css',
            dest: '<%= yeoman.dist %>/css',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/bootstrap/dist',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/ionicons',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/font-awesome',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          }
        ]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/css',
        dest: '.tmp/css/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        //'imagemin',
        //'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: '<%= yeoman.test %>/karma.conf.js',
        singleRun: true
      }
    },
    loopback_sdk_angular: {
      services: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.development %>'
        }
      },
      development: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.development %>'
        }
      },
      production: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.production %>'
        }
      }
    },
    docularserver: {
      targetDir: "docs",
      livereload: true,
      port: 8000
    },
    docular: {
      useHtml5Mode: true, //Use angular's html5 mode? true/false.
      docular_webapp_target: 'docs', //The place where the docs will be generated
      showAngularDocs: true,
      showDocularDocs: true,
      groups: [
        {
          groupTitle: 'Admin',
          groupId: 'loopbackApp',
          sections: [
            {
              id: 'loopbackApp',
              title: 'LoopBack Services',
              scripts: ['<%= yeoman.app %>/modules/**/{,*/}*.js']
            }
          ]
        },
        {
          groupTitle: 'LoopBack',
          groupId: 'loopback',
          sections: [
            {
              id: 'lbServices',
              title: 'LoopBack Services',
              scripts: ['<%= yeoman.app %>/js/lb-services.js']
            }
          ]
        }
      ]
    }

  });

  // Load the plugin that provides the "loopback-angular" and "grunt-docular" tasks.
  grunt.loadNpmTasks('grunt-loopback-sdk-angular');
  grunt.loadNpmTasks('grunt-docular');
  grunt.loadNpmTasks('grunt-angular-gettext');
  grunt.loadNpmTasks('grunt-include-source');

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run([
        'build',
        'connect:dist:keepalive'
      ]);
    }

    grunt.task.run([
      'clean:server',
      'includeSource:server',
      'ngconstant:development',
      'loopback_sdk_angular:development',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'includeSource:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'ngconstant:production',
    'loopback_sdk_angular:production',
    'wiredep',
    'includeSource:dist',
    'useminPrepare',
    //'concurrent:dist',
    //'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    //'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'ngconstant:development',
    'loopback_sdk_angular:development',
    'docular',
    'nggettext_extract',
    'nggettext_compile',
    'build'
  ]);

  grunt.registerTask('loopback', [
    'ngconstant:development',
    'loopback_sdk_angular:development',
    'docular'
  ]);

};
<commit_msg>Fix creation of ngconstant config<commit_after>// Generated on 2015-01-02 using generator-angular 0.10.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'client/app',
    test: require('./bower.json').appPath || 'client/test',
    dist: 'dist',
    api: {
      development: 'http://0.0.0.0:3000/api/',
      production: '/api/'
    },
    host: '0.0.0.0'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    nggettext_extract: {
      pot: {
        files: {
          'po/template.pot': [
            '<%= yeoman.app %>/modules/**/*.js',
            '<%= yeoman.app %>/modules/*/views/*.html',
            '<%= yeoman.app %>/modules/*/views/**/*.html'
          ]
        }
      }
    },
    nggettext_compile: {
      all: {
        options: {
          module: 'loopbackApp'
        },
        files: {
          '<%= yeoman.app %>/js/translations.js': ['po/*.po']
        }
      }
    },
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['!<%= yeoman.app %>/modules/**/tests/**', '<%= yeoman.app %>/modules/**/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['<%= yeoman.test %>/spec/{,*/}*.js'],
        tasks: [
          'newer:jshint:test',
          'karma'
        ]
      },
      styles: {
        files: ['<%= yeoman.app %>/css/{,*/}*.css'],
        tasks: [
          'newer:copy:styles',
          'autoprefixer'
        ]
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/css/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      },
      includeSource: {
        files: ['<%= yeoman.app %>/index.html'],
        tasks: ['includeSource:server']
      }
    },

    // include sources into index.html
    includeSource: {
      options: {
        basePath: 'client/app',
        baseUrl: '/'
      },
      server: {
        files: {
          '.tmp/index.html': '<%= yeoman.app %>/index.html'
        }
      },
      dist: {
        files: {
          '<%= yeoman.dist %>/index.html': '<%= yeoman.app %>/index.html'
        }
      }
    },

    ngconstant: {
      // Options for all targets
      options: {
        space: '  ',
        wrap: '"use strict";\n\n {%= __ngModule %}',
        name: 'config'
      },
      // Environment targets
      development: {
        options: {
          dest: '<%= yeoman.app %>/js/config.js'
        },
        constants: {
          ENV: {
            name: 'development',
            apiUrl: '<%= yeoman.api.development %>'
          }
        }
      },
      production: {
        options: {
          dest: '<%= yeoman.app %>/js/config.js'
        },
        constants: {
          ENV: {
            name: 'production',
            apiUrl: '<%= yeoman.api.production %>'
          }
        }
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: '<%= yeoman.host %>',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/modules/**/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: '<%= yeoman.test %>/.jshintrc'
        },
        src: ['<%= yeoman.test %>/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [
          {
            dot: true,
            src: [
              '.tmp',
              '<%= yeoman.dist %>/{,*/}*',
              '!<%= yeoman.dist %>/.git{,*/}*'
            ]
          }
        ]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [
          {
            expand: true,
            cwd: '.tmp/css/',
            src: '{,*/}*.css',
            dest: '.tmp/css/'
          }
        ]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath: /\.\.\//
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/js/{,*/}*.js',
          '<%= yeoman.dist %>/css/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/css/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.dist %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        root: '<%= yeoman.app %>',
        flow: {
          html: {
            steps: {
              js: [
                'concat',
                'uglifyjs'
              ],
              css: [
                'cssmin'
              ]
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/css/{,*/}*.css'],
      options: {
        assetsDirs: [
          '<%= yeoman.dist %>',
          '<%= yeoman.dist %>/images'
        ]
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/css/main.css': [
    //         '.tmp/css/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= yeoman.dist %>/images'
          }
        ]
      }
    },

    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            src: '{,*/}*.svg',
            dest: '<%= yeoman.dist %>/images'
          }
        ]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true,
          removeAttributeQuotes: true,
          removeComments: true,
          removeEmptyAttributes: true,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: true,
          removeStyleLinkTypeAttributes: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= yeoman.dist %>',
            src: [
              '*.html',
              'modules/**/views/{,*/}*.html'
            ],
            dest: '<%= yeoman.dist %>'
          }
        ]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '.tmp/concat/scripts',
            src: [
              '*.js',
              '!lb-services.js',
              '!config.js',
              '!oldieshim.js'
            ],
            dest: '.tmp/concat/scripts'
          }
        ]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= yeoman.app %>',
            dest: '<%= yeoman.dist %>',
            src: [
              '*.{ico,png,txt}',
              '.htaccess',
              //'*.html',
              'modules/**/{,*/}*.html',
              'modules/**/{,*/}*.js',
              'images/{,*/}*.*',
              'css/{,*/}*.*',
              'fonts/{,*/}*.*'
            ]
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/images',
            dest: '<%= yeoman.dist %>/images',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/css',
            dest: '<%= yeoman.dist %>/css',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/bootstrap/dist',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/ionicons',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          },
          {
            expand: true,
            cwd: '<%= yeoman.app %>/bower_components/font-awesome',
            src: 'fonts/*',
            dest: '<%= yeoman.dist %>'
          }
        ]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/css',
        dest: '.tmp/css/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        //'imagemin',
        //'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: '<%= yeoman.test %>/karma.conf.js',
        singleRun: true
      }
    },
    loopback_sdk_angular: {
      services: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.development %>'
        }
      },
      development: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.development %>'
        }
      },
      production: {
        options: {
          input: 'server/server.js',
          output: '<%= yeoman.app %>/js/lb-services.js',
          apiUrl: '<%= yeoman.api.production %>'
        }
      }
    },
    docularserver: {
      targetDir: "docs",
      livereload: true,
      port: 8000
    },
    docular: {
      useHtml5Mode: true, //Use angular's html5 mode? true/false.
      docular_webapp_target: 'docs', //The place where the docs will be generated
      showAngularDocs: true,
      showDocularDocs: true,
      groups: [
        {
          groupTitle: 'Admin',
          groupId: 'loopbackApp',
          sections: [
            {
              id: 'loopbackApp',
              title: 'LoopBack Services',
              scripts: ['<%= yeoman.app %>/modules/**/{,*/}*.js']
            }
          ]
        },
        {
          groupTitle: 'LoopBack',
          groupId: 'loopback',
          sections: [
            {
              id: 'lbServices',
              title: 'LoopBack Services',
              scripts: ['<%= yeoman.app %>/js/lb-services.js']
            }
          ]
        }
      ]
    }

  });

  // Load the plugin that provides the "loopback-angular" and "grunt-docular" tasks.
  grunt.loadNpmTasks('grunt-loopback-sdk-angular');
  grunt.loadNpmTasks('grunt-docular');
  grunt.loadNpmTasks('grunt-angular-gettext');
  grunt.loadNpmTasks('grunt-include-source');

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run([
        'build',
        'connect:dist:keepalive'
      ]);
    }

    grunt.task.run([
      'clean:server',
      'includeSource:server',
      'ngconstant:development',
      'loopback_sdk_angular:development',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'includeSource:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'ngconstant:production',
    'loopback_sdk_angular:production',
    'wiredep',
    'includeSource:dist',
    'useminPrepare',
    //'concurrent:dist',
    //'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    //'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'ngconstant:development',
    'loopback_sdk_angular:development',
    'docular',
    'nggettext_extract',
    'nggettext_compile',
    'build'
  ]);

  grunt.registerTask('loopback', [
    'ngconstant:development',
    'loopback_sdk_angular:development',
    'docular'
  ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

	grunt.initConfig({

		// Coffee build
		coffee: {
			build: {
				options: {
					join: true,
					bare: true
				},
				files: {
					'build/rotten-flesh.js': [

						// Main app file
						'src/Main.coffee',

						// Utils
						'src/utils/Utils.coffee',
						'src/utils/Vendors.coffee',
						'src/utils/EventManager.coffee',

						// Loaders
						'src/loaders/ImageLoader.coffee',
						'src/loaders/TiledMapLoader.coffee',
						'src/loaders/AssetLoader.coffee',
					]
				}
			}
		},

		// Uglify stuff
		uglify: {
			options: {
				mangle: false,
			},
			target: {
				files: {
					"build/rotten-flesh.min.js": "build/rotten-flesh.js"
				}
			}
		},

		// Watch task
		watch: {
			coffeeScripts: {
				files: "src/**/*.coffee",
				tasks: "coffee:build",
				options: { livereload: '<%= connect.options.livereload %>' }
			},

			gruntfile: {
				files: ['Gruntfile.js'],
				tasks: "coffee:build"
			},

			options: {
				livereload: '<%= connect.options.livereload %>',
				files: ["build/*.js","examples/*/*.html"]
			}
		},

		//Serve task
		connect: {
			options: {
				port: 35565,
				hostname: "localhost",
				livereload: 35566
			},

			livereload: {
				options: {
					open: true,
					middleware: function (connect) {
						return [
							connect.static('examples'),
							connect().use('/build', connect.static('./build'))
						];
					}
				}
			}
		},
	});

	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-connect');

	grunt.registerTask("build", [
		"coffee:build"
	]);

	grunt.registerTask("dist", [
		"coffee:build",
		"uglify"
	]);

	grunt.registerTask("listen", [
		"coffee:build",
		"watch"
	]);

	grunt.registerTask("serve", "", function(){
		grunt.task.run([
			"coffee:build",
			"connect:livereload",
			"watch"
		]);
	});

	grunt.registerTask("test", [

	]);

};
<commit_msg>add Game & Scene classes to compilation<commit_after>module.exports = function(grunt) {

	grunt.initConfig({

		// Coffee build
		coffee: {
			build: {
				options: {
					join: true,
					bare: true
				},
				files: {
					'build/rotten-flesh.js': [

						// Main app file
						'src/Main.coffee',

						// Utils
						'src/utils/Utils.coffee',
						'src/utils/Vendors.coffee',
						'src/utils/EventManager.coffee',

						// Loaders
						'src/loaders/ImageLoader.coffee',
						'src/loaders/TiledMapLoader.coffee',
						'src/loaders/AssetLoader.coffee',

						// Game
						'src/game/Game.coffee',
						'src/game/Scene.coffee',
					]
				}
			}
		},

		// Uglify stuff
		uglify: {
			options: {
				mangle: false,
			},
			target: {
				files: {
					"build/rotten-flesh.min.js": "build/rotten-flesh.js"
				}
			}
		},

		// Watch task
		watch: {
			coffeeScripts: {
				files: "src/**/*.coffee",
				tasks: "coffee:build",
				options: { livereload: '<%= connect.options.livereload %>' }
			},

			gruntfile: {
				files: ['Gruntfile.js'],
				tasks: "coffee:build"
			},

			options: {
				livereload: '<%= connect.options.livereload %>',
				files: ["build/*.js","examples/*/*.html"]
			}
		},

		//Serve task
		connect: {
			options: {
				port: 35565,
				hostname: "localhost",
				livereload: 35566
			},

			livereload: {
				options: {
					open: true,
					middleware: function (connect) {
						return [
							connect.static('examples'),
							connect().use('/build', connect.static('./build'))
						];
					}
				}
			}
		},
	});

	grunt.loadNpmTasks('grunt-contrib-coffee');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-connect');

	grunt.registerTask("build", [
		"coffee:build"
	]);

	grunt.registerTask("dist", [
		"coffee:build",
		"uglify"
	]);

	grunt.registerTask("listen", [
		"coffee:build",
		"watch"
	]);

	grunt.registerTask("serve", "", function(){
		grunt.task.run([
			"coffee:build",
			"connect:livereload",
			"watch"
		]);
	});

	grunt.registerTask("test", [

	]);

};
<|endoftext|>