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

  // Project configuration.
  var config = {
    clean: [ 'grunt_output' ],
    meta: {
      version: '0.1.0',
      api_banner: '/*! Cordova for Chrome - v<%= meta.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
        '* http://github.com/MobileChromeApps/\n' +
        '* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
        'Google Inc.; Licensed MIT */'
    },
    lint: {
      files: ['grunt.js', 'api/**/!(prefix|suffix).js']
      // TODO(agrieve): Enable linting for spec.
      // files: ['grunt.js', 'api/**/!(prefix|suffix).js', 'spec/**/!(jasmine*).js']
    },
    concat: {
      api: {
        // This should ensure that the top-level API gets included first, before any other files or subdirectories.
        src: ['<banner:meta.api_banner>', 'api/prefix.js', 'api/chrome/**/*.js', 'api/helpers/**/*.js', 'api/chrome.js', 'api/suffix.js'],
        dest: 'grunt_output/api/chromeapi.js'
      }
    },
    min: {
      api: {
        src: ['<banner:meta.api_banner>', '<config:concat.api.dest>'],
        dest: 'grunt_output/api/chromeapi.min.js'
      }
    },
    watch: {
      files: ['!(grunt_output)', '!(grunt_output)/**/*'],
      tasks: 'default'
    },
    jshint: {
      options: {
        boss: true,
        curly: true,
        eqnull: true,
        evil: true, // Complains about document.write otherwise. We still shouldn't use eval() itself.
        immed: true,
        indent: 2,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: 'single',
        sub: true,
        trailing: true,
        undef: true,
        unused: true,
        white: false,

        browser: true, // document, window, navigator, etc.
        devel: true    // console, alert, etc.
      },
      globals: {
        cordova: false,
        unsupportedApi: false,
        define: false
      }
    },
    uglify: {},
    copy: {
      spec: {
        files: {
          'grunt_output/spec/': 'spec/**' // Resolves symlinks.
        }
      },
      cordova_spec1: {
        files: {
          'grunt_output/cordova_spec/': 'spec/**'
        }
      },
      cordova_spec2: {
        files: {
          'grunt_output/cordova_spec/': [
            'integration/chrome*',
            'grunt_output/api/chromeapi.js'
          ],
          'grunt_output/cordova_spec/runtime/': [
            'integration/chrome*',
            'grunt_output/api/chromeapi.js'
          ]
        },
        options: {
          flatten: true
        }
      }
    }
  };

  grunt.initConfig(config);

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

  grunt.registerTask('spec', 'concat copy');
  grunt.registerTask('default', 'lint concat copy');
};
<commit_msg>Make grunt watch a bit smarter.<commit_after>/*global module:false*/
module.exports = function(grunt) {

  // Project configuration.
  var config = {
    clean: [ 'grunt_output' ],
    meta: {
      version: '0.1.0',
      api_banner: '/*! Cordova for Chrome - v<%= meta.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
        '* http://github.com/MobileChromeApps/\n' +
        '* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
        'Google Inc.; Licensed MIT */'
    },
    lint: {
      files: ['grunt.js', 'api/**/!(prefix|suffix).js']
      // TODO(agrieve): Enable linting for spec.
      // files: ['grunt.js', 'api/**/!(prefix|suffix).js', 'spec/**/!(jasmine*).js']
    },
    concat: {
      api: {
        // This should ensure that the top-level API gets included first, before any other files or subdirectories.
        src: ['<banner:meta.api_banner>', 'api/prefix.js', 'api/chrome/**/*.js', 'api/helpers/**/*.js', 'api/chrome.js', 'api/suffix.js'],
        dest: 'grunt_output/api/chromeapi.js'
      }
    },
    min: {
      api: {
        src: ['<banner:meta.api_banner>', '<config:concat.api.dest>'],
        dest: 'grunt_output/api/chromeapi.min.js'
      }
    },
    watch: {
      api: {
        files: ['<%= concat.api.src %>'],
        tasks: 'api copy:cordova_spec2'
      },
      spec: {
        files: ['spec/**/*', 'integration/*', 'third_party/**/*'],
        tasks: 'copy'
      }
    },
    jshint: {
      options: {
        boss: true,
        curly: true,
        eqnull: true,
        evil: true, // Complains about document.write otherwise. We still shouldn't use eval() itself.
        immed: true,
        indent: 2,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: 'single',
        sub: true,
        trailing: true,
        undef: true,
        unused: true,
        white: false,

        browser: true, // document, window, navigator, etc.
        devel: true    // console, alert, etc.
      },
      globals: {
        cordova: false,
        unsupportedApi: false,
        define: false
      }
    },
    uglify: {},
    copy: {
      spec: {
        files: {
          'grunt_output/spec/': 'spec/**' // Resolves symlinks.
        }
      },
      cordova_spec1: {
        files: {
          'grunt_output/cordova_spec/': 'spec/**'
        }
      },
      cordova_spec2: {
        files: {
          'grunt_output/cordova_spec/': [
            'integration/chrome*',
            'grunt_output/api/chromeapi.js'
          ],
          'grunt_output/cordova_spec/runtime/': [
            'integration/chrome*',
            'grunt_output/api/chromeapi.js'
          ]
        },
        options: {
          flatten: true
        }
      }
    }
  };

  grunt.initConfig(config);

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

  grunt.renameTask('watch', '_watch');
  grunt.registerTask('api', 'lint concat');
  grunt.registerTask('spec', 'api copy');
  grunt.registerTask('build', 'api copy');
  grunt.registerTask('watch', 'clean build _watch');
  grunt.registerTask('default', 'clean build');
};

{'fraction_non_alphanumeric': 0.17258629314657328, 'fraction_numerical': 0.0021677505419376354, 'mean_word_length': 1.88781896966779, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5051203', 'n_tokens_mistral': 2029, 'n_tokens_neox': 1983, 'n_words': 374}