<commit_before>var exec = require('child_process').exec,
	path = require('path');

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		manifest: grunt.file.readJSON('extension/manifest.json'),

		jshint: {
			extension: [
				'Gruntfile.js',
				'extension/js/**/*.js'
			]
		},

		clean: {
			build: ['build'],
			assets: [
				'extension/pages',
				'extension/styles',
				'extension/vendor'
			]
		},

		zip: {
			// zip for uploading to Google Web Store Dashboard
			chrome: {
				router: function (filepath) {
					var filename = path.basename(filepath);

					return filename === 'key.pem' ? 'extension/key.pem' : filepath;
				},

				src: ['extension/**', 'key.pem'],
				dest: 'build/chime.zip'
			},

			extension: {
				cwd: 'extension/',
				src: ['extension/**'],
				dest: 'build/extension.zip'
			}
		},

		crx: {
			extension: {
				src: 'build/extension.zip',
				dest: 'build/chime.crx'
			}
		},

		stylus: {
			styles: {
				files: [{
					expand: true,
					src: '**/*.styl',
					dest: 'extension/styles',
					cwd: 'src/styles',
					ext: '.css'
				}]
			}
		},

		jade: {
			pages: {
				files: [{
					expand: true,
					src: '**/*.jade',
					dest: 'extension/pages',
					cwd: 'src/pages',
					ext: '.html'
				}]
			}
		},

		watch: {
			stylus: {
				files: ['src/styles/**/*.styl'],
				tasks: ['stylus:styles'],
				options: {
					atBegin: true
				}
			},

			pages: {
				files: ['src/pages/**/*.jade'],
				tasks: ['jade:pages'],
				options: {
					atBegin: true
				}
			}
		},

		bower: {
			install: {
				options: {
					targetDir: './extension/vendor/',
					layout: 'byComponent',
					install: true,
					cleanup: true,
					bowerOptions: {}
				}
			}
		},

		concurrent: {
			watch: {
				tasks: ['watch:stylus', 'watch:pages'],
				options: {
					logConcurrentOutput: true
				}
			}
		},

		bump: {
			options: {
				filepaths: [
					'package.json',
					'bower.json',
					'extension/manifest.json'
				],
				syncVersions: true,
				commit: false,
				tag: false
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-jade');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-bump');
	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-zip');
	grunt.loadNpmTasks('grunt-crx');

	grunt.registerTask('check', function () {
		if (grunt.file.exists('key.pem')) {
			grunt.log.ok();
		} else {
			grunt.fail.fatal('File key.pem not found. ');
		}
	});

	grunt.registerTask('test', ['jshint']);
	grunt.registerTask('assets', ['clean:assets', 'bower:install', 'jade:pages', 'stylus:styles']);

	grunt.registerTask('crx-extension', ['assets', 'test', 'zip:extension', 'crx:extension']);
	grunt.registerTask('chrome-extension', ['check', 'assets', 'test', 'zip:chrome']);

	grunt.registerTask('default', ['chrome-extension']);
};
<commit_msg>Testing automated commitment and tagging<commit_after>var exec = require('child_process').exec,
	path = require('path');

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		manifest: grunt.file.readJSON('extension/manifest.json'),

		jshint: {
			extension: [
				'Gruntfile.js',
				'extension/js/**/*.js'
			]
		},

		clean: {
			build: ['build'],
			assets: [
				'extension/pages',
				'extension/styles',
				'extension/vendor'
			]
		},

		zip: {
			// zip for uploading to Google Web Store Dashboard
			chrome: {
				router: function (filepath) {
					var filename = path.basename(filepath);

					return filename === 'key.pem' ? 'extension/key.pem' : filepath;
				},

				src: ['extension/**', 'key.pem'],
				dest: 'build/chime.zip'
			},

			extension: {
				cwd: 'extension/',
				src: ['extension/**'],
				dest: 'build/extension.zip'
			}
		},

		crx: {
			extension: {
				src: 'build/extension.zip',
				dest: 'build/chime.crx'
			}
		},

		stylus: {
			styles: {
				files: [{
					expand: true,
					src: '**/*.styl',
					dest: 'extension/styles',
					cwd: 'src/styles',
					ext: '.css'
				}]
			}
		},

		jade: {
			pages: {
				files: [{
					expand: true,
					src: '**/*.jade',
					dest: 'extension/pages',
					cwd: 'src/pages',
					ext: '.html'
				}]
			}
		},

		watch: {
			stylus: {
				files: ['src/styles/**/*.styl'],
				tasks: ['stylus:styles'],
				options: {
					atBegin: true
				}
			},

			pages: {
				files: ['src/pages/**/*.jade'],
				tasks: ['jade:pages'],
				options: {
					atBegin: true
				}
			}
		},

		bower: {
			install: {
				options: {
					targetDir: './extension/vendor/',
					layout: 'byComponent',
					install: true,
					cleanup: true,
					bowerOptions: {}
				}
			}
		},

		concurrent: {
			watch: {
				tasks: ['watch:stylus', 'watch:pages'],
				options: {
					logConcurrentOutput: true
				}
			}
		},

		bump: {
			options: {
				filepaths: [
					'package.json',
					'bower.json',
					'extension/manifest.json'
				],
				syncVersions: true
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-jade');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-bump');
	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-zip');
	grunt.loadNpmTasks('grunt-crx');

	grunt.registerTask('check', function () {
		if (grunt.file.exists('key.pem')) {
			grunt.log.ok();
		} else {
			grunt.fail.fatal('File key.pem not found. ');
		}
	});

	grunt.registerTask('test', ['jshint']);
	grunt.registerTask('assets', ['clean:assets', 'bower:install', 'jade:pages', 'stylus:styles']);

	grunt.registerTask('crx-extension', ['assets', 'test', 'zip:extension', 'crx:extension']);
	grunt.registerTask('chrome-extension', ['check', 'assets', 'test', 'zip:chrome']);

	grunt.registerTask('default', ['chrome-extension']);
};
<|endoftext|>


<commit_before>// Generated on 2014-06-10 using generator-angular 0.9.0-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);

  function connectAngularMiddleware (connect, options) {
    // based on http://stackoverflow.com/a/20553608/2486196
    var middlewares = [];

    // enable Angular's HTML5 mode
    middlewares.push(function (req, res, next) {
      var exists = false;
      var file = req.url.split('?')[0];

      for(var i = 0; i < options.base.length; i++) {
        if(require('fs').existsSync(options.base[i] + file)) {
          exists = true;
          break;
        }
      }

      if(!exists) {
        res.setHeader('Location', '/');
        req.url = '/';
      }

      next();
    });

    if (!Array.isArray(options.base)) {
      options.base = [options.base];
    }
    options.base.forEach(function(base) {
      // Serve static files.
      middlewares.push(connect.static(base));
    });

    return middlewares;
  }

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

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/components/**/*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/*.html',
          '<%= yeoman.app %>/components/**/*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        middleware: connectAngularMiddleware,
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= yeoman.app %>'
          ]
        }
      },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.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 %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['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/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        exclude: [ /handlebars/, /fira/ ],
        ignorePath: new RegExp('^<%= yeoman.app %>/')
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: '<%= yeoman.app %>/bower_components/'
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: '<%= yeoman.app %>/bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/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.app %>/*.html', '<%= yeoman.app %>/components/**/*.html'],
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/*.html', '<%= yeoman.dist %>/components/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.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 %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.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
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ngmin tries to make the code safe for minification automatically by
    // using the Angular long form for dependency injection. It doesn't work on
    // things like resolve or inject so those have to be done manually.
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

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

    nunjucks: {
      osftemplates: {
        baseDir: '<%= yeoman.app %>/bower_components/osf-export-templates/tpls',
        src: '**/*.tpl',
        dest: '.tmp/scripts/osf-templates.js',
        options: {
          name: function(filename) {
            var format = filename.substr(0, filename.length - 4);
            return 'osf_' + format;
          }
        }
      }
    },

    // 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',
            'components/**/*.html',
            'images/{,*/}*.{webp}',
            'fonts/**/*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          cwd: '<%= yeoman.app %>/bower_components/fira',
          dest: '<%= yeoman.dist %>/fonts/fira',
          expand: true,
          src: [ '**/*.{eot,otf,ttf,woff}', ]
        }]
      },
      fonts: {
        files: [{
          cwd: '<%= yeoman.app %>/bower_components/fira',
          dest: '.tmp/fonts/fira',
          expand: true,
          src: [ '**/*.{eot,otf,ttf,woff}', ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

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

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  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',
      'copy:fonts',
      'nunjucks:osftemplates',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

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

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'nunjucks:osftemplates',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>fix osftemplates in build<commit_after>// Generated on 2014-06-10 using generator-angular 0.9.0-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);

  function connectAngularMiddleware (connect, options) {
    // based on http://stackoverflow.com/a/20553608/2486196
    var middlewares = [];

    // enable Angular's HTML5 mode
    middlewares.push(function (req, res, next) {
      var exists = false;
      var file = req.url.split('?')[0];

      for(var i = 0; i < options.base.length; i++) {
        if(require('fs').existsSync(options.base[i] + file)) {
          exists = true;
          break;
        }
      }

      if(!exists) {
        res.setHeader('Location', '/');
        req.url = '/';
      }

      next();
    });

    if (!Array.isArray(options.base)) {
      options.base = [options.base];
    }
    options.base.forEach(function(base) {
      // Serve static files.
      middlewares.push(connect.static(base));
    });

    return middlewares;
  }

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

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/components/**/*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/*.html',
          '<%= yeoman.app %>/components/**/*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        middleware: connectAngularMiddleware,
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= yeoman.app %>'
          ]
        }
      },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.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 %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['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/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        exclude: [ /handlebars/, /fira/ ],
        ignorePath: new RegExp('^<%= yeoman.app %>/')
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: '<%= yeoman.app %>/bower_components/'
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: '<%= yeoman.app %>/bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/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.app %>/*.html', '<%= yeoman.app %>/components/**/*.html'],
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/*.html', '<%= yeoman.dist %>/components/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.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 %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.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
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ngmin tries to make the code safe for minification automatically by
    // using the Angular long form for dependency injection. It doesn't work on
    // things like resolve or inject so those have to be done manually.
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

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

    nunjucks: {
      osftemplates: {
        baseDir: '<%= yeoman.app %>/bower_components/osf-export-templates/tpls',
        src: '**/*.tpl',
        dest: '.tmp/scripts/osf-templates.js',
        options: {
          name: function(filename) {
            var format = filename.substr(0, filename.length - 4);
            return 'osf_' + format;
          }
        }
      }
    },

    // 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',
            'components/**/*.html',
            'images/{,*/}*.{webp}',
            'fonts/**/*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          cwd: '<%= yeoman.app %>/bower_components/fira',
          dest: '<%= yeoman.dist %>/fonts/fira',
          expand: true,
          src: [ '**/*.{eot,otf,ttf,woff}', ]
        }]
      },
      fonts: {
        files: [{
          cwd: '<%= yeoman.app %>/bower_components/fira',
          dest: '.tmp/fonts/fira',
          expand: true,
          src: [ '**/*.{eot,otf,ttf,woff}', ]
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

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

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  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',
      'copy:fonts',
      'nunjucks:osftemplates',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

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

  grunt.registerTask('build', [
    'clean:dist',
    'nunjucks:osftemplates',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<|endoftext|>


<commit_before>/* global module:false */
module.exports = function(grunt) {
	var port = grunt.option('port') || 8000;
	var base = grunt.option('base') || '.';

	// Project configuration
	grunt.initConfig({
		pkg: grunt.file.readJSON('reveal.js/package.json'),
		meta: {
			banner:
				'/*!\n' +
				' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
				' * http://lab.hakim.se/reveal-js\n' +
				' * MIT licensed\n' +
				' *\n' +
				' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' +
				' */'
		},

		qunit: {
			files: ['reveal.js/test/*.html']
		},

		uglify: {
			options: {
				banner: '<%= meta.banner %>\n'
			},
			build: {
				src: 'reveal.js/js/reveal.js',
				dest: 'js/reveal.min.js'
			}
		},

		sass: {
			core: {
				files: {
					'css/reveal.css': 'reveal.js/css/reveal.scss',
				}
			},
			themes: {
				files: [
					{
						expand: true,
						cwd: 'css/theme/source',
						src: ['*.scss'],
						dest: 'css/theme',
						ext: '.css'
					}
				]
			}
		},

		autoprefixer: {
			dist: {
				src: 'css/reveal.css'
			}
		},

		cssmin: {
			compress: {
				files: {
					'css/reveal.min.css': ['reveal.js/css/reveal.css']
				}
			}
		},

		jshint: {
			options: {
				curly: false,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				undef: true,
				eqnull: true,
				browser: true,
				expr: true,
				globals: {
					head: false,
					module: false,
					console: false,
					unescape: false,
					define: false,
					exports: false
				}
			},
			files: ['Gruntfile.js', 'reveal.js/js/reveal.js']
		},

		connect: {
			server: {
				options: {
					port: port,
					base: base,
					livereload: true,
					open: true
				}
			}
		},

		zip: {
			'reveal-js-presentation.zip': [
				'index.html',
				'css/**',
				'reveal.js/css/print/**',
				'js/**',
				'reveal.js/js/**',
				'lib/**',
				'reveal.js/lib/**',
				'images/**',
				'reveal.js/plugin/**'
			]
		},

		watch: {
			options: {
				livereload: true
			},
			js: {
				files: ['Gruntfile.js', 'reveal.js/js/reveal.js'],
				tasks: 'js'
			},
			theme: {
				files: ['css/theme/source/*.scss', 'css/theme/template/*.scss'],
				tasks: 'css-themes'
			},
			css: {
				files: ['reveal.js/css/reveal.scss'],
				tasks: 'css-core'
			},
			html: {
				files: ['index.html']
			}
		}

	});

	// Dependencies
	grunt.loadNpmTasks('grunt-contrib-qunit');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-autoprefixer');
	grunt.loadNpmTasks('grunt-zip');

	// Default task
	grunt.registerTask('default', ['css', 'js']);

	// JS task
	grunt.registerTask('js', ['jshint', 'uglify', 'qunit']);

	// Theme CSS
	grunt.registerTask('css-themes', ['sass:themes']);

	// Core framework CSS
	grunt.registerTask('css-core', ['sass:core', 'autoprefixer', 'cssmin']);

	// All CSS
	grunt.registerTask('css', ['sass', 'autoprefixer', 'cssmin']);

	// Package presentation to archive
	grunt.registerTask('package', ['default', 'zip']);

	// Serve presentation locally
	grunt.registerTask('serve', ['connect', 'watch']);

	// Run tests
	grunt.registerTask('test', ['jshint', 'qunit']);

};
<commit_msg>make Grunt listen to changes in md files<commit_after>/* global module:false */
module.exports = function(grunt) {
	var port = grunt.option('port') || 8000;
	var base = grunt.option('base') || '.';

	// Project configuration
	grunt.initConfig({
		pkg: grunt.file.readJSON('reveal.js/package.json'),
		meta: {
			banner:
				'/*!\n' +
				' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
				' * http://lab.hakim.se/reveal-js\n' +
				' * MIT licensed\n' +
				' *\n' +
				' * Copyright (C) 2015 Hakim El Hattab, http://hakim.se\n' +
				' */'
		},

		qunit: {
			files: ['reveal.js/test/*.html']
		},

		uglify: {
			options: {
				banner: '<%= meta.banner %>\n'
			},
			build: {
				src: 'reveal.js/js/reveal.js',
				dest: 'js/reveal.min.js'
			}
		},

		sass: {
			core: {
				files: {
					'css/reveal.css': 'reveal.js/css/reveal.scss',
				}
			},
			themes: {
				files: [
					{
						expand: true,
						cwd: 'css/theme/source',
						src: ['*.scss'],
						dest: 'css/theme',
						ext: '.css'
					}
				]
			}
		},

		autoprefixer: {
			dist: {
				src: 'css/reveal.css'
			}
		},

		cssmin: {
			compress: {
				files: {
					'css/reveal.min.css': ['reveal.js/css/reveal.css']
				}
			}
		},

		jshint: {
			options: {
				curly: false,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				undef: true,
				eqnull: true,
				browser: true,
				expr: true,
				globals: {
					head: false,
					module: false,
					console: false,
					unescape: false,
					define: false,
					exports: false
				}
			},
			files: ['Gruntfile.js', 'reveal.js/js/reveal.js']
		},

		connect: {
			server: {
				options: {
					port: port,
					base: base,
					livereload: true,
					open: true
				}
			}
		},

		zip: {
			'reveal-js-presentation.zip': [
				'index.html',
				'css/**',
				'reveal.js/css/print/**',
				'js/**',
				'reveal.js/js/**',
				'lib/**',
				'reveal.js/lib/**',
				'images/**',
				'reveal.js/plugin/**'
			]
		},

		watch: {
			options: {
				livereload: true
			},
			js: {
				files: ['Gruntfile.js', 'reveal.js/js/reveal.js'],
				tasks: 'js'
			},
			theme: {
				files: ['css/theme/source/*.scss', 'css/theme/template/*.scss'],
				tasks: 'css-themes'
			},
			css: {
				files: ['reveal.js/css/reveal.scss'],
				tasks: 'css-core'
			},
			html: {
				files: ['index.html', '*.md']
			}
		}

	});

	// Dependencies
	grunt.loadNpmTasks('grunt-contrib-qunit');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-autoprefixer');
	grunt.loadNpmTasks('grunt-zip');

	// Default task
	grunt.registerTask('default', ['css', 'js']);

	// JS task
	grunt.registerTask('js', ['jshint', 'uglify', 'qunit']);

	// Theme CSS
	grunt.registerTask('css-themes', ['sass:themes']);

	// Core framework CSS
	grunt.registerTask('css-core', ['sass:core', 'autoprefixer', 'cssmin']);

	// All CSS
	grunt.registerTask('css', ['sass', 'autoprefixer', 'cssmin']);

	// Package presentation to archive
	grunt.registerTask('package', ['default', 'zip']);

	// Serve presentation locally
	grunt.registerTask('serve', ['connect', 'watch']);

	// Run tests
	grunt.registerTask('test', ['jshint', 'qunit']);

};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    swig: {
      dist: {
        init: {
          allowErrors: false
        },
        banners: grunt.file.readJSON('templates/banners.json'),
        dest: 'dist',
        generateRobotstxt: false,
        generateSitemap: false,
        max_upload_size: 128,
        pkgVersion: '<%= pkg.version %>',
        production: false,
        siteName: 'Pantsu',
        siteUrl: 'https://pantsu.cat/',
        src: [
          'templates/index.swig',
          'templates/faq.swig',
          'templates/tools.swig'
        ],
      }
    },
    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeEmptyAttributes: true
        },
        files: [{
          expand: true,
          cwd: 'dist/',
          src: '*.html',
          dest: 'dist/'
        }]
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> (<%= pkg.repository.url %>) @ <%= grunt.template.today("yyyy-mm-dd") %> */\n' +
          '// @source https://git.pantsu.cat/pantsu/pomf/tree/js\n' +
          '// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat\n',
        footer: '\n// @license-end',
        screwIE8: true
      },
      dist: {
        files: {
          'dist/pomf.min.js': [
            'static/js/app.js'
          ]
        }
      }
    },
    cssmin: {
      dist: {
        files: {
          'dist/pomf.min.css': [
            'static/css/pomf.css'
          ]
        }
      }
    },
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: 'static/img/',
          src: '**/*.{png,jpg,gif}',
          dest: 'dist/img/'
        }]
      }
    },
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: 'static/php',
          src: '**',
          dest: 'dist/'
        },
        {
          src: 'static/img/favicon.ico',
          dest: 'dist/favicon.ico'
        }],
      }
    }
  });

  grunt.loadNpmTasks('grunt-swig');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('default', ['swig', 'htmlmin', 'cssmin', 'uglify', 'imagemin', 'copy']);
};
<commit_msg>Replaced dist{...} with  dist.json<commit_after>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    swig: {
      dist: grunt.file.readJSON('dist.json'),
    },
    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeEmptyAttributes: true
        },
        files: [{
          expand: true,
          cwd: 'dist/',
          src: '*.html',
          dest: 'dist/'
        }]
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> (<%= pkg.repository.url %>) @ <%= grunt.template.today("yyyy-mm-dd") %> */\n' +
          '// @source https://git.pantsu.cat/pantsu/pomf/tree/js\n' +
          '// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat\n',
        footer: '\n// @license-end',
        screwIE8: true
      },
      dist: {
        files: {
          'dist/pomf.min.js': [
            'static/js/app.js'
          ]
        }
      }
    },
    cssmin: {
      dist: {
        files: {
          'dist/pomf.min.css': [
            'static/css/pomf.css'
          ]
        }
      }
    },
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: 'static/img/',
          src: '**/*.{png,jpg,gif}',
          dest: 'dist/img/'
        }]
      }
    },
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: 'static/php',
          src: '**',
          dest: 'dist/'
        },
        {
          src: 'static/img/favicon.ico',
          dest: 'dist/favicon.ico'
        }],
      }
    }
  });

  grunt.loadNpmTasks('grunt-swig');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('default', ['swig', 'htmlmin', 'cssmin', 'uglify', 'imagemin', 'copy']);
};
<|endoftext|>


<commit_before>/*
* grunt-iojs-api-docs
* https://github.com/nodenica/grunt-iojs-api-docs.git
*
* Copyright (c) 2015 Paulo McNally <paulomcnally@gmail.com>
* Licensed under the MIT license.
*/

'use strict';

var version = '5.0.0';

module.exports = function(grunt) {
  // load all npm grunt tasks
  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // Configuration to be run (and then tested).
    docs: {
      'default_options': {
        options: {
          version: version,
          dest: './dest/'
        },

      }
    }
  });
  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');
  // By default, lint and run all tests.
  grunt.registerTask('default', ['docs']);
};
<commit_msg>v5.2.0<commit_after>/*
* grunt-iojs-api-docs
* https://github.com/nodenica/grunt-iojs-api-docs.git
*
* Copyright (c) 2015 Paulo McNally <paulomcnally@gmail.com>
* Licensed under the MIT license.
*/

'use strict';

var version = '5.2.0';

module.exports = function(grunt) {
  // load all npm grunt tasks
  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // Configuration to be run (and then tested).
    docs: {
      'default_options': {
        options: {
          version: version,
          dest: './dest/'
        },

      }
    }
  });
  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');
  // By default, lint and run all tests.
  grunt.registerTask('default', ['docs']);
};
<|endoftext|>


<commit_before>'use strict';

var timeGrunt = require('time-grunt'),
    loadTasks = require('load-grunt-tasks');

var jspaths = {
  server: ['app.js', 'globals.js', 'test/**/*.js', 'lib/**/*.js', '!node_modules/**/*.js', '!build/**/*.js', '!dist/**/*.js'],
  build: ['Gruntfile.js']
};

module.exports = function (grunt) {

  // time grunt
  timeGrunt(grunt);

  grunt.initConfig({
    clean: {
      build: ['build']
    },
    jshint: {
      options: {
        jshintrc: true
      },
      server: jspaths.server,
      build: jspaths.build
    },
    watch: {
      server: {
        files: jspaths.server,
        tasks: ['server:debug']
      },
      build: {
        files: jspaths.build,
        tasks: ['build:debug']
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec'
      },
      unit: {
        src: ['test/specs/**/*.js']
      },
      integration: {
        src: ['test/integration/*.js']
      }
    }
  });

  // load tasks
  loadTasks(grunt);

  grunt.registerTask('build:debug', ['jshint:build']);
  grunt.registerTask('server:debug', ['jshint:server', 'mochaTest:unit', 'mochaTest:integration']);

  grunt.registerTask('debug', ['build:debug', 'server:debug']);

  grunt.registerTask('default', ['debug', 'watch']);
};
<commit_msg>Changed grunt config<commit_after>'use strict';

var timeGrunt = require('time-grunt'),
    loadTasks = require('load-grunt-tasks');

var jspaths = {
  server: ['app.js', 'globals.js', 'test/**/*.js', 'lib/**/*.js', '!node_modules/**/*.js', '!build/**/*.js', '!dist/**/*.js'],
  build: ['Gruntfile.js']
};

module.exports = function (grunt) {

  // time grunt
  timeGrunt(grunt);

  grunt.initConfig({
    clean: {
      build: ['build']
    },
    jshint: {
      options: {
        jshintrc: true
      },
      server: jspaths.server,
      build: jspaths.build
    },
    watch: {
      server: {
        files: jspaths.server,
        tasks: ['server:dev']
      },
      build: {
        files: jspaths.build,
        tasks: ['build:dev']
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec'
      },
      unit: {
        src: ['test/specs/**/*.js']
      },
      release: {
        src: ['test/integration/*.js']
      }
    }
  });

  // load tasks
  loadTasks(grunt);

  grunt.registerTask('build:dev', ['jshint:build']);
  grunt.registerTask('server:dev', ['jshint:server', 'mochaTest:unit']);
  grunt.registerTask('server:release', ['mochaTest:release']);

  grunt.registerTask('dev', ['build:dev', 'server:dev']);
  grunt.registerTask('release', ['dev', 'server:release']);

  grunt.registerTask('default', ['dev', 'watch']);
};
<|endoftext|>


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

  'use strict';

  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

  var path = require('path');
  var config = {

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('bower.json'),

    /**
     * Set some src and dist location variables.
     */
    loc: {
      src: 'src',
      dist: 'dist'
    },

    /**
     * Bower: https://github.com/yatskevich/grunt-bower-task
     *
     * Set up Bower packages and migrate static assets.
     */
    bower: {
      cf: {
        options: {
          targetDir: '<%= loc.src %>/vendor/',
          install: false,
          verbose: true,
          cleanTargetDir: false,
          layout: function(type, component) {
            if (type === 'img') {
              return path.join('../static/img');
            } else if (type === 'fonts') {
              return path.join('../static/fonts');
            } else {
              return path.join(component);
            }
          }
        }
      }
    },

    /**
     * Concat: https://github.com/gruntjs/grunt-contrib-concat
     *
     * Concatenate cf-* Less files prior to compiling them.
     */
    concat: {
      'cf-less': {
        src: [
          '<%= loc.src %>/vendor/cf-*/*.less',
          '!<%= loc.src %>/vendor/cf-core/*.less',
          '<%= loc.src %>/vendor/cf-core/cf-core.less',
        ],
        dest: '<%= loc.src %>/static/css/capital-framework.less',
      },
      js: {
        src: [
          '<%= loc.src %>/vendor/jquery/jquery.js',
          '<%= loc.src %>/vendor/jquery.easing/jquery.easing.js',
          '<%= loc.src %>/vendor/cf-*/*.js',
          '!<%= loc.src %>/vendor/cf-*/Gruntfile.js',
          '<%= loc.src %>/static/js/app.js',
          '<%= loc.src %>/static/js/mustache.min.js'
        ],
        dest: 'js/main.js'
      }
    },

    /**
     * Less: https://github.com/gruntjs/grunt-contrib-less
     *
     * Compile Less files to CSS.
     */
    less: {
      main: {
        options: {
          // The src/vendor paths are needed to find the CF components' files.
          // Feel free to add additional paths to the array passed to `concat`.
          paths: grunt.file.expand('src/vendor/*').concat([])
        },
        files: {
          'css/main.css': ['<%= loc.src %>/static/css/main.less']
        }
      }
    },

    /**
     * Autoprefixer: https://github.com/nDmitry/grunt-autoprefixer
     *
     * Parse CSS and add vendor-prefixed CSS properties using the Can I Use database.
     */
    autoprefixer: {
      options: {
        // Options we might want to enable in the future.
        diff: false,
        map: false
      },
      main: {
        // Prefix `static/css/main.css` and overwrite.
        expand: true,
        src: ['css/main.css']
      },
    },

    /**
     * Uglify: https://github.com/gruntjs/grunt-contrib-uglify
     *
     * Minify JS files.
     * Make sure to add any other JS libraries/files you'll be using.
     * You can exclude files with the ! pattern.
     */
    uglify: {
      options: {
        preserveComments: 'some',
        sourceMap: true
      },
      // headScripts: {
      //   src: 'vendor/html5shiv/html5shiv-printshiv.js',
      //   dest: 'static/js/html5shiv-printshiv.js'
      // },
      js: {
        src: ['js/main.js'],
        dest: 'js/main.min.js'
      }
    },

    /**
     * Banner: https://github.com/mattstyles/grunt-banner
     *
     * Here's a banner with some template variables.
     * We'll be inserting it at the top of minified assets.
     */
    banner:
      '/*!\n' +
      ' *  <%= pkg.name %> - v<%= pkg.version %>\n' +
      ' *  <%= pkg.homepage %>\n' +
      ' *  Licensed <%= pkg.license %> by <%= pkg.author.name %> <<%= pkg.author.email %>>\n' +
      ' */',

    usebanner: {
      css: {
        options: {
          position: 'top',
          banner: '<%= banner %>',
          linebreak: true
        },
        files: {
          src: ['css/*.min.css']
        }
      },
      js: {
        options: {
          position: 'top',
          banner: '<%= banner %>',
          linebreak: true
        },
        files: {
          src: ['js/*.min.js', '!js/mustache.min.js']
        }
      }
    },

    /**
     * CSS Min: https://github.com/gruntjs/grunt-contrib-cssmin
     *
     * Compress CSS files.
     */
    cssmin: {
      main: {
        options: {
          processImport: false
        },
        files: {
          'css/main.min.css': ['css/main.css'],
        }
      },
      'ie-alternate': {
        options: {
          processImport: false
        },
        files: {
          'css/main.ie.min.css': ['css/main.ie.css'],
        }
      }
    },

    /**
     * Legacssy: https://github.com/robinpokorny/grunt-legacssy
     *
     * Fix your CSS for legacy browsers.
     */
    legacssy: {
      'ie-alternate': {
        options: {
          // Flatten all media queries with a min-width over 960 or lower.
          // All media queries over 960 will be excluded fromt he stylesheet.
          // EM calculation: 960 / 16 = 60
          legacyWidth: 60
        },
        files: {
          'css/main.ie.css': 'css/main.css'
        }
      }
    },

    /**
     * Copy: https://github.com/gruntjs/grunt-contrib-copy
     *
     * Copy files and folders.
     */
    copy: {
      main: {
        files: [
          /*{
            expand: true,
            cwd: '<%= loc.src %>',
            src: [
              // HTML files
              '*.html',
            ],
            dest: '<%= loc.dist %>'
          },*/
          {
            expand: true,
            cwd: '<%= loc.src %>/static',
            src: [
              // Fonts
              'fonts/*'
            ],
            dest: ''
          },
          {
            expand: true,
            cwd: '<%= loc.src %>',
            src: [
              // Vendor files
              'vendor/html5shiv/html5shiv-printshiv.min.js',
              'vendor/box-sizing-polyfill/boxsizing.htc'
            ],
            dest: ''
          }
        ]
      }
    },

    /**
     * JSHint: https://github.com/gruntjs/grunt-contrib-jshint
     *
     * Validate files with JSHint.
     * Below are options that conform to idiomatic.js standards.
     * Feel free to add/remove your favorites: http://www.jshint.com/docs/#options
     */
    jshint: {
      options: {
        camelcase: false,
        curly: true,
        forin: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: true,
        sub: true,
        boss: true,
        strict: true,
        evil: true,
        eqnull: true,
        browser: true,
        plusplus: false,
        globals: {
          jQuery: true,
          $: true,
          module: true,
          require: true,
          define: true,
          console: true,
          EventEmitter: true
        }
      },
      all: ['<%= loc.src %>/static/js/app.js']
    },

    /**
     * Watch: https://github.com/gruntjs/grunt-contrib-watch
     *
     * Run predefined tasks whenever watched file patterns are added, changed or deleted.
     * Add files to monitor below.
     */
    watch: {
      default: {
        files: ['Gruntfile.js', '<%= loc.src %>/static/css/**/*.less', '<%= loc.src %>/static/js/**/*.js', 'less/**/*.less', 'less/**/*.css'],
        tasks: ['default']
      }
    }

  };

  /**
   * Initialize a configuration object for the current project.
   */
  grunt.initConfig(config);

  /**
   * Create custom task aliases and combinations.
   */
  grunt.registerTask('compile-cf', ['bower:cf', 'concat:cf-less']);
  grunt.registerTask('css', ['less', 'autoprefixer', 'legacssy', 'cssmin', 'usebanner:css']);
  grunt.registerTask('js', ['concat:js', 'uglify', 'usebanner:js']);
  grunt.registerTask('test', ['jshint']);
  grunt.registerTask('build', ['test', 'css', 'js', 'copy']);
  grunt.registerTask('default', ['build']);

};<commit_msg>removed Gruntfile<commit_after><|endoftext|>


<commit_before>/*!
 * mower's Gruntfile
 * http://www.infinitus.com.cn/
 * Copyright (c) 2014 Infinitus, Inc.
 * Licensed under MIT (https://github.com/macula-projects/mower/blob/master/LICENSE-MIT)
 */

module.exports = function(grunt) {

    'use strict';

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        meta: {
            banner: '/*!\n' +
                ' * <%= 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 %>\n' +
                ' * Licensed under <%= _.pluck(pkg.licenses, "type").join(", ") %> (<%= _.pluck(pkg.licenses, "url").join(", ") %>)\n' +
                ' */\n',
            jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'<%= pkg.name %>\\\'s JavaScript requires jQuery\') }\n\n',
            build_date: '<%= grunt.template.today("yyyymmddHHMMss") %>',
            build_num: process.env.BUILD_NUMBER || 0, // Jenkins build number if available
            version_string: '<%= pkg.version %>-<%= meta.build_num %>'
        },
        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                hostname: 'localhost', // Change this to '0.0.0.0' to access the server from outside.
                livereload: 35729
            },
            all: {
                options: {
                    open: true,
                    base: [
                        'docs/' // This is the base file folder. we suppose our index.html is located in this folder
                    ]
                }
            }
        },
        // Task configuration
        clean: { // clean all
            build: ['dist/**', 'docs/<%= pkg.name %>/**']
        },
        concat: { //files concat
            options: {
                separator: ';'
            },
            buildcss: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    'dist/css/<%= pkg.name %>-modules.css': ['src/css/modules/**/*.css', '!**/*.min.css']
                }
            },
            buildjs: {
                options: {
                    banner: '<%= meta.banner %>\n<%= meta.jqueryCheck %>'
                },
                files: {
                    'dist/js/<%= pkg.name %>.js': [
                        'src/js/base.<%= pkg.name %>.js',
                        'src/js/utils.<%= pkg.name %>.js',
                        'src/js/breadcrumb.<%= pkg.name %>.js',
                        'src/js/datatables.<%= pkg.name %>.js',
                        'src/js/knockout.<%= pkg.name %>.js',
                        'src/js/dropdown.hover.<%= pkg.name %>.js',
                        'src/js/dropdown.<%= pkg.name %>.js',
                        'src/js/magnifier.<%= pkg.name %>.js',
                        'src/js/menu.<%= pkg.name %>.js',
                        'src/js/modal.<%= pkg.name %>.js',
                        'src/js/popover.<%= pkg.name %>.js',
                        'src/js/tab.<%= pkg.name %>.js',
                        'src/js/tooltip.<%= pkg.name %>.js',
                        'src/js/utils.<%= pkg.name %>.js',
                        'src/js/validator.<%= pkg.name %>.js'
                    ]
                }
            },
            mergecss: {
                options: {
                    separator: grunt.util.linefeed
                },
                files: {
                    'dist/css/<%= pkg.name %>.css': [
                        'plugins/font-awesome/css/font-awesome.css',
                        'dist/css/<%= pkg.name %>.css',
                        'plugins/bootstrapValidator/css/bootstrapValidator.css',
                        'plugins/jquery-treetable/css/jquery.treetable.css'
                    ],
                    'dist/css/<%= pkg.name %>.min.css': [
                        'plugins/font-awesome/css/font-awesome.min.css',
                        'dist/css/<%= pkg.name %>.min.css',
                        'plugins/bootstrapValidator/css/bootstrapValidator.min.css',
                        'plugins/jquery-treetable/css/jquery.treetable.min.css'
                    ]
                }
            },
            mergejs: {
                options: {
                    separator: grunt.util.linefeed + ";"
                },
                files: {
                    'dist/js/<%= pkg.name %>.js': [
                        'plugins/bootstrapValidator/js/bootstrapValidator.js',
                        'plugins/bootstrapValidator/js/bootstrapValidator.zh_cn.js',
                        'plugins/datatables/js/jquery.dataTables.js',
                        'plugins/datatables/js/dataTables.bootstrap.js',
                        'plugins/jquery-treetable/js/jquery.treetable.js',
                        'dist/js/<%= pkg.name %>.js'
                    ],
                    'dist/js/<%= pkg.name %>.min.js': [
                        'plugins/bootstrapValidator/js/bootstrapValidator.min.js',
                        'plugins/bootstrapValidator/js/bootstrapValidator.zh_cn.min.js',
                        'plugins/datatables/js/jquery.dataTables.min.js',
                        'plugins/datatables/js/dataTables.bootstrap.min.js',
                        'plugins/jquery-treetable/js/jquery.treetable.min.js',
                        'dist/js/<%= pkg.name %>.min.js'
                    ]
                }
            }
        },
        uglify: { //js compress
            minify: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    'dist/js/<%= pkg.name %>.min.js': ['dist/js/<%= pkg.name %>.js']
                }
            },
            minify_plugins: {
                options: {
                    preserveComments: 'some'
                },
                files: {
                    'plugins/jquery-treetable/js/jquery.treetable.min.js': ['plugins/jquery-treetable/js/jquery.treetable.js'],
                    'plugins/datatables/js/dataTables.bootstrap.min.js': ['plugins/datatables/js/dataTables.bootstrap.js'],
                    'plugins/bootstrapvalidator/js/bootstrapValidator.min.js': ['plugins/bootstrapvalidator/js/bootstrapValidator.js'],
                    'plugins/bootstrapvalidator/js/bootstrapValidator.zh_cn.min.js': ['plugins/bootstrapvalidator/js/bootstrapValidator.zh_cn.js']
                }
            },
        },
        less: { //convert less to css
            buildcore: {
                options: {
                    banner: '<%= meta.banner %>',
                    strictMath: true
                },
                files: {
                    'dist/css/<%= pkg.name %>.css': 'src/css/<%= pkg.name %>.less'
                }
            },
            buildtheme: {
                options: {
                    banner: '<%= meta.banner %>',
                    strictMath: true
                },
                files: {
                    'dist/css/<%= pkg.name %>-theme.css': 'src/css/themes/theme.less'
                }
            }
        },
        cssmin: { //css compress
            minify: {
                expand: true,
                cwd: 'dist/css/',
                src: ['*.css', '!*.min.css'],
                dest: 'dist/css/',
                ext: '.min.css'
            },
            minify_plugins: {
                files: {
                    'plugins/jquery-treetable/css/jquery.treetable.min.css': ['plugins/jquery-treetable/css/jquery.treetable.css'],
                    'plugins/bootstrapvalidator/css/bootstrapValidator.min.css': ['plugins/bootstrapvalidator/css/bootstrapValidator.css']
                }
            },
        },
        compress: {
            build: {
                options: {
                    archive: '<%= pkg.name %>_' + '<%= meta.version_string %>_<%= meta.build_date %>' + '.zip'
                },
                files: [{
                    expand: true,
                    cwd: 'dist/',
                    src: ['**'],
                    dest: 'dist/'
                }]
            }
        },
        copy: { //copy files to dist
            build: {
                files: [{
                    expand: true,
                    cwd: 'plugins/font-awesome/',
                    src: ['fonts/*'],
                    dest: 'dist/'
                }, {
                    expand: true,
                    cwd: 'dist/',
                    src: ['**'],
                    dest: 'docs/<%= pkg.name %>/'
                },{
                    expand: true,
                    cwd: 'plugins/font-awesome/',
                    src: ['fonts/*'],
                    dest: 'docs/<%= pkg.name %>/'
                }]
            }
        },
        jshint: { //file validate,non activated in task
            gruntfile: {
                options: {
                    jshintrc: '.jshintrc'
                },
                src: 'Gruntfile.js'
            },
            src: {
                options: {
                    jshintrc: 'src/js/.jshintrc'
                },
                src: ['src/js/**/*.js']
            }
        },
        watch: { //recompile watching on file change
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            src: {
                files: '<%= jshint.src.src %>',
                tasks: ['jshint:src']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>' // this port must be same with the connect livereload port
                },
                // Watch whatever files you needed.
                files: [
                    'src/css/**/*.less',
                    'src/js/**/*.js'
                ],
                tasks: ['dev']
            }
        },
        bowercopy: {
            options: {
                srcPrefix: 'bower_components'
                //clean: false // default false
            },
            libs: {
                options: {
                    destPrefix: 'libs/'
                },
                files: {
                    'jquery/jquery.js': 'jquery/dist/jquery.js'
                }
            }
        }
    });

    //load grunt plugin task
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-bowercopy');

    // Creates the 'server' task
    grunt.registerTask('server', ['connect:all', 'watch']);

    // grunt dev
    grunt.registerTask('dev', ['clean', 'less', 'concat:buildcss', 'concat:buildjs', 'uglify', 'cssmin', 'concat:mergecss', 'concat:mergejs', 'copy']);

    // grunt release
    grunt.registerTask('release', ['compress', 'clean', 'less', 'concat:buildcss', 'concat:buildjs', 'uglify', 'cssmin', 'concat:mergecss', 'concat:mergejs', 'copy']);

    // grunt
    grunt.registerTask('default', ['dev']);

    //copy bower files to libs or anywhere
    //grunt.registerTask('init', ['bowercopy']);

};<commit_msg>update menu to cmenu and add smenu compatible with menu display.<commit_after>/*!
 * mower's Gruntfile
 * http://www.infinitus.com.cn/
 * Copyright (c) 2014 Infinitus, Inc.
 * Licensed under MIT (https://github.com/macula-projects/mower/blob/master/LICENSE-MIT)
 */

module.exports = function(grunt) {

    'use strict';

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        meta: {
            banner: '/*!\n' +
                ' * <%= 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 %>\n' +
                ' * Licensed under <%= _.pluck(pkg.licenses, "type").join(", ") %> (<%= _.pluck(pkg.licenses, "url").join(", ") %>)\n' +
                ' */\n',
            jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'<%= pkg.name %>\\\'s JavaScript requires jQuery\') }\n\n',
            build_date: '<%= grunt.template.today("yyyymmddHHMMss") %>',
            build_num: process.env.BUILD_NUMBER || 0, // Jenkins build number if available
            version_string: '<%= pkg.version %>-<%= meta.build_num %>'
        },
        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                hostname: 'localhost', // Change this to '0.0.0.0' to access the server from outside.
                livereload: 35729
            },
            all: {
                options: {
                    open: true,
                    base: [
                        'docs/' // This is the base file folder. we suppose our index.html is located in this folder
                    ]
                }
            }
        },
        // Task configuration
        clean: { // clean all
            build: ['dist/**', 'docs/<%= pkg.name %>/**']
        },
        concat: { //files concat
            options: {
                separator: ';'
            },
            buildcss: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    'dist/css/<%= pkg.name %>-modules.css': ['src/css/modules/**/*.css', '!**/*.min.css']
                }
            },
            buildjs: {
                options: {
                    banner: '<%= meta.banner %>\n<%= meta.jqueryCheck %>'
                },
                files: {
                    'dist/js/<%= pkg.name %>.js': [
                        'src/js/base.<%= pkg.name %>.js',
                        'src/js/utils.<%= pkg.name %>.js',
                        'src/js/breadcrumb.<%= pkg.name %>.js',
                        'src/js/datatables.<%= pkg.name %>.js',
                        'src/js/knockout.<%= pkg.name %>.js',
                        'src/js/dropdown.hover.<%= pkg.name %>.js',
                        'src/js/dropdown.<%= pkg.name %>.js',
                        'src/js/magnifier.<%= pkg.name %>.js',
                        'src/js/cmenu.<%= pkg.name %>.js',
                        'src/js/smenu.<%= pkg.name %>.js',
                        'src/js/modal.<%= pkg.name %>.js',
                        'src/js/popover.<%= pkg.name %>.js',
                        'src/js/tab.<%= pkg.name %>.js',
                        'src/js/tooltip.<%= pkg.name %>.js',
                        'src/js/utils.<%= pkg.name %>.js',
                        'src/js/validator.<%= pkg.name %>.js'
                    ]
                }
            },
            mergecss: {
                options: {
                    separator: grunt.util.linefeed
                },
                files: {
                    'dist/css/<%= pkg.name %>.css': [
                        'plugins/font-awesome/css/font-awesome.css',
                        'dist/css/<%= pkg.name %>.css',
                        'plugins/bootstrapValidator/css/bootstrapValidator.css',
                        'plugins/jquery-treetable/css/jquery.treetable.css'
                    ],
                    'dist/css/<%= pkg.name %>.min.css': [
                        'plugins/font-awesome/css/font-awesome.min.css',
                        'dist/css/<%= pkg.name %>.min.css',
                        'plugins/bootstrapValidator/css/bootstrapValidator.min.css',
                        'plugins/jquery-treetable/css/jquery.treetable.min.css'
                    ]
                }
            },
            mergejs: {
                options: {
                    separator: grunt.util.linefeed + ";"
                },
                files: {
                    'dist/js/<%= pkg.name %>.js': [
                        'plugins/bootstrapValidator/js/bootstrapValidator.js',
                        'plugins/bootstrapValidator/js/bootstrapValidator.zh_cn.js',
                        'plugins/datatables/js/jquery.dataTables.js',
                        'plugins/datatables/js/dataTables.bootstrap.js',
                        'plugins/jquery-treetable/js/jquery.treetable.js',
                        'dist/js/<%= pkg.name %>.js'
                    ],
                    'dist/js/<%= pkg.name %>.min.js': [
                        'plugins/bootstrapValidator/js/bootstrapValidator.min.js',
                        'plugins/bootstrapValidator/js/bootstrapValidator.zh_cn.min.js',
                        'plugins/datatables/js/jquery.dataTables.min.js',
                        'plugins/datatables/js/dataTables.bootstrap.min.js',
                        'plugins/jquery-treetable/js/jquery.treetable.min.js',
                        'dist/js/<%= pkg.name %>.min.js'
                    ]
                }
            }
        },
        uglify: { //js compress
            minify: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    'dist/js/<%= pkg.name %>.min.js': ['dist/js/<%= pkg.name %>.js']
                }
            },
            minify_plugins: {
                options: {
                    preserveComments: 'some'
                },
                files: {
                    'plugins/jquery-treetable/js/jquery.treetable.min.js': ['plugins/jquery-treetable/js/jquery.treetable.js'],
                    'plugins/datatables/js/dataTables.bootstrap.min.js': ['plugins/datatables/js/dataTables.bootstrap.js'],
                    'plugins/bootstrapvalidator/js/bootstrapValidator.min.js': ['plugins/bootstrapvalidator/js/bootstrapValidator.js'],
                    'plugins/bootstrapvalidator/js/bootstrapValidator.zh_cn.min.js': ['plugins/bootstrapvalidator/js/bootstrapValidator.zh_cn.js']
                }
            },
        },
        less: { //convert less to css
            buildcore: {
                options: {
                    banner: '<%= meta.banner %>',
                    strictMath: true
                },
                files: {
                    'dist/css/<%= pkg.name %>.css': 'src/css/<%= pkg.name %>.less'
                }
            },
            buildtheme: {
                options: {
                    banner: '<%= meta.banner %>',
                    strictMath: true
                },
                files: {
                    'dist/css/<%= pkg.name %>-theme.css': 'src/css/themes/theme.less'
                }
            }
        },
        cssmin: { //css compress
            minify: {
                expand: true,
                cwd: 'dist/css/',
                src: ['*.css', '!*.min.css'],
                dest: 'dist/css/',
                ext: '.min.css'
            },
            minify_plugins: {
                files: {
                    'plugins/jquery-treetable/css/jquery.treetable.min.css': ['plugins/jquery-treetable/css/jquery.treetable.css'],
                    'plugins/bootstrapvalidator/css/bootstrapValidator.min.css': ['plugins/bootstrapvalidator/css/bootstrapValidator.css']
                }
            },
        },
        compress: {
            build: {
                options: {
                    archive: '<%= pkg.name %>_' + '<%= meta.version_string %>_<%= meta.build_date %>' + '.zip'
                },
                files: [{
                    expand: true,
                    cwd: 'dist/',
                    src: ['**'],
                    dest: 'dist/'
                }]
            }
        },
        copy: { //copy files to dist
            build: {
                files: [{
                    expand: true,
                    cwd: 'plugins/font-awesome/',
                    src: ['fonts/*'],
                    dest: 'dist/'
                }, {
                    expand: true,
                    cwd: 'dist/',
                    src: ['**'],
                    dest: 'docs/<%= pkg.name %>/'
                },{
                    expand: true,
                    cwd: 'plugins/font-awesome/',
                    src: ['fonts/*'],
                    dest: 'docs/<%= pkg.name %>/'
                }]
            }
        },
        jshint: { //file validate,non activated in task
            gruntfile: {
                options: {
                    jshintrc: '.jshintrc'
                },
                src: 'Gruntfile.js'
            },
            src: {
                options: {
                    jshintrc: 'src/js/.jshintrc'
                },
                src: ['src/js/**/*.js']
            }
        },
        watch: { //recompile watching on file change
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            src: {
                files: '<%= jshint.src.src %>',
                tasks: ['jshint:src']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>' // this port must be same with the connect livereload port
                },
                // Watch whatever files you needed.
                files: [
                    'src/css/**/*.less',
                    'src/js/**/*.js'
                ],
                tasks: ['dev']
            }
        },
        bowercopy: {
            options: {
                srcPrefix: 'bower_components'
                //clean: false // default false
            },
            libs: {
                options: {
                    destPrefix: 'libs/'
                },
                files: {
                    'jquery/jquery.js': 'jquery/dist/jquery.js'
                }
            }
        }
    });

    //load grunt plugin task
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-bowercopy');

    // Creates the 'server' task
    grunt.registerTask('server', ['connect:all', 'watch']);

    // grunt dev
    grunt.registerTask('dev', ['clean', 'less', 'concat:buildcss', 'concat:buildjs', 'uglify', 'cssmin', 'concat:mergecss', 'concat:mergejs', 'copy']);

    // grunt release
    grunt.registerTask('release', ['compress', 'clean', 'less', 'concat:buildcss', 'concat:buildjs', 'uglify', 'cssmin', 'concat:mergecss', 'concat:mergejs', 'copy']);

    // grunt
    grunt.registerTask('default', ['dev']);

    //copy bower files to libs or anywhere
    //grunt.registerTask('init', ['bowercopy']);

};<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function (grunt) {

	'use strict';

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

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

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

		pkg: grunt.file.readJSON('package.json'),

		concat: {

			dist: {

				options: {
					banner: '/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
						'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
						'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
						' * Copyright (c) 2012 - <%= grunt.template.today("yyyy") %>' +
						' <%= pkg.author.name %>;' +
						'\n * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n'
				},

				src: [
					'src/intro.js',
					'src/archerTarget.js',
					'src/lib/*.js',
					'src/outro.js'
				],

				dest: 'dist/<%= pkg.name %>.js'

			},

			targets: {

				options: {
					banner: '/*!\n * <%= pkg.title || pkg.name %> -' +
						' Targets - v<%= pkg.version %> - ' +
						'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
						'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
						' * Copyright (c) 2012 - <%= grunt.template.today("yyyy") %>' +
						' <%= pkg.author.name %>;' +
						'\n * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n'
				},

				src: [
					'src/intro.js',
					'src/targets/*.js',
					'src/outro.js'
				],

				dest: 'dist/targets/<%= pkg.name %>.targets.js'

			}

		},

		uglify: {

			dist: {

				files: {
					'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
				},
				options: {
					banner: '/*! <%= pkg.title || pkg.name %> | v<%= pkg.version %>' +
						' | <%= pkg.homepage ? pkg.homepage : "" %>' +
						' | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
						' | Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */ \n',
					sourceMap: 'dist/<%= pkg.name %>.min.map',
					beautify: {
						ascii_only: true
					},
					compress: {
						// don't show any warnings
						warnings: false,
						// DEBUGGER - remove console.log,...
						global_defs: {
							DEVMODE: false
						}
					}
				}
			},

			targets: {
				files: {
					'dist/targets/<%= pkg.name %>.targets.min.js': ['<%= concat.targets.dest %>']
				},
				options: {
					banner: '/*! <%= pkg.title || pkg.name %> - Targets | v<%= pkg.version %>' +
						' | <%= pkg.homepage ? pkg.homepage : "" %>' +
						' | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
						' | Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */ \n',
					sourceMap: 'dist/targets/<%= pkg.name %>.targets.min.map',
					beautify: {
						ascii_only: true
					}
				}
			}

		},

		jshint: {
			options: {
				jshintrc: '.jshintrc',
				reporter: require('jshint-stylish')
			},
			all: {
				src: [
					'<%= concat.dist.dest %>',
					'<%= concat.targets.dest %>',
					'src/plugins/*/*',
					'Gruntfile.js'
				]
			}

		},

		watch: {
			files: '<%= concat.dist.src %>',
			tasks: 'dev'
		}

	});

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

};
<commit_msg>change(Gruntfile.js)<commit_after>/*global module:false*/
module.exports = function (grunt) {

	'use strict';

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

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

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

		pkg: grunt.file.readJSON('package.json'),

		concat: {

			dist: {

				options: {
					banner: '/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
						'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
						'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
						' * Copyright (c) 2012 - <%= grunt.template.today("yyyy") %>' +
						' <%= pkg.author.name %>;' +
						'\n * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n'
				},

				src: [
					'src/intro.js',
					'src/archerTarget.js',
					'src/lib/*.js',
					'src/outro.js',
					'src/RAF.js'
				],

				dest: 'dist/<%= pkg.name %>.js'

			},

			targets: {

				options: {
					banner: '/*!\n * <%= pkg.title || pkg.name %> -' +
						' Targets - v<%= pkg.version %> - ' +
						'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
						'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
						' * Copyright (c) 2012 - <%= grunt.template.today("yyyy") %>' +
						' <%= pkg.author.name %>;' +
						'\n * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n'
				},

				src: [
					'src/intro.js',
					'src/targets/*.js',
					'src/outro.js'
				],

				dest: 'dist/targets/<%= pkg.name %>.targets.js'

			}

		},

		uglify: {

			dist: {

				files: {
					'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
				},
				options: {
					banner: '/*! <%= pkg.title || pkg.name %> | v<%= pkg.version %>' +
						' | <%= pkg.homepage ? pkg.homepage : "" %>' +
						' | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
						' | Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */ \n',
					sourceMap: 'dist/<%= pkg.name %>.min.map',
					beautify: {
						ascii_only: true
					},
					compress: {
						// don't show any warnings
						warnings: false,
						// DEBUGGER - remove console.log,...
						global_defs: {
							DEVMODE: false
						}
					}
				}
			},

			targets: {
				files: {
					'dist/targets/<%= pkg.name %>.targets.min.js': ['<%= concat.targets.dest %>']
				},
				options: {
					banner: '/*! <%= pkg.title || pkg.name %> - Targets | v<%= pkg.version %>' +
						' | <%= pkg.homepage ? pkg.homepage : "" %>' +
						' | (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
						' | Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */ \n',
					sourceMap: 'dist/targets/<%= pkg.name %>.targets.min.map',
					beautify: {
						ascii_only: true
					}
				}
			}

		},

		jshint: {
			options: {
				jshintrc: '.jshintrc',
				reporter: require('jshint-stylish')
			},
			all: {
				src: [
					'<%= concat.dist.dest %>',
					'<%= concat.targets.dest %>',
					'src/plugins/*/*',
					'Gruntfile.js'
				]
			}

		},

		watch: {
			files: '<%= concat.dist.src %>',
			tasks: 'dev'
		}

	});

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

};
<|endoftext|>