<commit_before>/*!
 * Bootstrap's Gruntfile
 * http://getbootstrap.com
 * Copyright 2013-2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

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

  // Force use of Unix newlines
  grunt.util.linefeed = '\n';

  RegExp.quote = function (string) {
    return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
  };

  var fs = require('fs');
  var path = require('path');
  var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js');
  var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js');
  var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js');
  var updateShrinkwrap = require('./test-infra/shrinkwrap.js');

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
            ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
            ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
            ' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
            ' */\n',
    jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',

    // Task configuration.
    clean: {
      dist: 'dist'
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      grunt: {
        src: ['Gruntfile.js', 'docs/grunt/*.js', 'test-infra/shrinkwrap.js']
      },
      src: {
        src: 'js/*.js'
      },
      test: {
        src: 'js/tests/unit/*.js'
      },
      assets: {
        src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
      }
    },

    jscs: {
      options: {
        config: 'js/.jscs.json',
      },
      grunt: {
        src: ['Gruntfile.js', 'docs/grunt/*.js', 'test-infra/shrinkwrap.js']
      },
      src: {
        src: 'js/*.js'
      },
      test: {
        src: 'js/tests/unit/*.js'
      },
      assets: {
        src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
      }
    },

    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      src: [
        'dist/css/bootstrap.css',
        'dist/css/bootstrap-theme.css',
        'docs/assets/css/docs.css'
      ]
    },

    concat: {
      options: {
        banner: '<%= banner %>\n<%= jqueryCheck %>',
        stripBanners: false
      },
      bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'
      }
    },

    uglify: {
      bootstrap: {
        options: {
          banner: '<%= banner %>',
          report: 'min'
        },
        src: '<%= concat.bootstrap.dest %>',
        dest: 'dist/js/<%= pkg.name %>.min.js'
      },
      customize: {
        options: {
          preserveComments: 'some',
          report: 'min'
        },
        src: [
          'docs/assets/js/vendor/less.min.js',
          'docs/assets/js/vendor/jszip.js',
          'docs/assets/js/vendor/uglify.min.js',
          'docs/assets/js/vendor/blob.js',
          'docs/assets/js/vendor/filesaver.js',
          'docs/assets/js/raw-files.min.js',
          'docs/assets/js/customizer.js'
        ],
        dest: 'docs/assets/js/customize.min.js'
      },
      docsJs: {
        options: {
          preserveComments: 'some',
          report: 'min'
        },
        src: [
          'docs/assets/js/vendor/holder.js',
          'docs/assets/js/application.js'
        ],
        dest: 'docs/assets/js/docs.min.js'
      }
    },

    less: {
      compileCore: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'less/bootstrap.less'
        }
      },
      compileTheme: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>-theme.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>-theme.css': 'less/theme.less'
        }
      },
      minify: {
        options: {
          cleancss: true,
          report: 'min'
        },
        files: {
          'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css',
          'dist/css/<%= pkg.name %>-theme.min.css': 'dist/css/<%= pkg.name %>-theme.css'
        }
      }
    },

    cssmin: {
      compress: {
        options: {
          keepSpecialComments: '*',
          noAdvanced: true, // turn advanced optimizations off until the issue is fixed in clean-css
          report: 'min',
          selectorsMergeMode: 'ie8'
        },
        src: [
          'docs/assets/css/docs.css',
          'docs/assets/css/pygments-manni.css'
        ],
        dest: 'docs/assets/css/docs.min.css'
      }
    },

    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: '<%= banner %>'
        },
        files: {
          src: [
            'dist/css/<%= pkg.name %>.css',
            'dist/css/<%= pkg.name %>.min.css',
            'dist/css/<%= pkg.name %>-theme.css',
            'dist/css/<%= pkg.name %>-theme.min.css'
          ]
        }
      }
    },

    csscomb: {
      sort: {
        options: {
          config: 'less/.csscomb.json'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'dist/css/<%= pkg.name %>.css',
          'dist/css/<%= pkg.name %>-theme.css': 'dist/css/<%= pkg.name %>-theme.css'
        }
      }
    },

    copy: {
      fonts: {
        expand: true,
        src: 'fonts/*',
        dest: 'dist/'
      },
      docs: {
        expand: true,
        cwd: './dist',
        src: [
          '{css,js}/*.min.*',
          'css/*.map',
          'fonts/*'
        ],
        dest: 'docs/dist'
      }
    },

    qunit: {
      options: {
        inject: 'js/tests/unit/phantom.js'
      },
      files: 'js/tests/*.html'
    },

    connect: {
      server: {
        options: {
          port: 3000,
          base: '.'
        }
      }
    },

    jekyll: {
      docs: {}
    },

    jade: {
      compile: {
        options: {
          pretty: true,
          data: function () {
            var filePath = path.join(__dirname, 'less/variables.less');
            var fileContent = fs.readFileSync(filePath, {encoding: 'utf8'});
            var parser = new BsLessdocParser(fileContent);
            return {sections: parser.parseFile()};
          }
        },
        files: {
          'docs/_includes/customizer-variables.html': 'docs/customizer-variables.jade',
          'docs/_includes/nav-customize.html': 'docs/customizer-nav.jade'
        }
      }
    },

    validation: {
      options: {
        charset: 'utf-8',
        doctype: 'HTML5',
        failHard: true,
        reset: true,
        relaxerror: [
          'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
          'Element img is missing required attribute src.'
        ]
      },
      files: {
        src: '_gh_pages/**/*.html'
      }
    },

    watch: {
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
      less: {
        files: 'less/*.less',
        tasks: 'less'
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver');
          return old ? RegExp.quote(old) : old;
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    },

    'saucelabs-qunit': {
      all: {
        options: {
          build: process.env.TRAVIS_JOB_ID,
          concurrency: 10,
          urls: ['http://127.0.0.1:3000/js/tests/index.html'],
          browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml')
        }
      }
    },

    exec: {
      npmUpdate: {
        command: 'npm update'
      },
      npmShrinkWrap: {
        command: 'npm shrinkwrap --dev'
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
  grunt.loadNpmTasks('browserstack-runner');

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = [];
  // Skip core tests if running a different subset of the test suite
  if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') {
    testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-html']);
  }
  // Skip HTML validation if running a different subset of the test suite
  if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') {
    testSubtasks.push('validate-html');
  }
  // Only run Sauce Labs tests if there's a Sauce access key
  if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
      // Skip Sauce if running a different subset of the test suite
      (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) {
    testSubtasks.push('connect');
    testSubtasks.push('saucelabs-qunit');
  }
  // Only run BrowserStack tests if there's a BrowserStack access key
  if (typeof process.env.BROWSERSTACK_KEY !== 'undefined' &&
      // Skip BrowserStack if running a different subset of the test suite
      (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'browserstack-js-unit')) {
    testSubtasks.push('browserstack_runner');
  }
  grunt.registerTask('test', testSubtasks);

  // JS distribution task.
  grunt.registerTask('dist-js', ['concat', 'uglify']);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['less', 'cssmin', 'csscomb', 'usebanner']);

  // Docs distribution task.
  grunt.registerTask('dist-docs', 'copy:docs');

  // Full distribution task.
  grunt.registerTask('dist', ['clean', 'dist-css', 'copy:fonts', 'dist-docs', 'dist-js']);

  // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer', 'update-shrinkwrap']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', 'sed');

  grunt.registerTask('build-glyphicons-data', generateGlyphiconsData);

  // task for building customizer
  grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']);
  grunt.registerTask('build-customizer-html', 'jade');
  grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () {
    var banner = grunt.template.process('<%= banner %>');
    generateRawFilesJs(banner);
  });

  // Task for updating the npm packages used by the Travis build.
  grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
  grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
};
<commit_msg>fix #12531<commit_after>/*!
 * Bootstrap's Gruntfile
 * http://getbootstrap.com
 * Copyright 2013-2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

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

  // Force use of Unix newlines
  grunt.util.linefeed = '\n';

  RegExp.quote = function (string) {
    return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
  };

  var fs = require('fs');
  var path = require('path');
  var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js');
  var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js');
  var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js');
  var updateShrinkwrap = require('./test-infra/shrinkwrap.js');

  // Project configuration.
  grunt.initConfig({

    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*!\n' +
            ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
            ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
            ' * Licensed under <%= _.pluck(pkg.licenses, "type") %> (<%= _.pluck(pkg.licenses, "url") %>)\n' +
            ' */\n',
    jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',

    // Task configuration.
    clean: {
      dist: ['dist', 'docs/dist']
    },

    jshint: {
      options: {
        jshintrc: 'js/.jshintrc'
      },
      grunt: {
        src: ['Gruntfile.js', 'docs/grunt/*.js', 'test-infra/shrinkwrap.js']
      },
      src: {
        src: 'js/*.js'
      },
      test: {
        src: 'js/tests/unit/*.js'
      },
      assets: {
        src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
      }
    },

    jscs: {
      options: {
        config: 'js/.jscs.json',
      },
      grunt: {
        src: ['Gruntfile.js', 'docs/grunt/*.js', 'test-infra/shrinkwrap.js']
      },
      src: {
        src: 'js/*.js'
      },
      test: {
        src: 'js/tests/unit/*.js'
      },
      assets: {
        src: ['docs/assets/js/application.js', 'docs/assets/js/customizer.js']
      }
    },

    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      src: [
        'dist/css/bootstrap.css',
        'dist/css/bootstrap-theme.css',
        'docs/assets/css/docs.css'
      ]
    },

    concat: {
      options: {
        banner: '<%= banner %>\n<%= jqueryCheck %>',
        stripBanners: false
      },
      bootstrap: {
        src: [
          'js/transition.js',
          'js/alert.js',
          'js/button.js',
          'js/carousel.js',
          'js/collapse.js',
          'js/dropdown.js',
          'js/modal.js',
          'js/tooltip.js',
          'js/popover.js',
          'js/scrollspy.js',
          'js/tab.js',
          'js/affix.js'
        ],
        dest: 'dist/js/<%= pkg.name %>.js'
      }
    },

    uglify: {
      bootstrap: {
        options: {
          banner: '<%= banner %>',
          report: 'min'
        },
        src: '<%= concat.bootstrap.dest %>',
        dest: 'dist/js/<%= pkg.name %>.min.js'
      },
      customize: {
        options: {
          preserveComments: 'some',
          report: 'min'
        },
        src: [
          'docs/assets/js/vendor/less.min.js',
          'docs/assets/js/vendor/jszip.js',
          'docs/assets/js/vendor/uglify.min.js',
          'docs/assets/js/vendor/blob.js',
          'docs/assets/js/vendor/filesaver.js',
          'docs/assets/js/raw-files.min.js',
          'docs/assets/js/customizer.js'
        ],
        dest: 'docs/assets/js/customize.min.js'
      },
      docsJs: {
        options: {
          preserveComments: 'some',
          report: 'min'
        },
        src: [
          'docs/assets/js/vendor/holder.js',
          'docs/assets/js/application.js'
        ],
        dest: 'docs/assets/js/docs.min.js'
      }
    },

    less: {
      compileCore: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'less/bootstrap.less'
        }
      },
      compileTheme: {
        options: {
          strictMath: true,
          sourceMap: true,
          outputSourceFiles: true,
          sourceMapURL: '<%= pkg.name %>-theme.css.map',
          sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map'
        },
        files: {
          'dist/css/<%= pkg.name %>-theme.css': 'less/theme.less'
        }
      },
      minify: {
        options: {
          cleancss: true,
          report: 'min'
        },
        files: {
          'dist/css/<%= pkg.name %>.min.css': 'dist/css/<%= pkg.name %>.css',
          'dist/css/<%= pkg.name %>-theme.min.css': 'dist/css/<%= pkg.name %>-theme.css'
        }
      }
    },

    cssmin: {
      compress: {
        options: {
          keepSpecialComments: '*',
          noAdvanced: true, // turn advanced optimizations off until the issue is fixed in clean-css
          report: 'min',
          selectorsMergeMode: 'ie8'
        },
        src: [
          'docs/assets/css/docs.css',
          'docs/assets/css/pygments-manni.css'
        ],
        dest: 'docs/assets/css/docs.min.css'
      }
    },

    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: '<%= banner %>'
        },
        files: {
          src: [
            'dist/css/<%= pkg.name %>.css',
            'dist/css/<%= pkg.name %>.min.css',
            'dist/css/<%= pkg.name %>-theme.css',
            'dist/css/<%= pkg.name %>-theme.min.css'
          ]
        }
      }
    },

    csscomb: {
      sort: {
        options: {
          config: 'less/.csscomb.json'
        },
        files: {
          'dist/css/<%= pkg.name %>.css': 'dist/css/<%= pkg.name %>.css',
          'dist/css/<%= pkg.name %>-theme.css': 'dist/css/<%= pkg.name %>-theme.css'
        }
      }
    },

    copy: {
      fonts: {
        expand: true,
        src: 'fonts/*',
        dest: 'dist/'
      },
      docs: {
        expand: true,
        cwd: './dist',
        src: [
          '{css,js}/*.min.*',
          'css/*.map',
          'fonts/*'
        ],
        dest: 'docs/dist'
      }
    },

    qunit: {
      options: {
        inject: 'js/tests/unit/phantom.js'
      },
      files: 'js/tests/*.html'
    },

    connect: {
      server: {
        options: {
          port: 3000,
          base: '.'
        }
      }
    },

    jekyll: {
      docs: {}
    },

    jade: {
      compile: {
        options: {
          pretty: true,
          data: function () {
            var filePath = path.join(__dirname, 'less/variables.less');
            var fileContent = fs.readFileSync(filePath, {encoding: 'utf8'});
            var parser = new BsLessdocParser(fileContent);
            return {sections: parser.parseFile()};
          }
        },
        files: {
          'docs/_includes/customizer-variables.html': 'docs/customizer-variables.jade',
          'docs/_includes/nav-customize.html': 'docs/customizer-nav.jade'
        }
      }
    },

    validation: {
      options: {
        charset: 'utf-8',
        doctype: 'HTML5',
        failHard: true,
        reset: true,
        relaxerror: [
          'Bad value X-UA-Compatible for attribute http-equiv on element meta.',
          'Element img is missing required attribute src.'
        ]
      },
      files: {
        src: '_gh_pages/**/*.html'
      }
    },

    watch: {
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
      less: {
        files: 'less/*.less',
        tasks: 'less'
      }
    },

    sed: {
      versionNumber: {
        pattern: (function () {
          var old = grunt.option('oldver');
          return old ? RegExp.quote(old) : old;
        })(),
        replacement: grunt.option('newver'),
        recursive: true
      }
    },

    'saucelabs-qunit': {
      all: {
        options: {
          build: process.env.TRAVIS_JOB_ID,
          concurrency: 10,
          urls: ['http://127.0.0.1:3000/js/tests/index.html'],
          browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml')
        }
      }
    },

    exec: {
      npmUpdate: {
        command: 'npm update'
      },
      npmShrinkWrap: {
        command: 'npm shrinkwrap --dev'
      }
    }
  });

  // These plugins provide necessary tasks.
  require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
  grunt.loadNpmTasks('browserstack-runner');

  // Docs HTML validation task
  grunt.registerTask('validate-html', ['jekyll', 'validation']);

  // Test task.
  var testSubtasks = [];
  // Skip core tests if running a different subset of the test suite
  if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'core') {
    testSubtasks = testSubtasks.concat(['dist-css', 'csslint', 'jshint', 'jscs', 'qunit', 'build-customizer-html']);
  }
  // Skip HTML validation if running a different subset of the test suite
  if (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'validate-html') {
    testSubtasks.push('validate-html');
  }
  // Only run Sauce Labs tests if there's a Sauce access key
  if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
      // Skip Sauce if running a different subset of the test suite
      (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) {
    testSubtasks.push('connect');
    testSubtasks.push('saucelabs-qunit');
  }
  // Only run BrowserStack tests if there's a BrowserStack access key
  if (typeof process.env.BROWSERSTACK_KEY !== 'undefined' &&
      // Skip BrowserStack if running a different subset of the test suite
      (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'browserstack-js-unit')) {
    testSubtasks.push('browserstack_runner');
  }
  grunt.registerTask('test', testSubtasks);

  // JS distribution task.
  grunt.registerTask('dist-js', ['concat', 'uglify']);

  // CSS distribution task.
  grunt.registerTask('dist-css', ['less', 'cssmin', 'csscomb', 'usebanner']);

  // Docs distribution task.
  grunt.registerTask('dist-docs', 'copy:docs');

  // Full distribution task.
  grunt.registerTask('dist', ['clean', 'dist-css', 'copy:fonts', 'dist-docs', 'dist-js']);

  // Default task.
  grunt.registerTask('default', ['test', 'dist', 'build-glyphicons-data', 'build-customizer', 'update-shrinkwrap']);

  // Version numbering task.
  // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z
  // This can be overzealous, so its changes should always be manually reviewed!
  grunt.registerTask('change-version-number', 'sed');

  grunt.registerTask('build-glyphicons-data', generateGlyphiconsData);

  // task for building customizer
  grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']);
  grunt.registerTask('build-customizer-html', 'jade');
  grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () {
    var banner = grunt.template.process('<%= banner %>');
    generateRawFilesJs(banner);
  });

  // Task for updating the npm packages used by the Travis build.
  grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
  grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
};
<|endoftext|>


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

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    webdriver: {
      options: {
          host: (process.env.BUILD_NUMBER) ? 'localhost':'ondemand.saucelabs.com',
          port: (process.env.BUILD_NUMBER) ? 4445:80,
          user: process.env.SAUCE_USERNAME,
          key: process.env.SAUCE_ACCESS_KEY,
          tags: ['saucelabs'],
          name: 'This is an example test script using grunt-driver and saucelabs'
      },
      ieexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js'],
        options: {
          desiredCapabilities: {
            browserName: 'internet explorer',
            version: '10.0',
            platform: 'Windows 7'
          }
        }
      },
      chromeexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js'],
        options: {
          desiredCapabilities: {
            browserName: 'chrome',
            version: '42.0',
            platform: 'Windows 8'
          }
        }
      },
      safariexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js'],
        options: {
          desiredCapabilities: {
            browserName: 'safari',
            version: '8.0',
            platform: 'OS X 10.10'
          }
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-webdriver');
};<commit_msg>Added formFillSubmit1.js, linkTextURL1.js and linkTextURL2.js<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    webdriver: {
      options: {
          host: (process.env.BUILD_NUMBER) ? 'localhost':'ondemand.saucelabs.com',
          port: (process.env.BUILD_NUMBER) ? 4445:80,
          user: process.env.SAUCE_USERNAME,
          key: process.env.SAUCE_ACCESS_KEY,
          tags: ['saucelabs'],
          name: 'This is an example test script using grunt-driver and saucelabs'
      },
      ieexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js', 'formFillSubmit1.js', 'linkTextURL1.js', 'linkTextURL2.js'],
        options: {
          desiredCapabilities: {
            browserName: 'internet explorer',
            version: '10.0',
            platform: 'Windows 7'
          }
        }
      },
      chromeexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js', 'formFillSubmit1.js', 'linkTextURL1.js', 'linkTextURL2.js'],
        options: {
          desiredCapabilities: {
            browserName: 'chrome',
            version: '42.0',
            platform: 'Windows 8'
          }
        }
      },
      safariexample: {
        tests: ['gruntSaucelabs.js', 'tutorial1.js', 'copyright1.js', 'cssValidation1.js', 'dataLoopExample2.js', 'formFieldValidation.js', 'formFillSubmit1.js', 'linkTextURL1.js', 'linkTextURL2.js'],
        options: {
          desiredCapabilities: {
            browserName: 'safari',
            version: '8.0',
            platform: 'OS X 10.10'
          }
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-webdriver');
};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    var path = require('path');
    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        clean: ['build'],
        karma: {
            unit: {
                configFile: 'karma.conf.js'
            }
        },
        zip: {
            release: {
                router: function (filepath) {
                    var filename = path.basename(filepath);
                    if (filename == 'panel_production.html') {
                        return 'app/html/panel.html';
                    }
                    return filepath;
                },
                compression: 'DEFLATE',
                src: [
                    'components/bootstrap/dist/css/bootstrap.min.css',
                    'components/bootstrap/dist/js/bootstrap.min.js',
                    'components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
                    'app/**',
                    '!app/html/panel.html',
                    'components/jquery/jquery.min.js',
                    'components/angular/angular.min.js',
                    'manifest.json'
                ],
                dest: 'build/storage-area-explorer-v<%=pkg.version%>_' + Date.now() + '.zip'
            }

        }
    });

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-karma');

    // Default task(s).
    grunt.registerTask('default', ['clean', 'zip']);

};<commit_msg>build - added test coverage to the build<commit_after>module.exports = function (grunt) {
    var path = require('path');
    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        clean: ['build'],
        karma: {
            unit: {
                configFile: 'karma.conf.js'
            }
        },
        zip: {
            release: {
                router: function (filepath) {
                    var filename = path.basename(filepath);
                    if (filename == 'panel_production.html') {
                        return 'app/html/panel.html';
                    }
                    return filepath;
                },
                compression: 'DEFLATE',
                src: [
                    'components/bootstrap/dist/css/bootstrap.min.css',
                    'components/bootstrap/dist/js/bootstrap.min.js',
                    'components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff',
                    'app/**',
                    '!app/html/panel.html',
                    'components/jquery/jquery.min.js',
                    'components/angular/angular.min.js',
                    'manifest.json'
                ],
                dest: 'build/storage-area-explorer-v<%=pkg.version%>_' + Date.now() + '.zip'
            },
            testsCoverage:{
                compression:'DEFLATE',
                src: [
                    'coverage/Chrome */**'
                ],
                dest:'build/coverage.zip'
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-karma');

    // Default task(s).
    grunt.registerTask('default', ['clean', 'zip']);

};<|endoftext|>


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

  // Include modules
  require('load-grunt-tasks')(grunt, {pattern: ['grunt-*', 'assemble']});
  require('time-grunt')(grunt);

  grunt.loadNpmTasks('grunt-ftp-deploy');

  var path = {
    css_src: 'src/stylesheets/global.scss',
    css_dest: 'src/stylesheets/global.css',
    email_src: 'src/emails/*.hbs',
    dist: 'dist/',
    dist_test: 'dist_test/',
    dist_html_glob: 'dist/*.html',
    dist_text_glob: 'dist/*.txt',
    dist_test_html_glob: 'dist_test/*.html',
    layouts: 'src/layouts',
    partials: 'src/partials/*',
    images_src: 'src/images'
  };

  /* Configuration
  ================================================= */

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

    /* secrets.json and config.json simplify variable management to keep the
       common changes centralized to key files instead of being littered
       throughout the Gruntfile. This also makes it easy to .gitignore secrets
    ================================================= */
    secret: grunt.file.readJSON('secrets.json'),
    config: grunt.file.readJSON('config.json'),

    /* SASS
    ------------------------------------------------- */

    sass: {
      styles: {
        src: path.css_src,
        dest: path.css_dest
      }
    },

    /* Autoprefixer
    ------------------------------------------------- */

    autoprefixer: {
      options: {
        browsers: ['last 6 versions', 'ie >= 9']
      },
      styles: {
        src: path.css_dest,
        dest: path.css_dest
      }
    },

    /* Assemble
       Assembles our handlebars templates. Documentation might be incompatible since the latest version uses an entirely different build system.
       See: https://github.com/assemble/assemble/
    ------------------------------------------------- */

    assemble: {
      options: {
        layoutdir: path.layouts,
        partials: path.partials,
        flatten: true,
        sender_name: "<%= config.strings.sender_name %>",
        product_name: "<%= config.strings.product_name %>",
        product_url: "<%= config.strings.product_url %>",
        credit_card_statement_name: "<%= config.strings.credit_card_statement_name %>",
        formal_company_name: "<%= config.strings.formal_company_name %>",
        address_line_1: "<%= config.strings.address_line_1 %>",
        address_line_2: "<%= config.strings.address_line_2 %>",
        city: "<%= config.strings.city %>",
        state: "<%= config.strings.state %>",
        country: "<%= config.strings.country %>",
        phone: "<%= config.strings.phone %>",
        images_url: "<%= config.images.images_url %>",
        use_images: "<%= config.images.use_images %>",
        logo_file: "<%= config.images.logo_file %>",
        logo_width: "<%= config.images.logo_width %>",
        use_social_circles: "<%= config.images.use_social_circles %>",
        twitter_url: "<%= config.images.twitter_url %>",
        facebook_url: "<%= config.images.facebook_url %>",
        pinterest_url: "<%= config.images.pinterest_url %>",
        instagram_url: "<%= config.images.instagram_url %>",
        dribbble_url: "<%= config.images.dribbble_url %>",
        google_plus_url: "<%= config.images.google_plus_url %>",
        youtube_url: "<%= config.images.youtube_url %>",
        linkedin_url: "<%= config.images.linkedin_url %>"
      },
      pages: {
        src: [path.email_src],
        dest: path.dist
      }
    },

    /* Inline
       Brings external resources in the HTML files. Basically just takes our CSS file and inserts it as a style block.
       See: https://github.com/chyingp/grunt-inline
    ------------------------------------------------- */

    inline: {
      html: {
        expand: true,
        cwd: path.dist,
        ext: '.html',
        src: ['*.html'],
        dest: path.dist
      }
    },

    /* Prettify
       Formats our template HTML files.
       See: https://github.com/jonschlinkert/grunt-prettify
    ------------------------------------------------- */

    prettify: {
      options: {
        indent: '2'
      },
      html: {
        expand: true,
        cwd: path.dist,
        ext: '.html',
        src: ['*.html'],
        dest: path.dist
      }
    },

    /* Premailer
       Adds all sorts of email magic. Adds inline styles to each element based off class. Also generates plain text versions and allows us to control commonly used table attributes via CSS.
       See: https://github.com/dwightjack/grunt-premailer
    ------------------------------------------------- */

    premailer: {
      options: {
        warnLevel: 'none'
      },
      html: {
        options: {
          removeComments: true
        },
        files: [{
          expand: true,
          src: [path.dist_test_html_glob],
          dest: ''
        }]
      },
      txt: {
        options: {
          mode: 'txt',
          lineLength: 16384
        },
        files: [{
          expand: true,
          src: [path.dist_html_glob],
          dest: '',
          ext: '.txt'
        }]
      }
    },

    'ftp-deploy': {
      build: {
        auth: {
          host: "<%= config.ftp.host %>",
          port: "<%= config.ftp.port %>",
          username: "<%= secret.ftp.username %>",
          password: "<%= secret.ftp.password %>"
        },
        src: "<%= config.ftp.src %>",
        dest: "<%= config.ftp.dest %>",
        exclusions: ['path/to/source/folder/**/.DS_Store', 'path/to/source/folder/**/Thumbs.db']
      }
    },

    /* Watch
       Watches all files in the src directory for changes.
    ------------------------------------------------- */

    watch: {
      options: {
        livereload: true
      },
      files: ['src/**/*'],
      tasks: ['default']
    },

    /* Replace
    ------------------------------------------------- */

    replace: {
      // Premailer escapes URLs, so our mustachio variables for URLs get fully escaped, and the
      // URL variables need to be converted from %7B%7Bsomething%7D%7D to {{something}}
      variableSyntax: {
        src: [path.dist_text_glob],
        overwrite: true,
        replacements: [
          { from: '%7B%7B', to: '{{ ' },
          { from: '%7D%7D', to: ' }}' },
          { from: '%7D%7D%22', to: ' }}' },
          { from: '%20}}', to: ' }}' },
          { from: '{{%20', to: '{{ ' }
        ]
      },
      // Add some additional attributes that grunt inline removed
      styleBlock: {
        src: [path.dist_html_glob],
        overwrite: true,
        replacements: [
          {
            from: '<style>',
            to: '<style type="text/css" rel="stylesheet" media="all">'
          }
        ]
      }
    },

    /* Copy
       This is mainly used to copy compiled templates to a new directory for the CSS to be inlined before being tested.
       See: https://github.com/gruntjs/grunt-contrib-copy
     ------------------------------------------------- */

    copy: {
      testTemplates: {
        files: [{
          expand: true,
          src: [path.dist_html_glob],
          dest: path.dist_test,
          flatten: true
        }]
      }
    },

    /* Spamcheck
       Sends all of our HTML files through Postmark’s spamcheck API.
       See: https://github.com/wildbit/grunt-spamcheck
    ------------------------------------------------- */

    spamcheck: {
      emails: {
        src: [path.dist_html_glob]
      }
    },

    /* Postmark
       Sends test emails through Postmark. Add and remove template targets as needed.
       Ensure that the CSS is always inlined before sending tests. This can be done with the 'testBuild' task below.
       See: https://github.com/wildbit/grunt-postmark
    ------------------------------------------------- */

    postmark: {
      options: {
        serverToken: "<%= secret.postmark.server_token %>",
        from: "<%= config.postmark.from %>",
        to: "<%= config.postmark.to %>",
        subject: "<%= config.postmark.subject %>",
      },
      // run "grunt postmark:welcome" - Sends just the welcome email
      welcome: {
        src: 'dist_test/welcome.html'
      },
      // run "npm run flood" - Sends all of the emails. Be careful not to spam PM if you have a bunch of emails.
      flood: {
        src: [path.dist_test_html_glob]
      },
      // run "npm run litmus" - Add a litmus test address here.
      litmus: {
        to: "<%= config.strings.litmus_email %>",
        src: 'dist_test/user_invitation.html'
      }
    }

  });

  /* Tasks
  ================================================= */

  grunt.registerTask('default', ['css', 'html']);

  // Assets
  grunt.registerTask('html', ['assemble', 'inline', 'premailer:txt', 'replace', 'prettify']);
  grunt.registerTask('css', ['sass', 'autoprefixer']);
  grunt.registerTask('images', ['ftp-deploy']);

  // Testing
  grunt.registerTask('spam', ['spamcheck']);
  grunt.registerTask('litmus', ['testBuild', 'postmark:litmus']);
  grunt.registerTask('flood', ['testBuild', 'postmark:flood']);

  // Before sending tests via Postmark, ensure that test builds with inlined CSS are generated
  grunt.registerTask('testBuild', ['default', 'copy:testTemplates', 'premailer:html']);
};
<commit_msg>Check if secrets.json exists before reading #23<commit_after>module.exports = function(grunt) {

  // Include modules
  require('load-grunt-tasks')(grunt, {pattern: ['grunt-*', 'assemble']});
  require('time-grunt')(grunt);

  grunt.loadNpmTasks('grunt-ftp-deploy');

  var path = {
    css_src: 'src/stylesheets/global.scss',
    css_dest: 'src/stylesheets/global.css',
    email_src: 'src/emails/*.hbs',
    dist: 'dist/',
    dist_test: 'dist_test/',
    dist_html_glob: 'dist/*.html',
    dist_text_glob: 'dist/*.txt',
    dist_test_html_glob: 'dist_test/*.html',
    layouts: 'src/layouts',
    partials: 'src/partials/*',
    images_src: 'src/images'
  };

  /* Configuration
  ================================================= */

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

    /* secrets.json and config.json simplify variable management to keep the
       common changes centralized to key files instead of being littered
       throughout the Gruntfile. This also makes it easy to .gitignore secrets
    ================================================= */
    secret: grunt.file.exists('secrets.json') ? grunt.file.readJSON('secrets.json') : {},
    config: grunt.file.readJSON('config.json'),

    /* SASS
    ------------------------------------------------- */

    sass: {
      styles: {
        src: path.css_src,
        dest: path.css_dest
      }
    },

    /* Autoprefixer
    ------------------------------------------------- */

    autoprefixer: {
      options: {
        browsers: ['last 6 versions', 'ie >= 9']
      },
      styles: {
        src: path.css_dest,
        dest: path.css_dest
      }
    },

    /* Assemble
       Assembles our handlebars templates. Documentation might be incompatible since the latest version uses an entirely different build system.
       See: https://github.com/assemble/assemble/
    ------------------------------------------------- */

    assemble: {
      options: {
        layoutdir: path.layouts,
        partials: path.partials,
        flatten: true,
        sender_name: "<%= config.strings.sender_name %>",
        product_name: "<%= config.strings.product_name %>",
        product_url: "<%= config.strings.product_url %>",
        credit_card_statement_name: "<%= config.strings.credit_card_statement_name %>",
        formal_company_name: "<%= config.strings.formal_company_name %>",
        address_line_1: "<%= config.strings.address_line_1 %>",
        address_line_2: "<%= config.strings.address_line_2 %>",
        city: "<%= config.strings.city %>",
        state: "<%= config.strings.state %>",
        country: "<%= config.strings.country %>",
        phone: "<%= config.strings.phone %>",
        images_url: "<%= config.images.images_url %>",
        use_images: "<%= config.images.use_images %>",
        logo_file: "<%= config.images.logo_file %>",
        logo_width: "<%= config.images.logo_width %>",
        use_social_circles: "<%= config.images.use_social_circles %>",
        twitter_url: "<%= config.images.twitter_url %>",
        facebook_url: "<%= config.images.facebook_url %>",
        pinterest_url: "<%= config.images.pinterest_url %>",
        instagram_url: "<%= config.images.instagram_url %>",
        dribbble_url: "<%= config.images.dribbble_url %>",
        google_plus_url: "<%= config.images.google_plus_url %>",
        youtube_url: "<%= config.images.youtube_url %>",
        linkedin_url: "<%= config.images.linkedin_url %>"
      },
      pages: {
        src: [path.email_src],
        dest: path.dist
      }
    },

    /* Inline
       Brings external resources in the HTML files. Basically just takes our CSS file and inserts it as a style block.
       See: https://github.com/chyingp/grunt-inline
    ------------------------------------------------- */

    inline: {
      html: {
        expand: true,
        cwd: path.dist,
        ext: '.html',
        src: ['*.html'],
        dest: path.dist
      }
    },

    /* Prettify
       Formats our template HTML files.
       See: https://github.com/jonschlinkert/grunt-prettify
    ------------------------------------------------- */

    prettify: {
      options: {
        indent: '2'
      },
      html: {
        expand: true,
        cwd: path.dist,
        ext: '.html',
        src: ['*.html'],
        dest: path.dist
      }
    },

    /* Premailer
       Adds all sorts of email magic. Adds inline styles to each element based off class. Also generates plain text versions and allows us to control commonly used table attributes via CSS.
       See: https://github.com/dwightjack/grunt-premailer
    ------------------------------------------------- */

    premailer: {
      options: {
        warnLevel: 'none'
      },
      html: {
        options: {
          removeComments: true
        },
        files: [{
          expand: true,
          src: [path.dist_test_html_glob],
          dest: ''
        }]
      },
      txt: {
        options: {
          mode: 'txt',
          lineLength: 16384
        },
        files: [{
          expand: true,
          src: [path.dist_html_glob],
          dest: '',
          ext: '.txt'
        }]
      }
    },

    'ftp-deploy': {
      build: {
        auth: {
          host: "<%= config.ftp.host %>",
          port: "<%= config.ftp.port %>",
          username: "<%= secret.ftp.username %>",
          password: "<%= secret.ftp.password %>"
        },
        src: "<%= config.ftp.src %>",
        dest: "<%= config.ftp.dest %>",
        exclusions: ['path/to/source/folder/**/.DS_Store', 'path/to/source/folder/**/Thumbs.db']
      }
    },

    /* Watch
       Watches all files in the src directory for changes.
    ------------------------------------------------- */

    watch: {
      options: {
        livereload: true
      },
      files: ['src/**/*'],
      tasks: ['default']
    },

    /* Replace
    ------------------------------------------------- */

    replace: {
      // Premailer escapes URLs, so our mustachio variables for URLs get fully escaped, and the
      // URL variables need to be converted from %7B%7Bsomething%7D%7D to {{something}}
      variableSyntax: {
        src: [path.dist_text_glob],
        overwrite: true,
        replacements: [
          { from: '%7B%7B', to: '{{ ' },
          { from: '%7D%7D', to: ' }}' },
          { from: '%7D%7D%22', to: ' }}' },
          { from: '%20}}', to: ' }}' },
          { from: '{{%20', to: '{{ ' }
        ]
      },
      // Add some additional attributes that grunt inline removed
      styleBlock: {
        src: [path.dist_html_glob],
        overwrite: true,
        replacements: [
          {
            from: '<style>',
            to: '<style type="text/css" rel="stylesheet" media="all">'
          }
        ]
      }
    },

    /* Copy
       This is mainly used to copy compiled templates to a new directory for the CSS to be inlined before being tested.
       See: https://github.com/gruntjs/grunt-contrib-copy
     ------------------------------------------------- */

    copy: {
      testTemplates: {
        files: [{
          expand: true,
          src: [path.dist_html_glob],
          dest: path.dist_test,
          flatten: true
        }]
      }
    },

    /* Spamcheck
       Sends all of our HTML files through Postmark’s spamcheck API.
       See: https://github.com/wildbit/grunt-spamcheck
    ------------------------------------------------- */

    spamcheck: {
      emails: {
        src: [path.dist_html_glob]
      }
    },

    /* Postmark
       Sends test emails through Postmark. Add and remove template targets as needed.
       Ensure that the CSS is always inlined before sending tests. This can be done with the 'testBuild' task below.
       See: https://github.com/wildbit/grunt-postmark
    ------------------------------------------------- */

    postmark: {
      options: {
        serverToken: "<%= secret.postmark.server_token %>",
        from: "<%= config.postmark.from %>",
        to: "<%= config.postmark.to %>",
        subject: "<%= config.postmark.subject %>",
      },
      // run "grunt postmark:welcome" - Sends just the welcome email
      welcome: {
        src: 'dist_test/welcome.html'
      },
      // run "npm run flood" - Sends all of the emails. Be careful not to spam PM if you have a bunch of emails.
      flood: {
        src: [path.dist_test_html_glob]
      },
      // run "npm run litmus" - Add a litmus test address here.
      litmus: {
        to: "<%= config.strings.litmus_email %>",
        src: 'dist_test/user_invitation.html'
      }
    }

  });

  /* Tasks
  ================================================= */

  grunt.registerTask('default', ['css', 'html']);

  // Assets
  grunt.registerTask('html', ['assemble', 'inline', 'premailer:txt', 'replace', 'prettify']);
  grunt.registerTask('css', ['sass', 'autoprefixer']);
  grunt.registerTask('images', ['ftp-deploy']);

  // Testing
  grunt.registerTask('spam', ['spamcheck']);
  grunt.registerTask('litmus', ['testBuild', 'postmark:litmus']);
  grunt.registerTask('flood', ['testBuild', 'postmark:flood']);

  // Before sending tests via Postmark, ensure that test builds with inlined CSS are generated
  grunt.registerTask('testBuild', ['default', 'copy:testTemplates', 'premailer:html']);
};
<|endoftext|>


<commit_before>

var folderMount = function folderMount(connect, point) {
  return connect.static(path.resolve(point));
};

module.exports = function(grunt, gt) {

  var gt = gt || false;

  'use strict';

  // Project configuration.
  grunt.initConfig({

    jshint: {
      options: {
        curly    : true,
        eqeqeq   : true,
        loopfunc : true,
        forin    : false,
        immed    : true,
        latedef  : true,
        newcap   : true,
        noarg    : true,
        sub      : true,
        undef    : true,
        boss     : true,
        eqnull   : true,
        node     : true,
        es5      : true,
        supernew : true,
        laxbreak : true,
        strict   : false,
        expr     : true,
        globals: {
          gt        : true,
          describe  : true,
          it        : true,
          before    : true,
          define    : true,
          Modernizr : true,
          requirejs : true,
          alert     : true,
          window    : true,
          opt       : true,
          document  : true,
          tmpl      : true,
          $         : true
        }
      },

      files: [
        'grunt.js',
        'app/**/*.js',
        'lib/**/*.js',
        '!app/build/tmpl.js',
        '!app/vendor/**',
        '!app/public/templates/**/*.js',
        'src/**/*.js'
      ]
    },

    compass: {
      dist: {
        options: {
          config         : 'app/config.rb',
          require        : ['susy', 'compass-placeholder', 'compass-retina-sprites', 'toolkit', 'animation'],
          sassDir        : 'app/conf',
          cssDir         : 'app/public/styles',
          debugInfo      : true,
          noLineComments : true,
          imagesDir      : 'app/public/images'
        }
      }
    },

    translate: {
      dist: {
        options: {
          config          : './test/translations',
          requirejs       : false,
          defaultLanguage : 'en', // grunt-translate use it to update translation.
          output          : './test/translations/output',
          src             : ['./test/example/**/*.js'],
          interface: {
            autoOpen : false,
            port     : 3000
          }
        }
      }
    },

    // Configuration to be run (and then tested)
    regarde: {
      txt: {
        files: '**/*.txt',
        tasks: ['livereload']
      }
    },

    dot: {
      interface: {
        options: {
          variable  : 'tmpl',
          requirejs : true,
          node      : true
        },
        src  : ['interface/**/*.dot'],
        dest : 'interface/public/templates/tmpl.js'
      },

      jsPlugin : {
        options: {
          variable  : 'tmpl',
          requirejs : false,
          node      : true
        },
        src  : ['plugins/**/*.{dot,part}'],
        dest : 'plugins/javascript/templates/build/tmpl.js'
      }
    },

    open : {
      translation : {
        path: 'http://localhost:3000/translations'
      }
    },

    jsdoc : {
      dist : {
        src: [
          'app/**/*.js',
          '!app/vendor/**',
          'src/**/*.js',
          'tasks/**/*.js'
        ],
        options: {
          destination: 'docs'
        }
      }
    },

    watch: {
      templates: {
        files: [
          '**/*.dot',
          '**/*.part'
        ],
        tasks: ['dot']
      },

      jshint: {
        files: [
          '**/*.js',
          'Gruntfile.js',
          'bin/**/*.js',
          'tasks/**/*.js'
        ],
        tasks: ['jshint']
      },

      compass: {
        files: ['app/**/*.scss'],
        tasks: ['compass']
      }
    }

  });
  // Load local tasks.
  if(gt) {
    grunt.task.loadTasks('tasks/translate.js'); // Some grunt trick
  } else {
    grunt.task.loadTasks('tasks'); // Some grunt trick
  }

  // Load npm tasks
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-dot-compiler');
  grunt.loadNpmTasks('grunt-contrib-connect');

  // Default task.
  grunt.registerTask('default', 'jshint translate:update translate:compile test');

};
<commit_msg>Removed grunt tricks<commit_after>

var folderMount = function folderMount(connect, point) {
  return connect.static(path.resolve(point));
};

module.exports = function(grunt) {

  'use strict';

  // Project configuration.
  grunt.initConfig({

    jshint: {
      options: {
        curly    : true,
        eqeqeq   : true,
        loopfunc : true,
        forin    : false,
        immed    : true,
        latedef  : true,
        newcap   : true,
        noarg    : true,
        sub      : true,
        undef    : true,
        boss     : true,
        eqnull   : true,
        node     : true,
        es5      : true,
        supernew : true,
        laxbreak : true,
        strict   : false,
        expr     : true,
        globals: {
          gt        : true,
          describe  : true,
          it        : true,
          before    : true,
          define    : true,
          Modernizr : true,
          requirejs : true,
          alert     : true,
          window    : true,
          opt       : true,
          document  : true,
          tmpl      : true,
          $         : true
        }
      },

      files: [
        'grunt.js',
        'app/**/*.js',
        'lib/**/*.js',
        '!app/build/tmpl.js',
        '!app/vendor/**',
        '!app/public/templates/**/*.js',
        'src/**/*.js'
      ]
    },

    compass: {
      dist: {
        options: {
          config         : 'app/config.rb',
          require        : ['susy', 'compass-placeholder', 'compass-retina-sprites', 'toolkit', 'animation'],
          sassDir        : 'app/conf',
          cssDir         : 'app/public/styles',
          debugInfo      : true,
          noLineComments : true,
          imagesDir      : 'app/public/images'
        }
      }
    },

    translate: {
      dist: {
        options: {
          config          : './test/translations',
          requirejs       : false,
          defaultLanguage : 'en', // grunt-translate use it to update translation.
          output          : './test/translations/output',
          src             : ['./test/example/**/*.js'],
          interface: {
            autoOpen : false,
            port     : 3000
          }
        }
      }
    },

    // Configuration to be run (and then tested)
    regarde: {
      txt: {
        files: '**/*.txt',
        tasks: ['livereload']
      }
    },

    dot: {
      interface: {
        options: {
          variable  : 'tmpl',
          requirejs : true,
          node      : true
        },
        src  : ['interface/**/*.dot'],
        dest : 'interface/public/templates/tmpl.js'
      },

      jsPlugin : {
        options: {
          variable  : 'tmpl',
          requirejs : false,
          node      : true
        },
        src  : ['plugins/**/*.{dot,part}'],
        dest : 'plugins/javascript/templates/build/tmpl.js'
      }
    },

    open : {
      translation : {
        path: 'http://localhost:3000/translations'
      }
    },

    jsdoc : {
      dist : {
        src: [
          'app/**/*.js',
          '!app/vendor/**',
          'src/**/*.js',
          'tasks/**/*.js'
        ],
        options: {
          destination: 'docs'
        }
      }
    },

    watch: {
      templates: {
        files: [
          '**/*.dot',
          '**/*.part'
        ],
        tasks: ['dot']
      },

      jshint: {
        files: [
          '**/*.js',
          'Gruntfile.js',
          'bin/**/*.js',
          'tasks/**/*.js'
        ],
        tasks: ['jshint']
      },

      compass: {
        files: ['app/**/*.scss'],
        tasks: ['compass']
      }
    }

  });

  // Load npm tasks
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-dot-compiler');
  grunt.loadNpmTasks('grunt-contrib-connect');

  // Default task.
  grunt.registerTask('default', 'jshint translate:update translate:compile test');

};
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

    function ucfirst(str) {
      return str.charAt(0).toUpperCase()+str.slice(1)
    }

    function getFiles(ext) {

      return function(dep) {

        var rep = "jsyg" + (dep == "jsyg" ?  "" : "-"+dep);
        var file = "JSYG" + (dep == "jsyg" ? "" : "."+(dep == "fetch" ? dep : ucfirst(dep)) ) + "."+ext

        return "node_modules/"+rep+"/"+file;
      }
    }

    var cssFiles = ["boundingbox","editor","fulleditor","selection","texteditor","zoomandpan"].map( getFiles("css") );
    cssFiles.push("styles.css");

    var jsFiles = ["jsyg","editor","texteditor","zoomandpan","pathdrawer","polylinedrawer","shapedrawer","undoredo","fetch"].map ( getFiles("js") );
    jsFiles.push("JSYG.FullEditor.js");

    grunt.initConfig({
      concatJS: {
          options: {
            separator: '\n\n'
          },
          dist: {
            src: jsFiles,
            dest: 'dist/JSYG.FullEditor.js'
          }
      },

      concatCSS: {
        options: {
            separator: '\n\n'
          },
          dist: {
            src: jsFiles,
            dest: 'dist/JSYG.FullEditor.css'
          }
      }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');

    grunt.registerTask('default', ['concatJS','concatCSS'] );

};
<commit_msg>Revert "essai de concaténation"<commit_after>'use strict';

module.exports = function (grunt) {

    var cssFiles = [
      "jsyg-boundingbox/JSYG.BoundingBox.css",
      "jsyg-editor/JSYG.Editor.css",
      "jsyg-fulleditor/JSYG.FullEditor.css",
      "jsyg-selection/JSYG.Selection.css",
      "jsyg-texteditor/JSYG.TextEditor.css",
      "jsyg-zoomAndPan/JSYG.ZoomAndPan.css",
    ]

    cssFiles = cssFiles.map(function(file) { return "bower_components/"+file; })

    cssFiles.push("styles.css")

    grunt.initConfig({
      concat:{
        options: {
            separator: '\n\n',
          },
          dist: {
            src: cssFiles,
            dest: 'JSYG.FullEditor.css'
          }
      }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');

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

};
<|endoftext|>


<commit_before>/*
 * grunt-bing-translate-proxy
 * https://github.com/nicholasrice/grunt-bing-translate-proxy
 *
 * Copyright (c) 2016 Nicholas Rice
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Before generating any new files, remove any previously-created files.
    clean: {
      tests: ['tmp']
    },

    // Configuration to be run (and then tested).
    bing_translate_proxy: {
      default_options: {
        options: {
        },
        files: {
          'tmp/default_options': ['test/fixtures/testing', 'test/fixtures/123']
        }
      },
      custom_options: {
        options: {
          separator: ': ',
          punctuation: ' !!!'
        },
        files: {
          'tmp/custom_options': ['test/fixtures/testing', 'test/fixtures/123']
        }
      }
    },

    // Unit tests.
    nodeunit: {
      tests: ['test/*_test.js']
    }

  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');

  // Whenever the "test" task is run, first clean the "tmp" dir, then run this
  // plugin's task(s), then test the result.
  grunt.registerTask('test', ['clean', 'bing_translate_proxy', 'nodeunit']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['jshint', 'test']);

};
<commit_msg>removing tests for now<commit_after>/*
 * grunt-bing-translate-proxy
 * https://github.com/nicholasrice/grunt-bing-translate-proxy
 *
 * Copyright (c) 2016 Nicholas Rice
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jshint: {
      all: [
        'Gruntfile.js',
        'tasks/*.js',
        // '<%= nodeunit.tests %>'
      ],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Before generating any new files, remove any previously-created files.
    clean: {
      tests: ['tmp']
    },

    // Configuration to be run (and then tested).
    bing_translate_proxy: {
      default_options: {
        options: {
        },
        files: {
          'tmp/default_options': ['test/fixtures/testing', 'test/fixtures/123']
        }
      },
      custom_options: {
        options: {
          separator: ': ',
          punctuation: ' !!!'
        },
        files: {
          'tmp/custom_options': ['test/fixtures/testing', 'test/fixtures/123']
        }
      }
    },

    // Unit tests.
    nodeunit: {
      // tests: ['test/*_test.js']
    }

  });

  // Actually load this plugin's task(s).
  grunt.loadTasks('tasks');

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');

  // Whenever the "test" task is run, first clean the "tmp" dir, then run this
  // plugin's task(s), then test the result.
  grunt.registerTask('test', ['clean', 'bing_translate_proxy']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['jshint', 'test']);

};
<|endoftext|>


<commit_before><commit_msg>working on grunt. Lunch time<commit_after>module.exports = function(grunt) {

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		uglify: {
			options: {

			},
			build: {

			}
		}
	});

	grunt.loapNpmTasks();
	grunt.registerTask();

}:<|endoftext|>


<commit_before>/**
 * Created by ivan on 10/28/14.
 */
module.exports = function (grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        nodewebkit: {
            options: {
                appName: 'Frosch',
                platforms: ['win', 'osx64', 'linux64', 'linux32'],
                version: '0.12.2',
                dontMerge: true,
                buildDir: './bin' // Where the build version of my node-webkit app is saved
            },
            src: [
                './main.html',
                './package.json',
                './README.md',
                './LICENSE',
                './assets/fonts/**/*',
                './assets/img/**/*',
                './assets/lang/**/*',
                './assets/sounds/**/*',
                './assets/videos/LEAME.txt',

                './components/jquery/dist/jquery.js',
                './components/less/dist/less.js',
                './components/angular/angular.js',
                './components/angular-translate/angular-translate.js',
                './components/angular-translate-loader-static-files/angular-translate-loader-static-files.js',
                './components/angular-ui-router/release/angular-ui-router.js',
                './components/angular-hotkeys/build/hotkeys.js',
                './components/angular-sanitize/angular-sanitize.js',
                './components/videogular/videogular.js',

                './components/frosch/frosch.min.js',

                './config/**/*',
                './css/**/*',
                './html/**/*',
                './js/**/*'
            ] // Your node-webkit app
        }
    });

    grunt.task.loadTasks('./tasks');

};<commit_msg>Grunt ajustado<commit_after>/**
 * Created by ivan on 10/28/14.
 */
module.exports = function (grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        nodewebkit: {
            options: {
                appName: 'Frosch',
                platforms: ['win', 'osx64', 'linux64', 'linux32'],
                version: '0.12.2',
                dontMerge: true,
                buildDir: './bin' // Where the build version of my node-webkit app is saved
            },
            src: [
                './main.html',
                './package.json',
                './README.md',
                './LICENSE',
                './assets/fonts/**/*',
                './assets/img/**/*',
                './assets/lang/**/*',
                './assets/sounds/**/*',
                './assets/videos/LEAME.txt',

                './components/jquery/dist/jquery.js',
                './components/less/dist/less.js',
                './components/angular/angular.js',
                './components/angular-translate/angular-translate.js',
                './components/angular-translate-loader-static-files/angular-translate-loader-static-files.js',
                './components/angular-ui-router/release/angular-ui-router.js',
                './components/angular-hotkeys/build/hotkeys.js',
                './components/angular-sanitize/angular-sanitize.js',
                './components/videogular/videogular.js',

                './components/frosch/frosch.min.js',

                './node_modules/home-or-tmp/**/*',

                './config/**/*',
                './css/**/*',
                './html/**/*',
                './js/**/*'
            ] // Your node-webkit app
        }
    });

    grunt.task.loadTasks('./tasks');

};<|endoftext|>


<commit_before>var mountFolder = function(connect, dir) {
    return connect.static(require('path').resolve(dir));
};
module.exports = function(grunt) {
    'use strict';
    var swabstackConfig = {
        app: 'app',
        dist: 'dist',
        test: 'test'
    };
    grunt.initConfig({
        swabstack: swabstackConfig,
        compass: {
            app: {
                options: {
                    'config': './<%= swabstack.app %>/config.rb',
                    'cssDir': './<%= swabstack.app %>/assets/css',
                    'sassDir': './<%= swabstack.app %>/assets/scss',
                    'output-style': 'expanded'
                }
            }
        },
        watch: {
            compass: {
                files: ['<%= swabstack.app %>/assets/scss/app.scss'],
                tasks: ['compass:app']
            },
            coffee: {
                files: ['<%= swabstack.app %>/assets/coffee/{,**/}*.coffee'],
                tasks: ['coffee:glob_to_multiple','shell:mocha-phantomjs']
            },
            tests: {
                files: ['<%= swabstack.test %>/coffee/*.coffee'],
                tasks: ['coffee:testcoffee','shell:mocha-phantomjs',
]
            },
            templates: {
                files: ['<%= swabstack.app %>}/assets/**/templates/*.tpl'],
                tasks: ['copy:templates', 'coffe:glob_to_multiple']
            },
            vendorjs: {
                files: ['<%= swabstack.app %>/assets/js/**/*.js'],
                tasks: ['copy:vendorjs']
            },
            indextemplate: {
                files: ['<%= swabstack.app %>/index.html'],
                tasks: ['targethtml:app']
            },
            livereload: {
                files: [

                    '<%= swabstack.app %>/index.html',
                    '{.tmp,<%= swabstack.app %>}/assets/css/{,**/}*.css',
                    '{.tmp,<%= swabstack.app %>}/assets/js/{,**/}*.js',
                    '{.tmp,<%= swabstack.app %>}/assets/**/templates/{,**/}*.tpl'
                ],
                options: {
                    livereload: true
                }
            }
        },

        // express app
        express: {
            options: {
                // Override defaults here
                port: '9000'
            },
            dev: {
                options: {
                    script: 'server/app.js'
                }
            },
            dist: {
                options: {
                    script: 'server/app.js'
                }
            },
            test: {
                options: {
                    script: 'server/app.js'
                }
            }
        },
        // generate html based on target
        targethtml: {
            app: {
                files: {
                    '<%= swabstack.app %>/index.html': '<%= swabstack.app %>/swabcast.html'
                }
            },
            dist: {
                files: {
                    './<%= swabstack.dist %>/index.html': '<%= swabstack.app %>/swabcast.html'
                }
            }
        },

        // connect server
        connect: {
            testserver: {
                options: {
                    port: 1234,
                    base: './'
                }
            }
        },
        // coffeescript
        coffee: {
            glob_to_multiple: {
                expand: true,
                flatten: false,
                bare: true,
                cwd: '<%= swabstack.app %>/assets/coffee/',
                src: ['**/*.coffee', '*.coffee'],
                dest: '<%= swabstack.app %>/assets/js/',
                ext: '.js'
            },
            configs: {
                expand: true,
                flatten: false,
                bare: true,
                cwd: '<%= swabstack.app %>/assets/',
                src: ['*.coffee'],
                dest: '<%= swabstack.app %>/assets/',
                ext: '.js'
            },

            testcoffee: {
                expand: true,
                flatten: true,
                bare: true,
                cwd: './',
                src: ['test/coffee/*.coffee'],
                dest: 'test/spec/',
                ext: '.js'
            }
        },
        //copy templates
        copy: {
            templates: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/coffee/',
                    src: ['**/*.{tpl,md}'],
                    dest: '<%= swabstack.app %>/assets/js/'
                }]
            },
            vendorjs: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/coffee/',
                    src: ['**/*.js'],
                    dest: '<%= swabstack.app %>/assets/js/'
                }]
            },
            docs: {
                files: [{
                    expand: true,
                    cwd: './',
                    src: ['docs/***'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            assets: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/',
                    src: ['mp3/**.*', 'img/**.*'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            components: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/',
                    src: ['js/vendor/modernizr.js', 'css/foundation-icon*.*', 'svgs/**.*', 'css/images/**.*'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            optimizer: {
                files: [{
                    expand: true,
                    cwd: './',
                    src: ['<%= swabstack.app %>/assets/bower_components/requirejs-tpl/tools/r.js'],
                    dest: '<%= swabstack.app %>/'
                }]
            }//,
            // requireBuilt: { //since having issues getting nested dependancys working with grunt task
            //     // first from app folder, run 'node r.js -o assets/js/build.js'
            //     files: [{
            //         src: ['./<%= swabstack.app %>/assets/require_main_built.js'],
            //         dest: './<%= swabstack.dist %>/require_main_built.js'
            //     }]
            // }
        },
        cssmin: {
            combine: {
                options: {
                    banner: '/* Like a ninja */'
                },
                files: {
                    '<%= swabstack.dist %>/css/combined.min.css': ['./<%= swabstack.app %>/assets/css/app.css', './<%= swabstack.app %>/assets/css/jquery-ui-1.10.0.custom.css']
                }
            }
        },
        docco: {
            coffeescript: {
                src: ['<%= swabstack.app %>/assets/coffee/**/*.coffee'],
                options: {
                    output: './docs/CoffeScript/'
                }
            },
            javascript: {
                src: ['<%= swabstack.app %>/assets/js/**/*.js'],
                options: {
                    output: './docs/Javascript/'
                }
            },
            server: {
                src: ['server/app.js'],
                options: {
                    output: './docs/Server/'
                }
            }
        },
        shell: {
            'mocha-phantomjs': {
                command: 'mocha-phantomjs -R dot http://localhost:1234/test/TestRunner.html',
                options: {
                    stdout: true,
                    stderr: true
                }
            },
            'buildRequire': {
                command: 'node r.js -o assets/build.js',
                options: {
                    stdout: true,
                    execOptions: {
                        cwd: 'app'
                    }
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-express-server');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-docco');
    grunt.loadNpmTasks('grunt-targethtml');
    grunt.loadNpmTasks('grunt-shell');

    //registered task 'a' so i dont have to scroll down when running from the sublime grunt plugin
    //same as default

    grunt.registerTask('default', [
        'dev',
        'connect:testserver',
        'express:dev',
        'shell:mocha-phantomjs',
        'watch'
    ]);

    grunt.task.registerTask('dev', 'subset of common development tasks used in other tasks', function(){
        grunt.task.run( [
            'copy:vendorjs',
            'copy:templates', // when starting, copy any templates that may have been added
            'compass:app',
            'coffee', //compile any coffescript files that may have changed
            'targethtml:app'
        ]);
    });

    grunt.task.registerTask('test', 'for writing tests, only watches test folder and runs on change', function(){
        grunt.task.run( [
            'coffee:testcoffee',
            'connect:testserver',
            'shell:mocha-phantomjs',
            'watch:tests'
        ]);
    });

    grunt.task.registerTask('docs', 'generates docs from source and adds to dist/ ', function(){
        grunt.task.run( [
            'docco',
            'copy:docs'
        ]);
    });

    grunt.task.registerTask('build', 'creates optimized distribution', function(){
        grunt.task.run( [
            'copy:templates',
            'copy:components',
            'copy:assets',
            'coffee:configs',
            'copy:optimizer',
            'shell:buildRequire',
            'targethtml:dist',
            'compass:app',
            'cssmin',
            // 'copy:requireBuilt'
        ]);
    });

};
<commit_msg> edge case<commit_after>var mountFolder = function(connect, dir) {
    return connect.static(require('path').resolve(dir));
};
module.exports = function(grunt) {
    'use strict';
    var swabstackConfig = {
        app: 'app',
        dist: 'dist',
        test: 'test'
    };
    grunt.initConfig({
        swabstack: swabstackConfig,
        compass: {
            app: {
                options: {
                    'config': './<%= swabstack.app %>/config.rb',
                    'cssDir': './<%= swabstack.app %>/assets/css',
                    'sassDir': './<%= swabstack.app %>/assets/scss',
                    'output-style': 'expanded'
                }
            }
        },
        watch: {
            compass: {
                files: ['<%= swabstack.app %>/assets/scss/app.scss'],
                tasks: ['compass:app']
            },
            coffee: {
                files: ['<%= swabstack.app %>/assets/coffee/{,**/}*.coffee'],
                tasks: ['coffee:glob_to_multiple','shell:mocha-phantomjs']
            },
            tests: {
                files: ['<%= swabstack.test %>/coffee/*.coffee'],
                tasks: ['coffee:testcoffee','shell:mocha-phantomjs',
]
            },
            templates: {
                files: ['<%= swabstack.app %>}/assets/**/templates/*.tpl'],
                tasks: ['copy:templates', 'coffe:glob_to_multiple']
            },
            vendorjs: {
                files: ['<%= swabstack.app %>/assets/js/**/*.js'],
                tasks: ['copy:vendorjs']
            },
            indextemplate: {
                files: ['<%= swabstack.app %>/index.html'],
                tasks: ['targethtml:app']
            },
            livereload: {
                files: [

                    '<%= swabstack.app %>/index.html',
                    '{.tmp,<%= swabstack.app %>}/assets/css/{,**/}*.css',
                    '{.tmp,<%= swabstack.app %>}/assets/js/{,**/}*.js',
                    '{.tmp,<%= swabstack.app %>}/assets/**/templates/{,**/}*.tpl'
                ],
                options: {
                    livereload: true
                }
            }
        },

        // express app
        express: {
            options: {
                // Override defaults here
                port: '9000'
            },
            dev: {
                options: {
                    script: 'server/app.js'
                }
            },
            dist: {
                options: {
                    script: 'server/app.js'
                }
            },
            test: {
                options: {
                    script: 'server/app.js'
                }
            }
        },
        // generate html based on target
        targethtml: {
            app: {
                files: {
                    '<%= swabstack.app %>/index.html': '<%= swabstack.app %>/swabcast.html'
                }
            },
            dist: {
                files: {
                    './<%= swabstack.dist %>/index.html': '<%= swabstack.app %>/swabcast.html'
                }
            }
        },

        // connect server
        connect: {
            testserver: {
                options: {
                    port: 1234,
                    base: './'
                }
            }
        },
        // coffeescript
        coffee: {
            glob_to_multiple: {
                expand: true,
                flatten: false,
                bare: true,
                cwd: '<%= swabstack.app %>/assets/coffee/',
                src: ['**/*.coffee', '*.coffee'],
                dest: '<%= swabstack.app %>/assets/js/',
                ext: '.js'
            },
            configs: {
                expand: true,
                flatten: false,
                bare: true,
                cwd: '<%= swabstack.app %>/assets/',
                src: ['*.coffee'],
                dest: '<%= swabstack.app %>/assets/',
                ext: '.js'
            },

            testcoffee: {
                expand: true,
                flatten: true,
                bare: true,
                cwd: './',
                src: ['test/coffee/*.coffee'],
                dest: 'test/spec/',
                ext: '.js'
            }
        },
        //copy templates
        copy: {
            templates: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/coffee/',
                    src: ['**/*.{tpl,md}'],
                    dest: '<%= swabstack.app %>/assets/js/'
                }]
            },
            vendorjs: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/coffee/',
                    src: ['**/*.js'],
                    dest: '<%= swabstack.app %>/assets/js/'
                }]
            },
            docs: {
                files: [{
                    expand: true,
                    cwd: './',
                    src: ['docs/***'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            assets: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/',
                    src: ['mp3/**.*', 'img/**.*'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            components: {
                files: [{
                    expand: true,
                    cwd: '<%= swabstack.app %>/assets/',
                    src: ['js/vendor/modernizr.js', 'css/foundation-icon*.*', 'svgs/**.*', 'css/images/**.*'],
                    dest: '<%= swabstack.dist %>/'
                }]
            },
            optimizer: {
                files: [{
                    expand: true,
                    cwd: './',
                    src: ['<%= swabstack.app %>/assets/bower_components/requirejs-tpl/tools/r.js'],
                    dest: '<%= swabstack.app %>/'
                }]
            }//,
            // requireBuilt: { //since having issues getting nested dependancys working with grunt task
            //     // first from app folder, run 'node r.js -o assets/js/build.js'
            //     files: [{
            //         src: ['./<%= swabstack.app %>/assets/require_main_built.js'],
            //         dest: './<%= swabstack.dist %>/require_main_built.js'
            //     }]
            // }
        },
        cssmin: {
            combine: {
                options: {
                    banner: '/* Like a ninja */'
                },
                files: {
                    '<%= swabstack.dist %>/css/combined.min.css': ['./<%= swabstack.app %>/assets/css/app.css', './<%= swabstack.app %>/assets/css/jquery-ui-1.10.0.custom.css']
                }
            }
        },
        docco: {
            coffeescript: {
                src: ['<%= swabstack.app %>/assets/coffee/**/*.coffee'],
                options: {
                    output: './docs/CoffeScript/'
                }
            },
            javascript: {
                src: ['<%= swabstack.app %>/assets/js/**/*.js'],
                options: {
                    output: './docs/Javascript/'
                }
            },
            server: {
                src: ['server/app.js'],
                options: {
                    output: './docs/Server/'
                }
            }
        },
        shell: {
            'mocha-phantomjs': {
                command: 'mocha-phantomjs -R dot http://localhost:1234/test/TestRunner.html',
                options: {
                    stdout: true,
                    stderr: true
                }
            },
            'buildRequire': {
                command: 'node r.js -o assets/build.js',
                options: {
                    stdout: true,
                    execOptions: {
                        cwd: './app'
                    }
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-express-server');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-docco');
    grunt.loadNpmTasks('grunt-targethtml');
    grunt.loadNpmTasks('grunt-shell');

    //registered task 'a' so i dont have to scroll down when running from the sublime grunt plugin
    //same as default

    grunt.registerTask('default', [
        'dev',
        'connect:testserver',
        'express:dev',
        'shell:mocha-phantomjs',
        'watch'
    ]);

    grunt.task.registerTask('dev', 'subset of common development tasks used in other tasks', function(){
        grunt.task.run( [
            'copy:vendorjs',
            'copy:templates', // when starting, copy any templates that may have been added
            'compass:app',
            'coffee', //compile any coffescript files that may have changed
            'targethtml:app'
        ]);
    });

    grunt.task.registerTask('test', 'for writing tests, only watches test folder and runs on change', function(){
        grunt.task.run( [
            'coffee:testcoffee',
            'connect:testserver',
            'shell:mocha-phantomjs',
            'watch:tests'
        ]);
    });

    grunt.task.registerTask('docs', 'generates docs from source and adds to dist/ ', function(){
        grunt.task.run( [
            'docco',
            'copy:docs'
        ]);
    });

    grunt.task.registerTask('build', 'creates optimized distribution', function(){
        grunt.task.run( [
            'copy:templates',
            'copy:components',
            'copy:assets',
            'coffee:configs',
            'copy:optimizer',
            'shell:buildRequire',
            'targethtml:dist',
            'compass:app',
            'cssmin',
            // 'copy:requireBuilt'
        ]);
    });

};
<|endoftext|>


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

module.exports = function (grunt) {
  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    builddir: '.tmp/build',
    tmpdir: '.tmp',
    srcDir: './src',
    src: '<%= srcDir %>/**/*.js',
    pkg: grunt.file.readJSON('package.json'),
    buildtag: '-dev-' + grunt.template.today('yyyy-mm-dd'),
    meta: {
      banner: '/**\n' +
        ' * <%= pkg.name %>\n' +
        ' * Copyright <%= pkg.author %> '+grunt.template.today('yyyy')+'\n' +
        ' * <%= pkg.description %>\n' +
        ' * @version v<%= pkg.version %><%= buildtag %>\n' +
        ' * @link <%= pkg.homepage %>\n' +
        ' * @license <%= pkg.license %>\n' +
        ' */'
    },
    clean: {
      ngdocs: '<%= tmpdir %>/site/**/*'
    },
    concat: {
      options: {
        banner: '<%= meta.banner %>\n\n'+
                '/* commonjs package manager support (eg componentjs) */\n'+
                'if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){\n'+
                '  module.exports = \'ui.router\';\n'+
                '}\n\n'+
                '(function (window, angular, undefined) {\n',
        footer: '})(window, window.angular);'
      },
      build: {
        src: '<%= src %>',
        dest: '<%= builddir %>/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= meta.banner %>\n'
      },
      build: {
        files: {
          '<%= builddir %>/<%= pkg.name %>.min.js': ['<banner:meta.banner>', '<%= concat.build.dest %>'],
          '<%= builddir %>/<%= pkg.name %>.tpls.min.js': ['<banner:meta.banner>', '<%= builddir %>/<%= pkg.name %>.tpls.js']
        }
      }
    },
    release: {
      files: ['<%= pkg.name %>.js', '<%= pkg.name %>.min.js'],
      src: '<%= builddir %>',
      dest: 'release'
    },
    jshint: {
      all: ['Gruntfile.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js'],
      options: {
        eqnull: true
      }
    },
    watch: {
      gruntfile: {
        files: ['Gruntfile.js']
      },
      ngdocs: {
        files: ['<%= src %>','ngdoc_assets/**/*'],
        tasks: ['docs'],
        options: {
          livereload: 35730,
          spawn: false
        }
      },
      guide: {
        files: ['docs/source/*.rst'],
        tasks: ['shell:guide'],
        options: {
          livereload: 35731,
          spawn: false
        }
      },
      src: {
        files: ['<%= src %>'],
        tasks: ['build']
      },
      develop: {
        files: ['<%= srcDir %>/*.{js,html}'],
        tasks: ['dist']
      }
    },
    connect: {
      ngdocs: {
        options: {
          port: 9001,
          base: '<%= tmpdir %>/site',
          livereload: 35730
        }
      },
      guide: {
        options: {
          port: 9002,
          livereload: 35731,
          base: ['docs/build/html']
        }
      }
    },
    open: {
      docs: {
        url: 'http://localhost:<%= connect.ngdocs.options.port %>'
      },
      guide:{
        url: 'http://localhost:<%= connect.guide.options.port %>'
      }
    },
    ngdocs: {
      options: {
        dest: '<%= tmpdir %>/site',
        scripts: [
          'angular.js'
        ],
        styles: [ 'ngdoc_assets/stormpath-angular.css' ],
        html5Mode: false,
        title: 'stormpath-sdk-angularjs',
        startPage: '/api',
        navTemplate: 'ngdoc_assets/nav.html'
      },
      api: {
        src: ['<%= src %>','ngdoc_assets/index.ngdoc'],
        title: 'API Reference',
        api: true
      },
      server: {
        src: ['ngdoc_assets/server/index.ngdoc'],
        title: 'Server Integration Guide',
        api: false
      }
    },
    copy: {
      dist: {
        files:[{
          expand: true,
          flatten: true,
          src: '.tmp/build/*',
          dest: 'dist/'
        }]
      },
    },
    html2js: {
      options: {
        module: 'stormpath.templates',
        htmlmin: {
          collapseBooleanAttributes: false,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeComments: true,
          removeEmptyAttributes: false,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: false,
          removeStyleLinkTypeAttributes: false
        }
      },
      main: {
        src: ['src/**/*.tpl.html'],
        dest: '<%= builddir %>/<%= pkg.name %>.tpls.js'
      }
    },
    shell: {
      guide: {
        command: 'make clean && make html',
        options:{
          execOptions: {
            cwd: 'docs/'
          }
        }
      }
    }
  });

  grunt.registerTask('docs', 'Builds the Guide and ngDocs for deployment',function () {
    grunt.task.run(
      ['clean:ngdocs','ngdocs','shell:guide']
    );
  });

  grunt.registerTask('serve',
    'Serves the API documentation, and live reloads as you edit it',
    ['ngdocs','connect:ngdocs','open:docs','watch:ngdocs']
  );

  grunt.registerTask('build', 'Perform a normal build', ['concat', 'html2js','uglify','docs']);

  grunt.registerTask('dist', 'Perform a distribution', ['build', 'copy:dist']);

  grunt.registerTask('develop',
    'Build source and distribution, useful if you are modifying this module as a linked modue while developging another module',
    ['watch:develop']
  );

  grunt.registerTask('guide',
    'Serve and livereload the Guide from the docs/ folder',
    ['connect:guide','open:guide','watch:guide']
  );
};
<commit_msg>watch docs theme for changes<commit_after>// Generated on 2015-01-02 using generator-angular-fullstack 2.0.13
'use strict';

module.exports = function (grunt) {
  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    builddir: '.tmp/build',
    tmpdir: '.tmp',
    srcDir: './src',
    src: '<%= srcDir %>/**/*.js',
    pkg: grunt.file.readJSON('package.json'),
    buildtag: '-dev-' + grunt.template.today('yyyy-mm-dd'),
    meta: {
      banner: '/**\n' +
        ' * <%= pkg.name %>\n' +
        ' * Copyright <%= pkg.author %> '+grunt.template.today('yyyy')+'\n' +
        ' * <%= pkg.description %>\n' +
        ' * @version v<%= pkg.version %><%= buildtag %>\n' +
        ' * @link <%= pkg.homepage %>\n' +
        ' * @license <%= pkg.license %>\n' +
        ' */'
    },
    clean: {
      ngdocs: '<%= tmpdir %>/site/**/*'
    },
    concat: {
      options: {
        banner: '<%= meta.banner %>\n\n'+
                '/* commonjs package manager support (eg componentjs) */\n'+
                'if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){\n'+
                '  module.exports = \'ui.router\';\n'+
                '}\n\n'+
                '(function (window, angular, undefined) {\n',
        footer: '})(window, window.angular);'
      },
      build: {
        src: '<%= src %>',
        dest: '<%= builddir %>/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= meta.banner %>\n'
      },
      build: {
        files: {
          '<%= builddir %>/<%= pkg.name %>.min.js': ['<banner:meta.banner>', '<%= concat.build.dest %>'],
          '<%= builddir %>/<%= pkg.name %>.tpls.min.js': ['<banner:meta.banner>', '<%= builddir %>/<%= pkg.name %>.tpls.js']
        }
      }
    },
    release: {
      files: ['<%= pkg.name %>.js', '<%= pkg.name %>.min.js'],
      src: '<%= builddir %>',
      dest: 'release'
    },
    jshint: {
      all: ['Gruntfile.js', 'src/*.js', '<%= builddir %>/<%= pkg.name %>.js'],
      options: {
        eqnull: true
      }
    },
    watch: {
      gruntfile: {
        files: ['Gruntfile.js']
      },
      ngdocs: {
        files: ['<%= src %>','ngdoc_assets/**/*'],
        tasks: ['docs'],
        options: {
          livereload: 35730,
          spawn: false
        }
      },
      guide: {
        files: ['docs/source/*.rst','docs/source/_themes/stormpath/*/**'],
        tasks: ['shell:guide'],
        options: {
          livereload: 35731,
          spawn: false
        }
      },
      src: {
        files: ['<%= src %>'],
        tasks: ['build']
      },
      develop: {
        files: ['<%= srcDir %>/*.{js,html}'],
        tasks: ['dist']
      }
    },
    connect: {
      ngdocs: {
        options: {
          port: 9001,
          base: '<%= tmpdir %>/site',
          livereload: 35730
        }
      },
      guide: {
        options: {
          port: 9002,
          livereload: 35731,
          base: ['docs/build/html']
        }
      }
    },
    open: {
      docs: {
        url: 'http://localhost:<%= connect.ngdocs.options.port %>'
      },
      guide:{
        url: 'http://localhost:<%= connect.guide.options.port %>'
      }
    },
    ngdocs: {
      options: {
        dest: '<%= tmpdir %>/site',
        scripts: [
          'angular.js'
        ],
        styles: [ 'ngdoc_assets/stormpath-angular.css' ],
        html5Mode: false,
        title: 'stormpath-sdk-angularjs',
        startPage: '/api',
        navTemplate: 'ngdoc_assets/nav.html'
      },
      api: {
        src: ['<%= src %>','ngdoc_assets/index.ngdoc'],
        title: 'API Reference',
        api: true
      },
      server: {
        src: ['ngdoc_assets/server/index.ngdoc'],
        title: 'Server Integration Guide',
        api: false
      }
    },
    copy: {
      dist: {
        files:[{
          expand: true,
          flatten: true,
          src: '.tmp/build/*',
          dest: 'dist/'
        }]
      },
    },
    html2js: {
      options: {
        module: 'stormpath.templates',
        htmlmin: {
          collapseBooleanAttributes: false,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeComments: true,
          removeEmptyAttributes: false,
          removeRedundantAttributes: true,
          removeScriptTypeAttributes: false,
          removeStyleLinkTypeAttributes: false
        }
      },
      main: {
        src: ['src/**/*.tpl.html'],
        dest: '<%= builddir %>/<%= pkg.name %>.tpls.js'
      }
    },
    shell: {
      guide: {
        command: 'make clean && make html',
        options:{
          execOptions: {
            cwd: 'docs/'
          }
        }
      }
    }
  });

  grunt.registerTask('docs', 'Builds the Guide and ngDocs for deployment',function () {
    grunt.task.run(
      ['clean:ngdocs','ngdocs','shell:guide']
    );
  });

  grunt.registerTask('serve',
    'Serves the API documentation, and live reloads as you edit it',
    ['ngdocs','connect:ngdocs','open:docs','watch:ngdocs']
  );

  grunt.registerTask('build', 'Perform a normal build', ['concat', 'html2js','uglify','docs']);

  grunt.registerTask('dist', 'Perform a distribution', ['build', 'copy:dist']);

  grunt.registerTask('develop',
    'Build source and distribution, useful if you are modifying this module as a linked modue while developging another module',
    ['watch:develop']
  );

  grunt.registerTask('guide',
    'Serve and livereload the Guide from the docs/ folder',
    ['connect:guide','open:guide','watch:guide']
  );
};
<|endoftext|>