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

  var qStr = "";
  var scrub = "";
  if (grunt.option('scrub')){
    scrub = 'scrub=' + grunt.option('scrub');
  }
  var local = "";
  if (grunt.option('local')){
    local= 'local=true';
  }

  if (scrub !== "" || local !== ""){
    qStr += "?" + scrub + "&" + local;
  }

  var expressArgs = [];
  if (grunt.option('rec')){
    expressArgs.push('rec');
  }

  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // This line makes your node configurations available for use
    pkg: grunt.file.readJSON('package.json'),

    jshint: {
      myFiles: ['Gruntfile.js',
                'www/js/app.js',
                'www/js/**/*.js',],
      test: [
        'tests/**/*.js',
        '!tests/coverage/**/*.*'
        ]
    },

    compress: {
      options :{
        archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
      },
      dev: {
        src: ['www/**',
              // don't include  files that are needed only for local dev/test
              '!www/index.html',
              '!www/index.tpl.html',
              '!www/js/services/**',
              '!www/js/controllers/**',
              '!www/**/*.log'],
        expand: true
      },
      prod: {
        files :[
          {
            src: [
              'www/**',
              'www/lib/js/ng-cordova.min.js',
              // don't include js that we have minified
              '!www/js/*',
              // add any libs that you do want included here.
              '!www/index.html',
              '!www/index.tpl.html',
              '!www/js/services/**',
              '!www/js/controllers/**',
              '!www/**/*.log'],
            expand: true
          },
          {
            flatten:true,
            expand: true,
            src: ['dest/js/*'],
            dest : 'www/js'
          }
        ]
      }
    },

    uglify : {
      prod: {
        options: {
          mangle: false,
          drop_console: true,
          banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %>*/\n' +
            '/* Copyright <%= grunt.template.today("yyyy") %> MobileCaddy Ltd */\n',
        },
        files: [{
          flatten: true,
          expand: true,
          src:    [
            'www/js/*.js',
            // don't include lib files that are needed only for local dev/test
            '!www/lib/js/**.js'
            ],
          dest:   'dest/js'
        }]
      }
    },

    connect: {
      server: {
        options: {
          port: 3030,
          livereload: true,
          open: "http://localhost:3030/www" + qStr
        }
      }
    },

    express: {
      options: {
        // Override defaults here
      },
      dev: {
        options: {
          args: expressArgs,
          script: 'node_modules/mobilecaddy-codeflow/js/cors-server.js'
        }
      }
    },

    sass: {
      dist: {
        options: {
          style: 'compact',
          sourcemap: 'none'
        },
        files: {
          'www/css/app.css': 'scss/app.scss'
        }
      }
    },

    watch: {
      set1: {
        files: ['app.js',
                'www/js/**/*.js',
                '!www/js/services.js',
                '!www/js/controllers.js',
                'package.json'],
        tasks: ['dev']
      },
      set2: {
        files: [ 'www/templates/*.html'],
        tasks: ['compress:dev']
      },
      set3: {
        files: [ 'scss/*.scss'],
        tasks: ['sass', 'compress:dev']
      },
      set4: {
        files: [ 'www/css/*.css'],
        tasks: [],
        options: {
          livereload: true,
        }
      },
      set5: {
        files: [ 'tests/**/*.js'],
        tasks: ['jshint:test']
      },
      express: {
        files: ['cors/cors-server.js'],
        tasks:  [ 'express:dev' ]
      }
    },

    concat: {
        options: {
          separator: '\n',
        },
        services: {
          src:  ['www/js/services/service.module.js', 'www/js/services/*.js'],
          dest: 'www/js/services.js',
        },
        controllers: {
          src:  ['www/js/controllers/controllers.module.js', 'www/js/controllers/*.js'],
          dest: 'www/js/controllers.js',
        },
    },

    copy: {
      devsetup: (function(){<commit_msg>IASA-41 Moved grunt watch tasks around as live reload was not triggering<commit_after>module.exports = function(grunt) {
  "use strict";

  var qStr = "";
  var scrub = "";
  if (grunt.option('scrub')){
    scrub = 'scrub=' + grunt.option('scrub');
  }
  var local = "";
  if (grunt.option('local')){
    local= 'local=true';
  }

  if (scrub !== "" || local !== ""){
    qStr += "?" + scrub + "&" + local;
  }

  var expressArgs = [];
  if (grunt.option('rec')){
    expressArgs.push('rec');
  }

  require('load-grunt-tasks')(grunt);
  // Project configuration.
  grunt.initConfig({
    // This line makes your node configurations available for use
    pkg: grunt.file.readJSON('package.json'),

    jshint: {
      myFiles: ['Gruntfile.js',
                'www/js/app.js',
                'www/js/**/*.js',],
      test: [
        'tests/**/*.js',
        '!tests/coverage/**/*.*'
        ]
    },

    compress: {
      options :{
        archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
      },
      dev: {
        src: ['www/**',
              // don't include  files that are needed only for local dev/test
              '!www/index.html',
              '!www/index.tpl.html',
              '!www/js/services/**',
              '!www/js/controllers/**',
              '!www/**/*.log'],
        expand: true
      },
      prod: {
        files :[
          {
            src: [
              'www/**',
              'www/lib/js/ng-cordova.min.js',
              // don't include js that we have minified
              '!www/js/*',
              // add any libs that you do want included here.
              '!www/index.html',
              '!www/index.tpl.html',
              '!www/js/services/**',
              '!www/js/controllers/**',
              '!www/**/*.log'],
            expand: true
          },
          {
            flatten:true,
            expand: true,
            src: ['dest/js/*'],
            dest : 'www/js'
          }
        ]
      }
    },

    uglify : {
      prod: {
        options: {
          mangle: false,
          drop_console: true,
          banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %>*/\n' +
            '/* Copyright <%= grunt.template.today("yyyy") %> MobileCaddy Ltd */\n',
        },
        files: [{
          flatten: true,
          expand: true,
          src:    [
            'www/js/*.js',
            // don't include lib files that are needed only for local dev/test
            '!www/lib/js/**.js'
            ],
          dest:   'dest/js'
        }]
      }
    },

    connect: {
      server: {
        options: {
          port: 3030,
          livereload: true,
          open: "http://localhost:3030/www" + qStr
        }
      }
    },

    express: {
      options: {
        // Override defaults here
      },
      dev: {
        options: {
          args: expressArgs,
          script: 'node_modules/mobilecaddy-codeflow/js/cors-server.js'
        }
      }
    },

    sass: {
      dist: {
        options: {
          style: 'compact',
          sourcemap: 'none'
        },
        files: {
          'www/css/app.css': 'scss/app.scss'
        }
      }
    },

    watch: {
      set1: {
        files: ['app.js',
                'www/js/**/*.js',
                '!www/js/services.js',
                '!www/js/controllers.js',
                'package.json'],
        tasks: ['dev']
      },
      set2: {
        files: [ 'www/templates/*.html'],
        tasks: ['compress:dev']
      },
      set3: {
        files: [ 'scss/*.scss'],
        tasks: ['sass']
      },
      set4: {
        files: [ 'www/css/*.css'],
        tasks: ['compress:dev'],
        options: {
          livereload: true,
        }
      },
      set5: {
        files: [ 'tests/**/*.js'],
        tasks: ['jshint:test']
      },
      express: {
        files: ['cors/cors-server.js'],
        tasks:  [ 'express:dev' ]
      }
    },

    concat: {
        options: {
          separator: '\n',
        },
        services: {
          src:  ['www/js/services/service.module.js', 'www/js/services/*.js'],
          dest: 'www/js/services.js',
        },
        controllers: {
          src:  ['www/js/controllers/controllers.module.js', 'www/js/controllers/*.js'],
          dest: 'www/js/controllers.js',
        },
    },

    copy: {
      devsetup: (function(){
{'fraction_non_alphanumeric': 0.1809469480889903, 'fraction_numerical': 0.0031945236737022245, 'mean_word_length': 1.2639462809917354, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 64, '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': '2070403', 'n_tokens_mistral': 2906, 'n_tokens_neox': 2800, 'n_words': 496}