<commit_before>module.exports = (grunt) ->
  grunt.loadNpmTasks "grunt-contrib-coffee"
  grunt.loadNpmTasks "grunt-contrib-watch"
  grunt.loadNpmTasks "grunt-contrib-uglify"
  grunt.loadNpmTasks "grunt-contrib-sass"
  grunt.loadNpmTasks "grunt-contrib-less"
  grunt.loadNpmTasks "grunt-contrib-concat"

  # Change base only after loading npm tasks
  buildDir = grunt.option('buildDir')

  grunt.initConfig

    #Compile coffeescript files
    coffee:
      front:
        sourcemap: true
        files: [{
          expand: true
          cwd: "src/coffee/"
          src: ["**.coffee"]
          dest: "#{buildDir}/front/coffee/"
          ext: ".js"
        }]

    #Compile SASS files
    sass:
      front:
        sourcemap: false
        style: 'compressed'
        files:[{
          expand: true
          cwd: "src/sass/"
          src: ["*.sass"]
          dest: "#{buildDir}/front/sass/"
          ext: ".css"
        }]

    #Compile LESS files
    less:
      front:
        sourcemap: false
        style: 'compressed'
        files:[{
          expand: true
          cwd: "src/less/"
          src: ["*.less"]
          dest: "#{buildDir}/front/less/"
          ext: ".css"
        }]


    #Assumes individual files are already minified (no further uglification/minification)
    concat:
      options:
        separator: ';'
        stripBanners: true

      compiledjs:
        src: [ "#{buildDir}/front/*/**.js" ]
        dest: "#{buildDir}/front/compiled.js"

      compiledcss:
        src: [ "#{buildDir}/front/*/**.css" ]
        dest: "#{buildDir}/front/compiled.css"

      alljs:
        src: [ "#{buildDir}/**.js", "!#{buildDir}/front/**", "#{buildDir}/front/compiled.js" ]
        dest: "#{buildDir}/front/all.js"

      allcss:
        src: [ "#{buildDir}/**.css", "!#{buildDir}/front/**", "#{buildDir}/front/compiled.js" ]
        dest: "#{buildDir}/front/all.css"


    #Published uglified version of compiled app.js
    uglify:
      options:
        mangle: false
        compress: true
        beautify: false

      front:
        files: [{
          expand: true
          cwd: "#{buildDir}/front/*.js"
          src: ["front*.js"]
          dest: "#{buildDir}"
          ext: ".min.js"
        }]


    # Watch relevant source files and perform tasks when they change
    watch:
      coffee:
        files: [ "src/coffee/**" ]
        tasks: [ "coffee:front", "concat:compiledjs", "concat:alljs", "uglify" ]

      sass:
        files: [ "src/sass/**" ]
        tasks: [ "sass:front", "concat:compiledcss", "concat:allcss" ]

      less:
        files: [ "src/less/**" ]
        tasks: [ "less:front", "concat:compiledcss", "concat:allcss" ]

      alljs:
        files: [ "#{buildDir}/**.js" ]
        tasks: [ "concat:alljs" ]

      allcss:
        files: [ "#{buildDir}/**.css" ]
        tasks: [ "concat:allcss" ]

  grunt.registerTask "default", ['coffee', 'sass', 'less', 'concat', 'uglify']
<commit_msg>Fixed bugs in Gruntfile.coffee<commit_after>module.exports = (grunt) ->
  grunt.loadNpmTasks "grunt-contrib-coffee"
  grunt.loadNpmTasks "grunt-contrib-watch"
  grunt.loadNpmTasks "grunt-contrib-uglify"
  grunt.loadNpmTasks "grunt-contrib-sass"
  grunt.loadNpmTasks "grunt-contrib-less"
  grunt.loadNpmTasks "grunt-contrib-concat"

  # Change base only after loading npm tasks
  buildDir = grunt.option('buildDir')

  grunt.initConfig

    #Compile coffeescript files
    coffee:
      front:
        sourcemap: true
        files: [{
          expand: true
          cwd: "src/coffee/"
          src: ["*.coffee"]
          dest: "#{buildDir}/front/coffee/"
          ext: ".js"
        }]

    #Compile SASS files
    sass:
      front:
        sourcemap: false
        style: 'compressed'
        files:[{
          expand: true
          cwd: "src/sass/"
          src: ["*.sass"]
          dest: "#{buildDir}/front/sass/"
          ext: ".css"
        }]

    #Compile LESS files
    less:
      front:
        sourcemap: false
        style: 'compressed'
        files:[{
          expand: true
          cwd: "src/less/"
          src: ["*.less"]
          dest: "#{buildDir}/front/less/"
          ext: ".css"
        }]


    #Assumes individual files are already minified (no further uglification/minification)
    concat:
      options:
        separator: ';'
        stripBanners: true

      compiledjs:
        src: [ "#{buildDir}/front/*/*.js" ]
        dest: "#{buildDir}/front/compiled.js"

      compiledcss:
        src: [ "#{buildDir}/front/*/*.css" ]
        dest: "#{buildDir}/front/compiled.css"

      alljs:
        src: [ "#{buildDir}/**/*.js", "!#{buildDir}/front/**/*", "#{buildDir}/front/compiled.js" ]
        dest: "#{buildDir}/front/all.js"

      allcss:
        src: [ "#{buildDir}/**/*.css", "!#{buildDir}/front/**/*", "#{buildDir}/front/compiled.css" ]
        dest: "#{buildDir}/front/all.css"


    #Published uglified version of compiled app.js
    uglify:
      options:
        mangle: false
        compress: true
        beautify: false

      front:
        files: [{
          expand: true
          cwd: "#{buildDir}/front"
          src: [ "compiled.js", "all.js" ]
          dest: "#{buildDir}"
          ext: ".min.js"
        }]


    # Watch relevant source files and perform tasks when they change
    watch:
      coffee:
        files: [ "src/coffee/**" ]
        tasks: [ "coffee:front", "concat:compiledjs", "concat:alljs", "uglify" ]

      sass:
        files: [ "src/sass/**" ]
        tasks: [ "sass:front", "concat:compiledcss", "concat:allcss" ]

      less:
        files: [ "src/less/**" ]
        tasks: [ "less:front", "concat:compiledcss", "concat:allcss" ]

      alljs:
        files: [ "#{buildDir}/**.js" ]
        tasks: [ "concat:alljs" ]

      allcss:
        files: [ "#{buildDir}/**.css" ]
        tasks: [ "concat:allcss" ]

  grunt.registerTask "default", ['coffee', 'sass', 'less', 'concat', 'uglify']

{'fraction_non_alphanumeric': 0.1631827376938638, 'fraction_numerical': 0.0, 'mean_word_length': 1.9532105525136885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1071335', 'n_tokens_mistral': 2029, 'n_tokens_neox': 1942, 'n_words': 396}