<commit_before>module.exports = function(grunt) {
  'use strict';

  var customLaunchers = {
    /*
    'SL_IE8': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '8.0',
      platform: 'windows XP'
    },
    'SL_EDGE': {
      base: 'SauceLabs',
      browserName: 'microsoftedge',
      version: 'latest',
      platform: 'windows 10'
    },
    'SL_SAFARI': {
      base: 'SauceLabs',
      browserName: 'safari',
      version: 'latest',
      platform: 'OS X 10.12'
    },
    */
    'SL_IE9': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '9.0',
      platform: 'windows 7'
    },
    'SL_IE10': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '10.0',
      platform: 'windows 8'
    },
    'SL_IE11': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '11.0',
      platform: 'windows 8.1'
    },
    'SL_CHROME': {
      base: 'SauceLabs',
      browserName: 'chrome',
      version: 'latest',
      platform: 'windows 8'
    },
    'SL_FIREFOX': {
      base: 'SauceLabs',
      browserName: 'firefox',
      version: 'latest',
      platform: 'windows 8'
    }
  };

  grunt.initConfig({
    // package File
    pkg: grunt.file.readJSON('package.json'),

    // bulid source(grunt-build.js).
    build: {
      bs3: {
        input: './src/js/bs3/settings',
        output: './dist/summernote.js'
      },
      bs4: {
        input: './src/js/bs4/settings',
        output: './dist/summernote-bs4.js'
      },
      lite: {
        input: './src/js/lite/settings',
        output: './dist/summernote-lite.js'
      }
    },

    // for javascript convention.
    eslint: {
      target: [
        'src/**/*.js',
        'plugin/**/*.js',
        'lang/**/*.js',
        'Gruntfile.js',
        'test/**/*.js',
        '!coverage/**/*.js',
        '!test/coverage/**/*.js',
        'build/*.js'
      ]
    },

    // uglify: minify javascript
    uglify: {
      options: {
        banner: '/*! Summernote v<%=pkg.version%> | (c) 2013- Alan Hong and other contributors | MIT license */\n'
      },
      all: {
        files: [
          { 'dist/summernote.min.js': ['dist/summernote.js'] },
          { 'dist/summernote-bs4.min.js': ['dist/summernote-bs4.js'] },
          { 'dist/summernote-lite.min.js': ['dist/summernote-lite.js'] },
          {
            expand: true,
            cwd: 'dist/lang',
            src: '**/*.js',
            dest: 'dist/lang',
            ext: '.min.js'
          },
          {
            expand: true,
            cwd: 'dist/plugin',
            src: '**/*.js',
            dest: 'dist/plugin',
            ext: '.min.js'
          }
        ]
      }
    },

    // recess: minify stylesheets
    recess: {
      dist: {
        options: { compile: true, compress: true },
        files: [
          {
            'dist/summernote.css': ['src/less/summernote.less'],
            'dist/summernote-bs4.css': ['src/less/summernote-bs4.less'],
            'dist/summernote-lite.css': ['src/less/summernote-lite.less']

          },
          {
            expand: true,
            cwd: 'dist/plugin',
            src: '**/*.css',
            dest: 'dist/plugin',
            ext: '.min.css'
          }
        ]
      }
    },

    // compress: summernote-{{version}}-dist.zip
    compress: {
      main: {
        options: {
          archive: function() {
            return 'dist/summernote-{{version}}-dist.zip'.replace(
              '{{version}}',
              grunt.config('pkg.version')
            );
          }
        },
        files: [{
          expand: true,
          src: [
            'dist/*.js',
            'dist/*.css',
            'dist/font/*'
          ]
        }, {
          src: ['plugin/**/*.js', 'plugin/**/*.css', 'lang/**/*.js'],
          dest: 'dist/'
        }]
      }
    },

    // connect configuration.
    connect: {
      all: {
        options: {
          port: 3000
        }
      }
    },

    // watch source code change
    watch: {
      less: {
        files: ['src/less/*.less'],
        tasks: ['recess'],
        options: {
          livereload: true
        }
      },
      script: {
        files: ['src/js/**/*.js', 'test/unit/**/*.js'],
        tasks: ['lint', 'build', 'karma:all'],
        options: {
          livereload: true
        }
      }
    },

    karma: {
      options: {
        configFile: './karma.conf.js'
      },
      watch: {
        background: false,
        singleRun: false
      },
      all: {
        // Chrome, ChromeCanary, Firefox, Opera, Safari, PhantomJS, IE
        singleRun: true,
        browsers: ['PhantomJS']
      },
      dist: {
        singleRun: true,
        browsers: ['PhantomJS']
      },
      travis: {
        singleRun: true,
        browsers: ['PhantomJS'],
        reporters: ['dots', 'coverage']
      },
      saucelabs: {
        reporters: ['saucelabs'],
        sauceLabs: {
          testName: 'unit tests for summernote',
          startConnect: false,
          tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
          build: process.env.TRAVIS_BUILD_NUMBER,
          tags: [process.env.TRAVIS_BRANCH, process.env.TRAVIS_PULL_REQUEST]
        },
        captureTimeout: 120000,
        customLaunchers: customLaunchers,
        browsers: Object.keys(customLaunchers),
        singleRun: true
      }
    },

    coveralls: {
      options: {
        force: false
      },
      travis: {
        src: 'coverage/**/lcov.info'
      }
    },
    clean: {
      dist: ['dist/**/*']
    },
    copy: {
      dist: {
        files: [
          { src: 'lang/*', dest: 'dist/' },
          { expand: true, cwd: 'src/icons/dist/font/', src: ['**', '!*.html'], dest: 'dist/font/' }
        ]
      }
    },
    webfont: {
      icons: {
        src: 'src/icons/*.svg',
        dest: 'src/icons/dist/font',
        destCss: 'src/icons/dist/',
        options: {
          font: 'summernote',
          relativeFontPath: './font/',
          stylesheet: 'less',
          template: 'src/icons/templates/summernote.css'
        }
      }
    }
  });

  // load all tasks from the grunt plugins used in this file
  require('load-grunt-tasks')(grunt);

  // load all grunts/*.js
  grunt.loadTasks('grunts');

  // server: run server for development
  grunt.registerTask('server', ['connect', 'watch']);

  // lint
  grunt.registerTask('lint', ['eslint']);

  // test: unit test on test folder
  grunt.registerTask('test', ['lint', 'karma:watch']);

  // test: unit test on travis
  grunt.registerTask('test-travis', ['lint', 'karma:travis']);

  // test: saucelabs test
  grunt.registerTask('saucelabs-test', ['karma:saucelabs']);

  // dist: make dist files
  grunt.registerTask('dist', [
    'clean:dist',
    'build', 'webfont', 'lint', 'karma:dist',
    'copy:dist', 'uglify', 'recess', 'compress'
  ]);

  // default: server
  grunt.registerTask('default', ['server']);
};
<commit_msg>Comment out IE9.<commit_after>module.exports = function(grunt) {
  'use strict';

  var customLaunchers = {
    /*
    'SL_IE8': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '8.0',
      platform: 'windows XP'
    },
    'SL_EDGE': {
      base: 'SauceLabs',
      browserName: 'microsoftedge',
      version: 'latest',
      platform: 'windows 10'
    },
    'SL_SAFARI': {
      base: 'SauceLabs',
      browserName: 'safari',
      version: 'latest',
      platform: 'OS X 10.12'
    },
    'SL_IE9': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '9.0',
      platform: 'windows 7'
    },
    */
    'SL_IE10': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '10.0',
      platform: 'windows 8'
    },
    'SL_IE11': {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '11.0',
      platform: 'windows 8.1'
    },
    'SL_CHROME': {
      base: 'SauceLabs',
      browserName: 'chrome',
      version: 'latest',
      platform: 'windows 8'
    },
    'SL_FIREFOX': {
      base: 'SauceLabs',
      browserName: 'firefox',
      version: 'latest',
      platform: 'windows 8'
    }
  };

  grunt.initConfig({
    // package File
    pkg: grunt.file.readJSON('package.json'),

    // bulid source(grunt-build.js).
    build: {
      bs3: {
        input: './src/js/bs3/settings',
        output: './dist/summernote.js'
      },
      bs4: {
        input: './src/js/bs4/settings',
        output: './dist/summernote-bs4.js'
      },
      lite: {
        input: './src/js/lite/settings',
        output: './dist/summernote-lite.js'
      }
    },

    // for javascript convention.
    eslint: {
      target: [
        'src/**/*.js',
        'plugin/**/*.js',
        'lang/**/*.js',
        'Gruntfile.js',
        'test/**/*.js',
        '!coverage/**/*.js',
        '!test/coverage/**/*.js',
        'build/*.js'
      ]
    },

    // uglify: minify javascript
    uglify: {
      options: {
        banner: '/*! Summernote v<%=pkg.version%> | (c) 2013- Alan Hong and other contributors | MIT license */\n'
      },
      all: {
        files: [
          { 'dist/summernote.min.js': ['dist/summernote.js'] },
          { 'dist/summernote-bs4.min.js': ['dist/summernote-bs4.js'] },
          { 'dist/summernote-lite.min.js': ['dist/summernote-lite.js'] },
          {
            expand: true,
            cwd: 'dist/lang',
            src: '**/*.js',
            dest: 'dist/lang',
            ext: '.min.js'
          },
          {
            expand: true,
            cwd: 'dist/plugin',
            src: '**/*.js',
            dest: 'dist/plugin',
            ext: '.min.js'
          }
        ]
      }
    },

    // recess: minify stylesheets
    recess: {
      dist: {
        options: { compile: true, compress: true },
        files: [
          {
            'dist/summernote.css': ['src/less/summernote.less'],
            'dist/summernote-bs4.css': ['src/less/summernote-bs4.less'],
            'dist/summernote-lite.css': ['src/less/summernote-lite.less']

          },
          {
            expand: true,
            cwd: 'dist/plugin',
            src: '**/*.css',
            dest: 'dist/plugin',
            ext: '.min.css'
          }
        ]
      }
    },

    // compress: summernote-{{version}}-dist.zip
    compress: {
      main: {
        options: {
          archive: function() {
            return 'dist/summernote-{{version}}-dist.zip'.replace(
              '{{version}}',
              grunt.config('pkg.version')
            );
          }
        },
        files: [{
          expand: true,
          src: [
            'dist/*.js',
            'dist/*.css',
            'dist/font/*'
          ]
        }, {
          src: ['plugin/**/*.js', 'plugin/**/*.css', 'lang/**/*.js'],
          dest: 'dist/'
        }]
      }
    },

    // connect configuration.
    connect: {
      all: {
        options: {
          port: 3000
        }
      }
    },

    // watch source code change
    watch: {
      less: {
        files: ['src/less/*.less'],
        tasks: ['recess'],
        options: {
          livereload: true
        }
      },
      script: {
        files: ['src/js/**/*.js', 'test/unit/**/*.js'],
        tasks: ['lint', 'build', 'karma:all'],
        options: {
          livereload: true
        }
      }
    },

    karma: {
      options: {
        configFile: './karma.conf.js'
      },
      watch: {
        background: false,
        singleRun: false
      },
      all: {
        // Chrome, ChromeCanary, Firefox, Opera, Safari, PhantomJS, IE
        singleRun: true,
        browsers: ['PhantomJS']
      },
      dist: {
        singleRun: true,
        browsers: ['PhantomJS']
      },
      travis: {
        singleRun: true,
        browsers: ['PhantomJS'],
        reporters: ['dots', 'coverage']
      },
      saucelabs: {
        reporters: ['saucelabs'],
        sauceLabs: {
          testName: 'unit tests for summernote',
          startConnect: false,
          tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
          build: process.env.TRAVIS_BUILD_NUMBER,
          tags: [process.env.TRAVIS_BRANCH, process.env.TRAVIS_PULL_REQUEST]
        },
        captureTimeout: 120000,
        customLaunchers: customLaunchers,
        browsers: Object.keys(customLaunchers),
        singleRun: true
      }
    },

    coveralls: {
      options: {
        force: false
      },
      travis: {
        src: 'coverage/**/lcov.info'
      }
    },
    clean: {
      dist: ['dist/**/*']
    },
    copy: {
      dist: {
        files: [
          { src: 'lang/*', dest: 'dist/' },
          { expand: true, cwd: 'src/icons/dist/font/', src: ['**', '!*.html'], dest: 'dist/font/' }
        ]
      }
    },
    webfont: {
      icons: {
        src: 'src/icons/*.svg',
        dest: 'src/icons/dist/font',
        destCss: 'src/icons/dist/',
        options: {
          font: 'summernote',
          relativeFontPath: './font/',
          stylesheet: 'less',
          template: 'src/icons/templates/summernote.css'
        }
      }
    }
  });

  // load all tasks from the grunt plugins used in this file
  require('load-grunt-tasks')(grunt);

  // load all grunts/*.js
  grunt.loadTasks('grunts');

  // server: run server for development
  grunt.registerTask('server', ['connect', 'watch']);

  // lint
  grunt.registerTask('lint', ['eslint']);

  // test: unit test on test folder
  grunt.registerTask('test', ['lint', 'karma:watch']);

  // test: unit test on travis
  grunt.registerTask('test-travis', ['lint', 'karma:travis']);

  // test: saucelabs test
  grunt.registerTask('saucelabs-test', ['karma:saucelabs']);

  // dist: make dist files
  grunt.registerTask('dist', [
    'clean:dist',
    'build', 'webfont', 'lint', 'karma:dist',
    'copy:dist', 'uglify', 'recess', 'compress'
  ]);

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


<commit_before>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		banner: [
			'/*!',
			' * Name: <%= pkg.name %> - <%= pkg.description %>',
			' * Version: v<%= pkg.version %>',
			' * Homepage: <%= pkg.homepage %>',
			' * License: <%= pkg.license %>',
			' */\n\n'
		].join('\n'),
		jshint: {
			hint: {
				files: {
					src: [
						'src/scripts/**/*.js',
						'!src/scripts/**/*.min.js'
					]
				}
			}
		},
		clean: {
			options: {
				force: true
			},
			scripts: "dist/**/*.js",
			images: "dist/gh-pages/images/**/*.*",
			html: "dist/gh-pages/**/*.html",
			styles: "dist/gh-pages/styles/**/*.css",
			fonts: "dist/gh-pages/fonts/**/*.*"
		},
		uglify: {
			pageScript: {
				options: {
					banner: '<%= banner %>',
					footer: '\n'
				},
				files: [
					{
						expand: true,
						cwd: 'src/scripts/',
						src: ['**/*.js', '!**/*.min.js'],
						dest: 'dist/gh-pages/scripts/',
						ext: '.min.js',
						extDot: 'last'
					},
					{
						expand: true,
						cwd: 'src/scripts/stickr/',
						src: '**/*.js',
						dest: 'dist/stickr/',
						ext: '.min.js',
						extDot: 'last'
					}
				]
			},
			beautify: {
				options: {
					banner: '<%= banner %>',
					mangle: false,
					compress: false,
					beautify: true,
					preserveComments: true,
					footer: '\n'
				},
				files: [{
					expand: true,
					cwd: 'src/scripts/stickr/',
					src: '**/*.js',
					dest: 'dist/stickr/'
				}]
			}
		},
		'compile-handlebars': {
			index: {
				template: 'src/index.handlebars',
				templateData: [
					'package.json',
					'src/data/index.json'
				],
				output: 'dist/gh-pages/index.html'
			}
		},
		less: {
			style: {
				options: {
					compress: false,
					cleancss: true,
					banner: '<%= banner %>',
					cleancssOptions: {
						keepBreaks: true,
						keepSpecialComments: 1
					}
				},
				files: [{
					expand: true,
					cwd: 'src/styles/',
					src: ['**/*.less', '!**/_*.less'],
					dest: 'dist/gh-pages/styles/',
					ext: '.css',
					extDot: 'last'
				}]
			}
		},
		svgmin: {
			options: {
				plugins: [
					{
						removeViewBox: false
					},
					{
						removeUselessStrokeAndFill: false
					}
				]
			},
			dist: {
				files: [{
					expand: true,
					cwd: 'src/images/',
					src: '**/*.svg',
					dest: 'dist/gh-pages/images/'
				}]
			}
		},
		copy: {
			minimizedJs: {
				expand: true,
				cwd: 'src/scripts/',
				src: '**/*.min.js',
				dest: 'dist/gh-pages/scripts/'
			},
			images: {
				expand: true,
				cwd: 'src/images/',
				src: ['**/*.*', '!**/*.svg'],
				dest: 'dist/gh-pages/images/'
			},
			fonts: {
				expand: true,
				cwd: 'src/fonts/',
				src: '**/*.*',
				dest: 'dist/gh-pages/fonts/'
			},
			rootCfg: {
				expand: true,
				cwd: 'src/',
				src: ['*', '!*.handlebars'],
				dest: 'dist/gh-pages/'
			}
		},
		connect: {
			server: {
				options: {
					port: 9001,
					base: 'dist/gh-pages/'
				}
			}
		},
		watch: {
			options: {
				spawn: false,
			},
			scripts: {
				files: [
					'src/scripts/**/*.js',
					'!src/scripts/**/*.min.js'
				],
				tasks: [
					'jshint',
					'clean:scripts',
					'uglify'
				]
			},
			minimizedJs: {
				files: 'src/scripts/**/*.min.js',
				tasks: 'copy:minimizedJs'
			},
			html: {
				files: 'src/**/*.handlebars',
				tasks: [
					'clean:html',
					'compile-handlebars'
				]
			},
			images: {
				files: 'src/images/**/*.*',
				tasks: [
					'clean:images',
					'copy:images',
					'svgmin'
				]
			},
			fonts: {
				options: {
					spawn: false,
				},
				files: 'src/fonts/**/*.*',
				tasks: [
					'clean:fonts',
					'copy:fonts'
				]
			},
			less: {
				files: 'src/styles/**/*.less',
				tasks: [
					'clean:styles',
					'less'
				]
			},
			rootCfg: {
				files: ['src/*', '!src/*.handlebars'],
				tasks: ['copy:rootCfg']
			},
			grunt: {
				files: 'Gruntfile.js',
				tasks: [
					'jshint',
					'clean',
					'uglify',
					'compile-handlebars',
					'copy',
					'less'
				]
			}
		},
		'gh-pages': {
			options: {
				base: 'dist/gh-pages/',
				message: 'Auto-generated commit:'
			},
			src: '**/*'
		}
	});

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-compile-handlebars');
	grunt.loadNpmTasks('grunt-contrib-less');
	grunt.loadNpmTasks('grunt-svgmin');
	grunt.loadNpmTasks('grunt-gh-pages');

	grunt.registerTask('default', [
		'jshint',
		'clean',
		'uglify',
		'compile-handlebars',
		'copy',
		'svgmin',
		'less'
	]);

	grunt.registerTask('server', [
		'jshint',
		'clean',
		'uglify',
		'compile-handlebars',
		'copy',
		'svgmin',
		'less',
		'connect',
		'watch'
	]);

	grunt.registerTask('pages', [
		'gh-pages'
	]);
};
<commit_msg>*.min.js 파일이 복사되지 않는 문제 수정<commit_after>module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		banner: [
			'/*!',
			' * Name: <%= pkg.name %> - <%= pkg.description %>',
			' * Version: v<%= pkg.version %>',
			' * Homepage: <%= pkg.homepage %>',
			' * License: <%= pkg.license %>',
			' */\n\n'
		].join('\n'),
		jshint: {
			hint: {
				files: {
					src: [
						'src/scripts/**/*.js',
						'!src/scripts/**/*.min.js'
					]
				}
			}
		},
		clean: {
			options: {
				force: true
			},
			scripts: "dist/**/*.js",
			images: "dist/gh-pages/images/**/*.*",
			html: "dist/gh-pages/**/*.html",
			styles: "dist/gh-pages/styles/**/*.css",
			fonts: "dist/gh-pages/fonts/**/*.*"
		},
		uglify: {
			pageScript: {
				options: {
					banner: '<%= banner %>',
					footer: '\n'
				},
				files: [
					{
						expand: true,
						cwd: 'src/scripts/',
						src: ['**/*.js', '!**/*.min.js'],
						dest: 'dist/gh-pages/scripts/',
						ext: '.min.js',
						extDot: 'last'
					},
					{
						expand: true,
						cwd: 'src/scripts/stickr/',
						src: '**/*.js',
						dest: 'dist/stickr/',
						ext: '.min.js',
						extDot: 'last'
					}
				]
			},
			beautify: {
				options: {
					banner: '<%= banner %>',
					mangle: false,
					compress: false,
					beautify: true,
					preserveComments: true,
					footer: '\n'
				},
				files: [{
					expand: true,
					cwd: 'src/scripts/stickr/',
					src: '**/*.js',
					dest: 'dist/stickr/'
				}]
			}
		},
		'compile-handlebars': {
			index: {
				template: 'src/index.handlebars',
				templateData: [
					'package.json',
					'src/data/index.json'
				],
				output: 'dist/gh-pages/index.html'
			}
		},
		less: {
			style: {
				options: {
					compress: false,
					cleancss: true,
					banner: '<%= banner %>',
					cleancssOptions: {
						keepBreaks: true,
						keepSpecialComments: 1
					}
				},
				files: [{
					expand: true,
					cwd: 'src/styles/',
					src: ['**/*.less', '!**/_*.less'],
					dest: 'dist/gh-pages/styles/',
					ext: '.css',
					extDot: 'last'
				}]
			}
		},
		svgmin: {
			options: {
				plugins: [
					{
						removeViewBox: false
					},
					{
						removeUselessStrokeAndFill: false
					}
				]
			},
			dist: {
				files: [{
					expand: true,
					cwd: 'src/images/',
					src: '**/*.svg',
					dest: 'dist/gh-pages/images/'
				}]
			}
		},
		copy: {
			minimizedJs: {
				expand: true,
				cwd: 'src/scripts/',
				src: '**/*.min.js',
				dest: 'dist/gh-pages/scripts/',
				extDot: 'last'
			},
			images: {
				expand: true,
				cwd: 'src/images/',
				src: ['**/*.*', '!**/*.svg'],
				dest: 'dist/gh-pages/images/'
			},
			fonts: {
				expand: true,
				cwd: 'src/fonts/',
				src: '**/*.*',
				dest: 'dist/gh-pages/fonts/'
			},
			rootCfg: {
				expand: true,
				cwd: 'src/',
				src: ['*', '!*.handlebars'],
				dest: 'dist/gh-pages/'
			}
		},
		connect: {
			server: {
				options: {
					port: 9001,
					base: 'dist/gh-pages/'
				}
			}
		},
		watch: {
			options: {
				spawn: false,
			},
			scripts: {
				files: [
					'src/scripts/**/*.js',
					'!src/scripts/**/*.min.js'
				],
				tasks: [
					'jshint',
					'clean:scripts',
					'uglify'
				]
			},
			minimizedJs: {
				files: 'src/scripts/**/*.min.js',
				tasks: 'copy:minimizedJs'
			},
			html: {
				files: 'src/**/*.handlebars',
				tasks: [
					'clean:html',
					'compile-handlebars'
				]
			},
			images: {
				files: 'src/images/**/*.*',
				tasks: [
					'clean:images',
					'copy:images',
					'svgmin'
				]
			},
			fonts: {
				options: {
					spawn: false,
				},
				files: 'src/fonts/**/*.*',
				tasks: [
					'clean:fonts',
					'copy:fonts'
				]
			},
			less: {
				files: 'src/styles/**/*.less',
				tasks: [
					'clean:styles',
					'less'
				]
			},
			rootCfg: {
				files: ['src/*', '!src/*.handlebars'],
				tasks: ['copy:rootCfg']
			},
			grunt: {
				files: 'Gruntfile.js',
				tasks: [
					'jshint',
					'clean',
					'uglify',
					'compile-handlebars',
					'copy',
					'less'
				]
			}
		},
		'gh-pages': {
			options: {
				base: 'dist/gh-pages/',
				message: 'Auto-generated commit:'
			},
			src: '**/*'
		}
	});

	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-compile-handlebars');
	grunt.loadNpmTasks('grunt-contrib-less');
	grunt.loadNpmTasks('grunt-svgmin');
	grunt.loadNpmTasks('grunt-gh-pages');

	grunt.registerTask('default', [
		'jshint',
		'clean',
		'uglify',
		'compile-handlebars',
		'copy',
		'svgmin',
		'less'
	]);

	grunt.registerTask('server', [
		'jshint',
		'clean',
		'uglify',
		'compile-handlebars',
		'copy',
		'svgmin',
		'less',
		'connect',
		'watch'
	]);

	grunt.registerTask('pages', [
		'gh-pages'
	]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

  require('jit-grunt')(grunt, {});

  grunt.loadNpmTasks('grunt-cache-breaker');
  // Define the configuration
  grunt.initConfig({

    // Project settings
    bower: grunt.file.readJSON('bower.json'),

    clean: {
      src: ['dist']
    },

    copy: {
      files: {
        cwd: '.',
        src: [
          'index.html',
          'src/assets/**',
          'src/**/*.html',
          'src/**/**/*.html',
          'env.js',
          'bower_components/angular/angular.min.js',
          'bower_components/angular/angular.min.js.map',                 // Include source-maps
          'bower_components/angular-spinner/angular-spinner.min.js',
          'bower_components/angular-spinner/angular-spinner.min.js.map', // Include source-maps
          'bower_components/bootstrap/dist/css/bootstrap.min.css',
          'bower_components/bootstrap/dist/css/bootstrap.min.css.map',   // Include source-maps
          'bower_components/angular-route/angular-route.min.js',
          'bower_components/angular-route/angular-route.min.js.map',     // Include source-maps
          'bower_components/angular-animate/angular-animate.min.js',
          'bower_components/angular-animate/angular-animate.min.js.map', // Include source-maps
          'bower_components/angular-aria/angular-aria.min.js',
          'bower_components/angular-aria/angular-aria.min.js.map',       // Include source-maps
          'bower_components/angular-material/angular-material.min.css',
          'bower_components/font-awesome/css/font-awesome.min.css',
          'bower_components/font-awesome/fonts/**',
          'bower_components/ace-builds/src-min-noconflict/ace.js',
          'bower_components/ace-builds/src-min-noconflict/ext*.js',
          'bower_components/ace-builds/src-min-noconflict/mode-json.js',
          'bower_components/ace-builds/src-min-noconflict/mode-batchfile.js',
          'bower_components/ace-builds/src-min-noconflict/theme-chrome.js',
          'bower_components/ace-builds/src-min-noconflict/worker-json.js',
          'bower_components/angular-ui-ace/ui-ace.min.js',
          'bower_components/spin.js/spin.min.js',
          'bower_components/angular-material/angular-material.min.js',
          'bower_components/angular-material-data-table/dist/md-data-table.min.css',
          'bower_components/angular-material-data-table/dist/md-data-table.min.js',
          'bower_components/angular-diff-match-patch/angular-diff-match-patch.js',
          'bower_components/ace-diff/libs/diff_match_patch.js',
          'bower_components/angular-json-tree/dist/angular-json-tree.min.js',
          'bower_components/angular-json-tree/dist/angular-json-tree.css'
        ],
        dest: 'dist',
        expand: true
      }
    },

    concat: {
      dist: {
        src: ['src/*.js', 'src/factories/*.js', 'src/**/*.controller.js', 'src/**/**/*.controller.js'],
        dest: 'dist/combined.js'
      }
    },

    cachebreaker: {
          js: {
              options: {
                  match: ['combined.js'],
                  replacement: 'md5',
                  src: {
                      path: 'dist/combined.js'
                  }
              },
              files: {
                  src: ['dist/index.html']
              }
          }
      },

    usemin: {
      html: ['dist/index.html']
    }

  });

  grunt.registerTask('default', [
    'clean',
    'copy',
    'concat',
    'usemin',
    'cachebreaker'
  ]);
};
<commit_msg>gruntfile<commit_after>'use strict';

module.exports = function (grunt) {

  require('jit-grunt')(grunt, {});

  grunt.loadNpmTasks('grunt-cache-breaker');
  // Define the configuration
  grunt.initConfig({

    // Project settings
    bower: grunt.file.readJSON('bower.json'),

    clean: {
      src: ['dist']
    },

    copy: {
      files: {
        cwd: '.',
        src: [
          'index.html',
          'src/assets/**',
          'src/**/*.html',
          'src/**/**/*.html',
          'env.js',
          'bower_components/angular/angular.min.js',
          'bower_components/angular/angular.min.js.map',                 // Include source-maps
          'bower_components/angular-spinner/angular-spinner.min.js',
          'bower_components/angular-spinner/angular-spinner.min.js.map', // Include source-maps
          'bower_components/bootstrap/dist/css/bootstrap.min.css',
          'bower_components/bootstrap/dist/css/bootstrap.min.css.map',   // Include source-maps
          'bower_components/angular-route/angular-route.min.js',
          'bower_components/angular-route/angular-route.min.js.map',     // Include source-maps
          'bower_components/angular-animate/angular-animate.min.js',
          'bower_components/angular-animate/angular-animate.min.js.map', // Include source-maps
          'bower_components/angular-aria/angular-aria.min.js',
          'bower_components/angular-aria/angular-aria.min.js.map',       // Include source-maps
          'bower_components/angular-material/angular-material.min.css',
          'bower_components/font-awesome/css/font-awesome.min.css',
          'bower_components/font-awesome/fonts/**',
          'bower_components/ace-builds/src-min-noconflict/ace.js',
          'bower_components/ace-builds/src-min-noconflict/ext*.js',
          'bower_components/ace-builds/src-min-noconflict/mode-json.js',
          'bower_components/ace-builds/src-min-noconflict/mode-batchfile.js',
          'bower_components/ace-builds/src-min-noconflict/theme-chrome.js',
          'bower_components/ace-builds/src-min-noconflict/worker-json.js',
          'bower_components/angular-ui-ace/ui-ace.min.js',
          'bower_components/spin.js/spin.min.js',
          'bower_components/angular-material/angular-material.min.js',
          'bower_components/angular-sanitize/angular-sanitize.min.js',
          'bower_components/angular-material-data-table/dist/md-data-table.min.css',
          'bower_components/angular-material-data-table/dist/md-data-table.min.js',
          'bower_components/angular-diff-match-patch/angular-diff-match-patch.js',
          'bower_components/ace-diff/libs/diff_match_patch.js',
          'bower_components/angular-json-tree/dist/angular-json-tree.min.js',
          'bower_components/angular-json-tree/dist/angular-json-tree.css',
          'bower_components/jszip/dist/jszip.min.js',
          'bower_components/jszip/vendor/FileSaver.js',
          'bower_components/jszip-utils/dist/jszip-utils.min.js'
        ],
        dest: 'dist',
        expand: true
      }
    },

    concat: {
      dist: {
        src: ['src/*.js', 'src/factories/*.js', 'src/**/*.controller.js', 'src/**/**/*.controller.js'],
        dest: 'dist/combined.js'
      }
    },

    cachebreaker: {
          js: {
              options: {
                  match: ['combined.js'],
                  replacement: 'md5',
                  src: {
                      path: 'dist/combined.js'
                  }
              },
              files: {
                  src: ['dist/index.html']
              }
          }
      },

    usemin: {
      html: ['dist/index.html']
    }

  });

  grunt.registerTask('default', [
    'clean',
    'copy',
    'concat',
    'usemin',
    'cachebreaker'
  ]);
};
<|endoftext|>


<commit_before>var request = require('request');

var safari_browsers = [
		{
			browserName: 'safari',
			platform: 'OS X 10.10',
			version: '8.0'
		}
	],
	chrome_browsers = [
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '42.0'
		},
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '41.0'
		},
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '40.0'
		}
	],

	firefox_browsers = [
		{
			browserName: 'firefox',
			platform: 'OS X 10.10',
			version: '40.0'
		},
		{
			browserName: 'firefox',
			platform: 'OS X 10.10',
			version: '39.0'
		}
	],

	ios_browsers = [
		{
			browserName: 'iphone',
			deviceName: 'iPhone Simulator',
			deviceOrientation: 'portrait',
			platform: 'OS X 10.10',
			version: '8.4'
		},
		{
			browserName: 'iphone',
			deviceName: 'iPhone Simulator',
			deviceOrientation: 'portrait',
			platform: 'OS X 10.10',
			version: '8.3'
		}
	],

	android_browsers = [
		{
			browserName: 'android',
			platform: 'Linux',
			version: '5.1'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '5.0'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.4'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.3'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.2'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.1'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.0'
		}
	],

	ie_browsers = [
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '11.0'
		},
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '10.0'
		},
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '9.0'
		}
	];

module.exports = function(grunt) {
	grunt.initConfig({
		'saucelabs-mocha': {
			all: {
				options: {
					username: 'branchmetrics',
					urls: [
						'http://0.0.0.0:9999/test/test.html',
						'http://0.0.0.0:9999/test/integration-test.html'
					],
					maxRetries: 3,
					testname: 'Web SDK Tests',
					browsers: safari_browsers.concat(chrome_browsers,
						firefox_browsers,
						// ios_browsers,
						android_browsers,
						ie_browsers)
				}
			},
			options: {
				force: true
			}
		},
		connect: {
			server: {
				options: {
					port: 9999,
					base: ''
				}
			}
		}
	});

	// Loading dependencies
	for (var key in grunt.file.readJSON("package.json").devDependencies) {
		if (key !== "grunt" && key.indexOf("grunt") === 0) {
			grunt.loadNpmTasks(key);
		}
	}

	grunt.loadNpmTasks('grunt-saucelabs');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.registerTask('test', ['connect', 'saucelabs-mocha']);
};
<commit_msg>bring back ios tests<commit_after>var request = require('request');

var safari_browsers = [
		{
			browserName: 'safari',
			platform: 'OS X 10.10',
			version: '8.0'
		}
	],
	chrome_browsers = [
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '42.0'
		},
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '41.0'
		},
		{
			browserName: 'chrome',
			platform: 'OS X 10.10',
			version: '40.0'
		}
	],

	firefox_browsers = [
		{
			browserName: 'firefox',
			platform: 'OS X 10.10',
			version: '40.0'
		},
		{
			browserName: 'firefox',
			platform: 'OS X 10.10',
			version: '39.0'
		}
	],

	ios_browsers = [
		{
			browserName: 'iphone',
			deviceName: 'iPhone Simulator',
			deviceOrientation: 'portrait',
			platform: 'OS X 10.10',
			version: '8.4'
		},
		{
			browserName: 'iphone',
			deviceName: 'iPhone Simulator',
			deviceOrientation: 'portrait',
			platform: 'OS X 10.10',
			version: '8.3'
		}
	],

	android_browsers = [
		{
			browserName: 'android',
			platform: 'Linux',
			version: '5.1'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '5.0'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.4'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.3'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.2'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.1'
		},
		{
			browserName: 'android',
			platform: 'Linux',
			version: '4.0'
		}
	],

	ie_browsers = [
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '11.0'
		},
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '10.0'
		},
		{
			browserName: 'internet explorer',
			platform: 'Windows 7',
			version: '9.0'
		}
	];

module.exports = function(grunt) {
	grunt.initConfig({
		'saucelabs-mocha': {
			all: {
				options: {
					username: 'branchmetrics',
					urls: [
						'http://0.0.0.0:9999/test/test.html',
						'http://0.0.0.0:9999/test/integration-test.html'
					],
					maxRetries: 3,
					testname: 'Web SDK Tests',
					browsers: safari_browsers.concat(chrome_browsers,
						firefox_browsers,
						ios_browsers,
						android_browsers,
						ie_browsers)
				}
			},
			options: {
				force: true
			}
		},
		connect: {
			server: {
				options: {
					port: 9999,
					base: ''
				}
			}
		}
	});

	// Loading dependencies
	for (var key in grunt.file.readJSON("package.json").devDependencies) {
		if (key !== "grunt" && key.indexOf("grunt") === 0) {
			grunt.loadNpmTasks(key);
		}
	}

	grunt.loadNpmTasks('grunt-saucelabs');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.registerTask('test', ['connect', 'saucelabs-mocha']);
};
<|endoftext|>


<commit_before>/**
 * Grunt Powered HTML Framework
 * http://hellostew.com
 * @author Stewart Dellow
**/

'use strict';

module.exports = function(grunt){

    // Set the environment depending on the task name
    grunt.config('env', (grunt.cli.tasks == 'production') ? 'production' : 'development');

    /**
     * grunt.initConfig
     * Grunt config.
    **/
    grunt.initConfig({
        /**
         * Load external files.
        **/
        pkg : grunt.file.readJSON('package.json'),
        auth: grunt.file.readJSON('auth.json'),

        /**
         * vars
         * Variables.
        **/
        vars: {
            paths: {
                basePath : '/',
                jsPath   : 'dist/js',
                imgPath  : 'dist/images',
                cssPath  : 'dist/css',
                fontsPath: 'dist/css/fonts'
            },
            deploy: {
                releaseDir: (new Date()).toISOString(),
                config    : grunt.option('config')
            },
            compass: {
                sourcemap  : (grunt.config('env') == 'development') ? true : false,
                outputStyle: (grunt.config('env') == 'development') ? 'expanded' : 'compressed', // expanded, nested, compact or compressed
                environment: (grunt.config('env') == 'development') ? 'development' : 'production'
            },
            requireJS: {
                optimize: (grunt.config('env') == 'development') ? 'none' : 'uglify'
            }
        },

        /**
         * requirejs
         * RequireJS loader and minfier.
        **/
        requirejs : {
            compile: {
                options: {
                    baseUrl       : '',
                    name          : '<%= vars.paths.jsPath %>/main',
                    excludeShallow: ['<%= vars.paths.jsPath %>/main'], // We don't want the main config file included in the build but we do want what it requires.
                    out           : '<%= vars.paths.jsPath %>/build/build.js',
                    optimize      : '<%= vars.requireJS.optimize %>',
                    wrap: {
                        start: '"use strict"\ ;\n'
                    },
                    paths: {
                        // Libraries
                        angular       : 'node_modules/angular/lib/angular.min',
                        backbone      : 'node_modules/backbone/backbone',
                        jquery        : 'node_modules/jquery/dist/jquery',
                        jqueryui      : 'node_modules/jquery-ui/jquery-ui',
                        // RequireJS Modules
                        req_async     : '<%= vars.paths.jsPath %>/vendor/require/require.async',
                        // Plugins
                        extensions    : '<%= vars.paths.jsPath %>/plugins/jquery.extensions',
                        formValidation: '<%= vars.paths.jsPath %>/plugins/jquery.form-validation',
                        lightBox      : '<%= vars.paths.jsPath %>/plugins/jquery.lightBox',
                        scrollto      : '<%= vars.paths.jsPath %>/plugins/jquery.scrollto.min',
                        slider        : '<%= vars.paths.jsPath %>/plugins/jquery.bxslider.min',
                        // Local
                        helper        : '<%= vars.paths.jsPath %>/helpers/helper',
                        ui            : '<%= vars.paths.jsPath %>/helpers/ui',
                        // Functions
                        site          : '<%= vars.paths.jsPath %>/app/site'
                    },
                    shim: {
                        ui: {
                            deps: ['jquery']
                        },
                        extensions: {
                            deps: ['jquery']
                        },
                        formValidation: {
                            deps: ['jquery']
                        },
                        lightBox: {
                            deps: ['jquery']
                        },
                        scrollto: {
                            deps: ['jquery']
                        },
                        slider: {
                            deps: ['jquery']
                        },
                        // Setup site
                        site: {
                            deps: ['helper', 'ui', 'extensions']
                        }
                    }
                }
            }
        },

        /**
         * qunit
         * jQuery testing.
        **/
        qunit: {
            all: ['tests/**.html']
        },

        /**
         * compass
         * SASS & Compass.
        **/
        compass: {
            dist: {
                options: {
                    app             : 'stand_alone',
                    httpPath        : '/',
                    importPath      : [],
                    sassDir         : '<%= vars.paths.cssPath %>/scss',
                    cssDir          : '<%= vars.paths.cssPath %>',
                    imagesDir       : '<%= vars.paths.imgPath %>',
                    javascriptsDir  : '<%= vars.paths.jsPath %>/',
                    fontsDir        : '<%= vars.paths.fontsPath %>',
                    outputStyle     : '<%= vars.compass.outputStyle %>',
                    environment     : '<%= vars.compass.environment %>',
                    //sourcemap       : '<%= vars.compass.sourcemap %>',
                    raw             : 'preferred_syntax = :scss\n',
                    force           : true,
                    relativeAssets  : true,
                    noLineComments  : true,
                    assetCacheBuster: false
                }
            }
        },

        /**
         * watch
         * Watch for changes to specific files.
        **/
        watch: {
            scripts: {
                files: [
                    '<%= vars.paths.jsPath %>/*.js',
                    '<%= vars.paths.jsPath %>/**/*.js',
                ],
                tasks: [
                    'requirejs',
                    'qunit'
                ],
                options: {
                    livereload: true
                }
            },
            compass: {
                files: [
                    '<%= vars.paths.cssPath %>/*.scss',
                    '<%= vars.paths.cssPath %>/**/*.scss'
                ],
                tasks: [
                    'compass'
                ],
                options: {
                    livereload: true
                }
            }
        },

        /**
         * sshexec
         * Deployment with Grunt.
        **/
        sshconfig: {
            production: {
                // Server host
                host        : '<%= auth.host %>',
                // Server username
                username    : '<%= auth.user %>',
                // Server password
                password    : '<%= auth.pass %>',
                // SSH agent
                //agent       : process.env.SSH_AUTH_SOCK,
                // Deployment path
                path        : '<%= auth.path %>/current',
                // Port
                port        : 22,
                // Timeout
                readyTimeout: 99999
            }
        },
        sftp: {
            deploy: {
                files: {
                    './': [
                        '.htaccess',
                        '*html',
                        '*php',
                        'dist/**'
                    ]
                },
                options: {
                    showProgress        : true,
                    createDirectories   : true,
                    directoryPermissions: parseInt(755, 8)
                }
            }
        },
        sshexec: {
            'make-release': {
                command: [
                    'sudo mkdir -p <%= auth.path %>/releases/<%= vars.deploy.releaseDir %>',
                    'sudo touch <%= auth.path %>/release_list',
                    'sudo echo "<%= vars.deploy.releaseDir %>" >> <%= auth.path %>/release_list'
                ]
            },
            'do-symlinks': {
                command: [
                    'rm -rf <%= auth.path %>/current',
                    'ln -s <%= auth.path %>/releases/<%= vars.deploy.releaseDir %> <%= auth.path %>/current'
                ]
            },
            'permissions': {
                command: [
                    'sudo chown -R $USER:www-data <%= auth.path %>',
                    'sudo chmod -R 755 <%= auth.path %>'
                ]
            },
            'rollback': {
                command: [
                    'rm -rf <%= auth.path %>/current',
                    'ln -s <%= auth.path %>/releases/`tail -2 <%= auth.path %>/release_list | head -1` <%= auth.path %>/current'
                ]
            }
        }

    });

    /**
     * Load tasks using matchdep.
    **/
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    /**
     * Register tasks.
    **/
    // Task   : Default
    // Command: `grunt`
    grunt.registerTask('default', [
        'compass',
        'requirejs',
        'qunit'
    ]);

    // Task   : Production
    // Command: `grunt production`
    grunt.registerTask('production', [
        'compass',
        'requirejs'
    ]);

    // Task   : Deployment
    // Command: `grunt deploy --config <site>`
    grunt.registerTask('deploy', [
        'sshexec:make-release',
        'sshexec:do-symlinks',
        'sftp:deploy',
        'sshexec:permissions',
    ]);

    // Task   : Rollback
    // Command: `grunt rollback --config <site>`
    grunt.registerTask('rollback', [
        'sshexec:rollback'
    ]);

}<commit_msg>Doc changes<commit_after>/**
 * Grunt Powered HTML Framework
 * http://hellostew.com
 * @author Stewart Dellow
**/

'use strict';

module.exports = function(grunt){

    // Set the environment depending on the task name
    grunt.config('env', (grunt.cli.tasks == 'production') ? 'production' : 'development');

    /**
     * grunt.initConfig
     * Grunt config.
    **/
    grunt.initConfig({
        /**
         * Load external files.
        **/
        pkg : grunt.file.readJSON('package.json'),
        auth: grunt.file.readJSON('auth.json'),

        /**
         * vars
         * Variables.
        **/
        vars: {
            paths: {
                basePath : '/',
                jsPath   : 'dist/js',
                imgPath  : 'dist/images',
                cssPath  : 'dist/css',
                fontsPath: 'dist/css/fonts'
            },
            deploy: {
                releaseDir: (new Date()).toISOString(),
                config    : grunt.option('config')
            },
            compass: {
                sourcemap  : (grunt.config('env') == 'development') ? true : false,
                outputStyle: (grunt.config('env') == 'development') ? 'expanded' : 'compressed', // expanded, nested, compact or compressed
                environment: (grunt.config('env') == 'development') ? 'development' : 'production'
            },
            requireJS: {
                optimize: (grunt.config('env') == 'development') ? 'none' : 'uglify'
            }
        },

        /**
         * requirejs
         * RequireJS loader and minfier.
        **/
        requirejs : {
            compile: {
                options: {
                    baseUrl       : '',
                    name          : '<%= vars.paths.jsPath %>/main',
                    excludeShallow: ['<%= vars.paths.jsPath %>/main'], // We don't want the main config file included in the build but we do want what it requires.
                    out           : '<%= vars.paths.jsPath %>/build/build.js',
                    optimize      : '<%= vars.requireJS.optimize %>',
                    wrap: {
                        start: '"use strict"\ ;\n'
                    },
                    paths: {
                        // Libraries
                        angular       : 'node_modules/angular/lib/angular.min',
                        backbone      : 'node_modules/backbone/backbone',
                        jquery        : 'node_modules/jquery/dist/jquery',
                        jqueryui      : 'node_modules/jquery-ui/jquery-ui',
                        // RequireJS Modules
                        req_async     : '<%= vars.paths.jsPath %>/vendor/require/require.async',
                        // Plugins
                        extensions    : '<%= vars.paths.jsPath %>/plugins/jquery.extensions',
                        formValidation: '<%= vars.paths.jsPath %>/plugins/jquery.form-validation',
                        lightBox      : '<%= vars.paths.jsPath %>/plugins/jquery.lightBox',
                        scrollto      : '<%= vars.paths.jsPath %>/plugins/jquery.scrollto.min',
                        slider        : '<%= vars.paths.jsPath %>/plugins/jquery.bxslider.min',
                        // Local
                        helper        : '<%= vars.paths.jsPath %>/helpers/helper',
                        ui            : '<%= vars.paths.jsPath %>/helpers/ui',
                        // App
                        site          : '<%= vars.paths.jsPath %>/app/site'
                    },
                    shim: {
                        ui: {
                            deps: ['jquery']
                        },
                        extensions: {
                            deps: ['jquery']
                        },
                        formValidation: {
                            deps: ['jquery']
                        },
                        lightBox: {
                            deps: ['jquery']
                        },
                        scrollto: {
                            deps: ['jquery']
                        },
                        slider: {
                            deps: ['jquery']
                        },
                        // Setup site
                        site: {
                            deps: ['helper', 'ui', 'extensions']
                        }
                    }
                }
            }
        },

        /**
         * qunit
         * jQuery testing.
        **/
        qunit: {
            all: ['tests/**.html']
        },

        /**
         * compass
         * SASS & Compass.
        **/
        compass: {
            dist: {
                options: {
                    app             : 'stand_alone',
                    httpPath        : '/',
                    importPath      : [],
                    sassDir         : '<%= vars.paths.cssPath %>/scss',
                    cssDir          : '<%= vars.paths.cssPath %>',
                    imagesDir       : '<%= vars.paths.imgPath %>',
                    javascriptsDir  : '<%= vars.paths.jsPath %>/',
                    fontsDir        : '<%= vars.paths.fontsPath %>',
                    outputStyle     : '<%= vars.compass.outputStyle %>',
                    environment     : '<%= vars.compass.environment %>',
                    //sourcemap       : '<%= vars.compass.sourcemap %>',
                    raw             : 'preferred_syntax = :scss\n',
                    force           : true,
                    relativeAssets  : true,
                    noLineComments  : true,
                    assetCacheBuster: false
                }
            }
        },

        /**
         * watch
         * Watch for changes to specific files.
        **/
        watch: {
            scripts: {
                files: [
                    '<%= vars.paths.jsPath %>/*.js',
                    '<%= vars.paths.jsPath %>/**/*.js',
                ],
                tasks: [
                    'requirejs',
                    'qunit'
                ],
                options: {
                    livereload: true
                }
            },
            compass: {
                files: [
                    '<%= vars.paths.cssPath %>/*.scss',
                    '<%= vars.paths.cssPath %>/**/*.scss'
                ],
                tasks: [
                    'compass'
                ],
                options: {
                    livereload: true
                }
            }
        },

        /**
         * sshexec
         * Deployment with Grunt.
        **/
        sshconfig: {
            production: {
                // Server host
                host        : '<%= auth.host %>',
                // Server username
                username    : '<%= auth.user %>',
                // Server password
                password    : '<%= auth.pass %>',
                // SSH agent
                //agent       : process.env.SSH_AUTH_SOCK,
                // Deployment path
                path        : '<%= auth.path %>/current',
                // Port
                port        : 22,
                // Timeout
                readyTimeout: 99999
            }
        },
        sftp: {
            deploy: {
                files: {
                    './': [
                        '.htaccess',
                        '*html',
                        '*php',
                        'dist/**'
                    ]
                },
                options: {
                    showProgress        : true,
                    createDirectories   : true,
                    directoryPermissions: parseInt(755, 8)
                }
            }
        },
        sshexec: {
            'make-release': {
                command: [
                    'sudo mkdir -p <%= auth.path %>/releases/<%= vars.deploy.releaseDir %>',
                    'sudo touch <%= auth.path %>/release_list',
                    'sudo echo "<%= vars.deploy.releaseDir %>" >> <%= auth.path %>/release_list'
                ]
            },
            'do-symlinks': {
                command: [
                    'rm -rf <%= auth.path %>/current',
                    'ln -s <%= auth.path %>/releases/<%= vars.deploy.releaseDir %> <%= auth.path %>/current'
                ]
            },
            'permissions': {
                command: [
                    'sudo chown -R $USER:www-data <%= auth.path %>',
                    'sudo chmod -R 755 <%= auth.path %>'
                ]
            },
            'rollback': {
                command: [
                    'rm -rf <%= auth.path %>/current',
                    'ln -s <%= auth.path %>/releases/`tail -2 <%= auth.path %>/release_list | head -1` <%= auth.path %>/current'
                ]
            }
        }

    });

    /**
     * Load tasks using matchdep.
    **/
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    /**
     * Register tasks.
    **/
    // Task   : Default
    // Command: `grunt`
    grunt.registerTask('default', [
        'compass',
        'requirejs',
        'qunit'
    ]);

    // Task   : Production
    // Command: `grunt production`
    grunt.registerTask('production', [
        'compass',
        'requirejs'
    ]);

    // Task   : Deployment
    // Command: `grunt deploy --config <site>`
    grunt.registerTask('deploy', [
        'sshexec:make-release',
        'sshexec:do-symlinks',
        'sftp:deploy',
        'sshexec:permissions',
    ]);

    // Task   : Rollback
    // Command: `grunt rollback --config <site>`
    grunt.registerTask('rollback', [
        'sshexec:rollback'
    ]);

}<|endoftext|>


<commit_before>// Generated on 2014-02-20 using generator-angular 0.7.1
'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);

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

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

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['yeoman'],
				commit: true,
				commitMessage: 'chore(release): release v%VERSION%. See CHANGELOG.md',
				commitFiles: ['-a'], // '-a' for all files
				createTag: true,
				tagName: 'v%VERSION%',
				tagMessage: 'Version %VERSION%',
				push: true,
				pushTo: 'origin master',
				gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
			}
		},

		conventionalChangelog: {
			options: {
				changelogOpts: {
					preset: 'angular'
				}
			},
			release: {
				src: 'CHANGELOG.md'
			}
		},

		// Watches files for changes and runs tasks based on the changed files
		watch: {
			js: {
				files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
				tasks: ['newer:jshint:all', 'karma:headless'],
				options: {
					livereload: true
				}
			},
			jsTest: {
				files: ['test/spec/{,*/}*.js'],
				tasks: ['newer:jshint:test', 'karma:headless']
			},
			gruntfile: {
				files: ['Gruntfile.js']
			},
			livereload: {
				options: {
					livereload: '<%= connect.options.livereload %>'
				},
				files: [
					'<%= yeoman.app %>/{,*/}*.html'
				]
			}
		},

		// The actual grunt server settings
		connect: {
			options: {
				port: 0,
				// Change this to '0.0.0.0' to access the server from outside.
				hostname: 'localhost',
				livereload: 35729
			},
			test: {
				options: {
					port: 0,
					base: [
						'test',
						'<%= yeoman.app %>'
					]
				}
			},
			livereload: {
				options: {
					open: true,
					base: [
						'<%= yeoman.app %>'
					]
				}
			}
		},

		// Make sure code styles are up to par and there are no obvious mistakes
		jshint: {
			options: {
				jshintrc: '.jshintrc',
				reporter: require('jshint-stylish')
			},
			all: [
				'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: [
						'<%= yeoman.dist %>/*',
						'!<%= yeoman.dist %>/.git*'
					]
				}]
			}
		},

		// Allow the use of non-minsafe AngularJS files. Automatically makes it
		// minsafe compatible so Uglify does not destroy the ng references
		ngAnnotate: {
			dist: {
				src: ['<%= yeoman.dist %>/angular-apimock.js'],
				dest: '<%= yeoman.dist %>/angular-apimock.js'
			}
		},

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

		uglify: {
			options: {
				preserveComments: 'some',
				report: 'gzip'
			},
			dist: {
				files: {
					'<%= yeoman.dist %>/angular-apimock.min.js': [
						'<%= yeoman.dist %>/angular-apimock.js'
					]
				}
			}
		},

		concat: {
			options: {
				banner: '/*! Angular API Mock v<%= yeoman.version %>\n * Licensed with MIT\n * Made with ♥ from Seriema + Redhorn */\n',
			},
			dist: {
				src: '<%= yeoman.app %>/scripts/**/*.js',
				dest: '<%= yeoman.dist %>/angular-apimock.js'
			}
		},

		nugetpack: {
			dist: {
				src: 'package.nuspec',
				dest: 'nuget/',
				options: {
					version: '<%= yeoman.version %>'
				}
			}
		},

		nugetpush: {
			dist: {
				src: 'nuget/Angular-ApiMock.<%= yeoman.version %>.nupkg'
			}
		},

		// Test settings
		karma: {
			options: {
				configFile: 'karma.conf.js',
				singleRun: true
			},
			headless: {
				browsers: ['PhantomJS'],
				reporters: [ 'dots', 'coverage' ],
				coverageReporter: {
					reporters: [
						{ type: 'lcov', subdir: 'PhantomJS' },
						{ type: 'text' }
					]
				}
			},
			angular12: {
				files: [{
					src: [
						'test/ref/angular-v1.2.js',
						'test/ref/angular-mocks-v1.2.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			},
			angular13: {
				files: [{
					src: [
						'test/ref/angular-v1.3.js',
						'test/ref/angular-mocks-v1.3.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			},
			angular14: {
				files: [{
					src: [
						'test/ref/angular-v1.4.js',
						'test/ref/angular-mocks-v1.4.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			}
		},

		// To run locally you need to set `COVERALLS_REPO_TOKEN` as an environment variable.
		coveralls: {
			options: {
				force: true,
			},
			src: 'coverage/**/*.info',
		},
	});

	grunt.registerTask('serve', [
		'connect',
		'watch:js'
	]);

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

	grunt.registerTask('build', [
		'clean',
		'concat',
		'ngAnnotate',
		'uglify'
	]);

	grunt.registerTask('_publish', [
		'build',
		'nugetpack',
		'conventionalChangelog',
		'bump-commit',
		'nugetpush'
	]);

	grunt.registerTask('publish', ['publish:patch']);
	grunt.registerTask('publish:patch', ['test', 'bump-only:patch', '_publish']);
	grunt.registerTask('publish:minor', ['test', 'bump-only:minor', '_publish']);
	grunt.registerTask('publish:major', ['test', 'bump-only:major', '_publish']);

	grunt.registerTask('default', [
		'test',
		'build'
	]);
};
<commit_msg>docs(grunt): coveralls is only run from Travis-CI<commit_after>// Generated on 2014-02-20 using generator-angular 0.7.1
'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);

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

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

		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				updateConfigs: ['yeoman'],
				commit: true,
				commitMessage: 'chore(release): release v%VERSION%. See CHANGELOG.md',
				commitFiles: ['-a'], // '-a' for all files
				createTag: true,
				tagName: 'v%VERSION%',
				tagMessage: 'Version %VERSION%',
				push: true,
				pushTo: 'origin master',
				gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
			}
		},

		conventionalChangelog: {
			options: {
				changelogOpts: {
					preset: 'angular'
				}
			},
			release: {
				src: 'CHANGELOG.md'
			}
		},

		// Watches files for changes and runs tasks based on the changed files
		watch: {
			js: {
				files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
				tasks: ['newer:jshint:all', 'karma:headless'],
				options: {
					livereload: true
				}
			},
			jsTest: {
				files: ['test/spec/{,*/}*.js'],
				tasks: ['newer:jshint:test', 'karma:headless']
			},
			gruntfile: {
				files: ['Gruntfile.js']
			},
			livereload: {
				options: {
					livereload: '<%= connect.options.livereload %>'
				},
				files: [
					'<%= yeoman.app %>/{,*/}*.html'
				]
			}
		},

		// The actual grunt server settings
		connect: {
			options: {
				port: 0,
				// Change this to '0.0.0.0' to access the server from outside.
				hostname: 'localhost',
				livereload: 35729
			},
			test: {
				options: {
					port: 0,
					base: [
						'test',
						'<%= yeoman.app %>'
					]
				}
			},
			livereload: {
				options: {
					open: true,
					base: [
						'<%= yeoman.app %>'
					]
				}
			}
		},

		// Make sure code styles are up to par and there are no obvious mistakes
		jshint: {
			options: {
				jshintrc: '.jshintrc',
				reporter: require('jshint-stylish')
			},
			all: [
				'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: [
						'<%= yeoman.dist %>/*',
						'!<%= yeoman.dist %>/.git*'
					]
				}]
			}
		},

		// Allow the use of non-minsafe AngularJS files. Automatically makes it
		// minsafe compatible so Uglify does not destroy the ng references
		ngAnnotate: {
			dist: {
				src: ['<%= yeoman.dist %>/angular-apimock.js'],
				dest: '<%= yeoman.dist %>/angular-apimock.js'
			}
		},

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

		uglify: {
			options: {
				preserveComments: 'some',
				report: 'gzip'
			},
			dist: {
				files: {
					'<%= yeoman.dist %>/angular-apimock.min.js': [
						'<%= yeoman.dist %>/angular-apimock.js'
					]
				}
			}
		},

		concat: {
			options: {
				banner: '/*! Angular API Mock v<%= yeoman.version %>\n * Licensed with MIT\n * Made with ♥ from Seriema + Redhorn */\n',
			},
			dist: {
				src: '<%= yeoman.app %>/scripts/**/*.js',
				dest: '<%= yeoman.dist %>/angular-apimock.js'
			}
		},

		nugetpack: {
			dist: {
				src: 'package.nuspec',
				dest: 'nuget/',
				options: {
					version: '<%= yeoman.version %>'
				}
			}
		},

		nugetpush: {
			dist: {
				src: 'nuget/Angular-ApiMock.<%= yeoman.version %>.nupkg'
			}
		},

		// Test settings
		karma: {
			options: {
				configFile: 'karma.conf.js',
				singleRun: true
			},
			headless: {
				browsers: ['PhantomJS'],
				reporters: [ 'dots', 'coverage' ],
				coverageReporter: {
					reporters: [
						{ type: 'lcov', subdir: 'PhantomJS' },
						{ type: 'text' }
					]
				}
			},
			angular12: {
				files: [{
					src: [
						'test/ref/angular-v1.2.js',
						'test/ref/angular-mocks-v1.2.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			},
			angular13: {
				files: [{
					src: [
						'test/ref/angular-v1.3.js',
						'test/ref/angular-mocks-v1.3.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			},
			angular14: {
				files: [{
					src: [
						'test/ref/angular-v1.4.js',
						'test/ref/angular-mocks-v1.4.js',
						'<%= watch.js.files %>',
						'<%= watch.jsTest.files %>'
					]}
				]
			}
		},

		// To run locally you need to set `COVERALLS_REPO_TOKEN` as an environment variable.
		// It's currently being run from Travis-CI (see .travis.yml)
		coveralls: {
			options: {
				force: true,
			},
			src: 'coverage/**/*.info',
		},
	});

	grunt.registerTask('serve', [
		'connect',
		'watch:js'
	]);

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

	grunt.registerTask('build', [
		'clean',
		'concat',
		'ngAnnotate',
		'uglify'
	]);

	grunt.registerTask('_publish', [
		'build',
		'nugetpack',
		'conventionalChangelog',
		'bump-commit',
		'nugetpush'
	]);

	grunt.registerTask('publish', ['publish:patch']);
	grunt.registerTask('publish:patch', ['test', 'bump-only:patch', '_publish']);
	grunt.registerTask('publish:minor', ['test', 'bump-only:minor', '_publish']);
	grunt.registerTask('publish:major', ['test', 'bump-only:major', '_publish']);

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


<commit_before>var Path = require('path')
var spec = require('./lib/spec')
var prompt = require('prompt')
prompt.start()

var modPath = '../../server_mods/com.wondible.pa.ai_showdown/'
var stream = 'stable'
var media = require('./lib/path').media(stream)

var ais = {
  ais: [
    {
      path: 'ai/vanilla',
      rule_postfix: '_Default',
      file_postfix: '',
      name_prefix: 'Default - ',
      unittype: 'Custom1',
    },
    {
      path: 'ai/quellar',
      rule_postfix: '_Quellar',
      file_postfix: '_Quellar',
      name_prefix: 'Quellar - ',
      unittype: 'Custom2',
    },
    {
      path: 'ai/s03g',
      rule_postfix: '_s03g',
      file_postfix: '_s03g',
      name_prefix: 's03g - ',
      unittype: 'Custom3',
    },
  ]
}

module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    copy: {
      mod: {
        files: [
          {
            src: [
              'modinfo.json',
              'LICENSE.txt',
              'README.md',
              'CHANGELOG.md',
              'server-script/**',
              'ui/**',
              'pa/**'],
            dest: modPath,
          },
        ],
      },
      vanilla: {
        files: [
          {
            expand: true,
            cwd: media + 'pa/ai/',
            src: '**',
            dest: 'ai/vanilla/',
          },
        ],
        options: {
          process: function(contents, path) {
            return JSON.stringify(JSON.parse(contents), null, 2)
          }
        },
      },
    },
    clean: ['pa', 'ai/vanilla', modPath],
    platoons: {},
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('ai_unit_map', '', function() {
    out = {}
    ais.ais.forEach(function(ai) {
      map = grunt.file.readJSON(ai.path + '/ai_unit_map.json').unit_map
      Object.keys(map).forEach(function(name) {
        out[name] = map[name]
      })
    })
    grunt.file.write('pa/ai/ai_unit_map.json',
                     JSON.stringify({unit_map: out}, null, 2))
  })

  grunt.registerTask('platoon_templates', '', function() {
    out = {}
    ais.ais.forEach(function(ai) {
      platoons = grunt.file.readJSON(ai.path + '/platoon_templates.json').platoon_templates
      Object.keys(platoons).forEach(function(name) {
        out[name + ai.rule_postfix] = platoons[name]
      })
    })
    grunt.file.write('pa/ai/platoon_templates.json',
                     JSON.stringify({platoon_templates: out}, null, 2))
  })

  grunt.registerTask('builds', '', function() {
    ais.ais.forEach(function(ai) {
      var files = grunt.file.expand([
        ai.path + '/platoon_builds/*',
        ai.path + '/fabber_builds/*',
        ai.path + '/factory_builds/*',
      ])
      files.forEach(function(path) {
        var base = Path.basename(path, '.json')
        var dir = Path.basename(Path.dirname(path))
        var builds = grunt.file.readJSON(path)
        builds.build_list.forEach(function(rule) {
          rule.name = ai.name_prefix + rule.name
          if (dir == 'platoon_builds') {
            rule.to_build = rule.to_build + ai.rule_postfix
          }
          rule.build_conditions.forEach(function(cond) {
            cond.unshift({
              "test_type":"UnitCount",
              "unit_type_string0":"Commander & " + ai.unittype,
              "compare0":">=",
              "value0":1
            })
          })
        })
        var dest = 'pa/ai/' + dir + '/' + base + ai.file_postfix + '.json'
        grunt.file.write(dest, JSON.stringify(builds, null, 2))
      })
    })
  })

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

  // notable others: copy:vanilla, copy:mod
};

<commit_msg>extended commanders<commit_after>var Path = require('path')
var spec = require('./lib/spec')
var prompt = require('prompt')
prompt.start()

var modPath = '../../server_mods/com.wondible.pa.ai_showdown/'
var stream = 'stable'
var media = require('./lib/path').media(stream)

var ais = {
  ais: [
    {
      path: 'ai/vanilla',
      rule_postfix: '_Default',
      file_postfix: '',
      name_prefix: 'Default - ',
      unittype: 'Custom1',
      commander: 'ProgenitorCommander',
    },
    {
      path: 'ai/quellar',
      rule_postfix: '_Quellar',
      file_postfix: '_Quellar',
      name_prefix: 'Quellar - ',
      unittype: 'Custom2',
      commander: 'AlphaCommander',
    },
    {
      path: 'ai/s03g',
      rule_postfix: '_s03g',
      file_postfix: '_s03g',
      name_prefix: 's03g - ',
      unittype: 'Custom3',
      commander: 'ThetaCommander',
    },
  ]
}

module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    copy: {
      mod: {
        files: [
          {
            src: [
              'modinfo.json',
              'LICENSE.txt',
              'README.md',
              'CHANGELOG.md',
              'server-script/**',
              'ui/**',
              'pa/**'],
            dest: modPath,
          },
        ],
      },
      vanilla: {
        files: [
          {
            expand: true,
            cwd: media + 'pa/ai/',
            src: '**',
            dest: 'ai/vanilla/',
          },
        ],
        options: {
          process: function(contents, path) {
            return JSON.stringify(JSON.parse(contents), null, 2)
          }
        },
      },
    },
    clean: ['pa', 'ai/vanilla', modPath],
    platoons: {},
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('ai_unit_map', '', function() {
    out = {}
    ais.ais.forEach(function(ai) {
      map = grunt.file.readJSON(ai.path + '/ai_unit_map.json').unit_map
      Object.keys(map).forEach(function(name) {
        out[name] = map[name]
      })
    })
    grunt.file.write('pa/ai/ai_unit_map.json',
                     JSON.stringify({unit_map: out}, null, 2))
  })

  grunt.registerTask('platoon_templates', '', function() {
    out = {}
    ais.ais.forEach(function(ai) {
      platoons = grunt.file.readJSON(ai.path + '/platoon_templates.json').platoon_templates
      Object.keys(platoons).forEach(function(name) {
        out[name + ai.rule_postfix] = platoons[name]
      })
    })
    grunt.file.write('pa/ai/platoon_templates.json',
                     JSON.stringify({platoon_templates: out}, null, 2))
  })

  grunt.registerTask('builds', '', function() {
    ais.ais.forEach(function(ai) {
      var files = grunt.file.expand([
        ai.path + '/platoon_builds/*',
        ai.path + '/fabber_builds/*',
        ai.path + '/factory_builds/*',
      ])
      files.forEach(function(path) {
        var base = Path.basename(path, '.json')
        var dir = Path.basename(Path.dirname(path))
        var builds = grunt.file.readJSON(path)
        builds.build_list.forEach(function(rule) {
          rule.name = ai.name_prefix + rule.name
          if (dir == 'platoon_builds') {
            rule.to_build = rule.to_build + ai.rule_postfix
          }
          rule.build_conditions.forEach(function(cond) {
            cond.unshift({
              "test_type":"UnitCount",
              "unit_type_string0":"Commander & " + ai.unittype,
              "compare0":">=",
              "value0":1
            })
          })
        })
        var dest = 'pa/ai/' + dir + '/' + base + ai.file_postfix + '.json'
        grunt.file.write(dest, JSON.stringify(builds, null, 2))
      })
    })
  })

  grunt.registerTask('commanders', '', function() {
    var base = grunt.file.readJSON(media + 'pa/units/commanders/base_commander/base_commander.json')
    var commanders = require(media + 'server-script/lobby/commander_table').data
    ais.ais.forEach(function(ai) {
      var specPath = commanders.filter(function(com) {
        return com.ObjectName == ai.commander
      })[0].UnitSpec
      var spec = grunt.file.readJSON(media + specPath)
      spec.unit_types = base.unit_types.concat(['UNITTYPE_' + ai.unittype])
      grunt.file.write('.' + specPath, JSON.stringify(spec, null, 2))
    })
  })

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

  // notable others: copy:vanilla, copy:mod
};

<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('jquery.multiSelectable.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: {
      files: ['dist']
    },
    connect: {
      server: {
        options: {
          port: 8085 // This is a random port, feel free to change it.
        }
      }
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/<%= pkg.name %>.js'],
        dest: 'dist/<%= pkg.name %>.js'
      },
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      },
    },
    qunit: {
      all: {
        options: {
          urls: [ 'http://localhost:<%= connect.server.options.port %>/test/test.html' ]
        }
      }
    },
    jshint: {
      gruntfile: {
        options: {
          jshintrc: '.jshintrc'
        },
        src: 'Gruntfile.js'
      },
      src: {
        options: {
          jshintrc: 'src/.jshintrc'
        },
        src: ['src/**/*.js']
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/**/*.js']
      },
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
    },
  });

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

  // Register Tasks.
  grunt.registerTask('default', ['connect','jshint', 'qunit', 'clean', 'concat', 'uglify']);
  grunt.registerTask('test', ['connect', 'jshint', 'qunit']);

};
<commit_msg>Tests for various versions of jQuery.<commit_after>'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('jquery.multiSelectable.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: {
      files: ['dist']
    },
    connect: {
      server: {
        options: {
          port: 8085 // This is a random port, feel free to change it.
        }
      }
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/<%= pkg.name %>.js'],
        dest: 'dist/<%= pkg.name %>.js'
      },
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      },
    },
    qunit: {
      all: {
        options: {
          urls: (function() {
            var base = 'http://localhost:<%= connect.server.options.port %>/test/test.html';
            var arr = ['1.7.0', '1.9.0'].map(function(version) {
              return base + '?jquery=' + version;
            });
            arr.push(base);
            return arr;
          })()
        }
      }
    },
    jshint: {
      gruntfile: {
        options: {
          jshintrc: '.jshintrc'
        },
        src: 'Gruntfile.js'
      },
      src: {
        options: {
          jshintrc: 'src/.jshintrc'
        },
        src: ['src/**/*.js']
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/**/*.js']
      },
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
    },
  });

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

  // Register Tasks.
  grunt.registerTask('default', ['connect','jshint', 'qunit', 'clean', 'concat', 'uglify']);
  grunt.registerTask('test', ['connect', 'jshint', 'qunit']);

};
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
<commit_msg>Initial commit<commit_after>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
var bkg         = require('./bower.json');
<|endoftext|>