<commit_before>'use strict';

var path = require('path');

module.exports = function(grunt) {

  grunt.initConfig({

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

    jshint: {
      options: {
        jshintrc: true,
      },
      all: [
        'Gruntfile.js',
        'tasks/**/*.js'
      ]
    },

    clean: {
      "test": [ './test/build' ],
      "app": [ './test/fake-app/build', './test/fake-app/modules' ]
    },

    copy: {
      "dependencies": {
        files: {
          './test/fake-app/Resources/should.js': require.resolve('should/should'),
          './test/fake-app/Resources/ti-mocha.js': require.resolve('ti-mocha/ti-mocha')
        }
      }
    },

    titaniumifier: {
      "module": {
        files: { './test/build': 'test/fake-module' },
        options: {
          bare: false
        }
      },
      "bare-module": {
        files: { './test/build': 'test/fake-module' },
        options: {
          bare: true
        }
      },
      "renamed": {
        files: { './test/build': 'test/fake-module' },
        options: {
          as: "renamed-module"
        }
      }
    },

    unzip: {
      "module": {
        src: [
          'test/build/fake-module-commonjs-1.2.3.zip',
          'test/build/renamed-module-commonjs-1.2.3.zip'
        ],
        dest: 'test/fake-app'
      }
    },

    titanium: {
      "ios": {
        options: {
          command: 'build',
          logLevel: 'trace',
          projectDir: './test/fake-app',
          platform: 'ios'
        }
      },
      "droid": {
        options: {
          command: 'build',
          logLevel: 'trace',
          projectDir: './test/fake-app',
          platform: 'android',
          deviceId: grunt.option('device-id')
        }
      }
    }

  });

  grunt.loadTasks('tasks');

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-titanium');
  grunt.loadNpmTasks('grunt-zip');

  grunt.registerTask('mkdir:build', function () {
    grunt.file.mkdir('./test/build');
  });

  grunt.registerTask('test:build', [ 'clean:test', 'mkdir:build', 'titaniumifier' ]);

  grunt.registerTask('setup:app', [ 'clean:app', 'test:build', 'unzip:module', 'copy:dependencies' ]);

  grunt.registerTask('test:ios', [ 'setup:app', 'titanium:ios' ]);
  grunt.registerTask('test:droid', [ 'setup:app', 'titanium:droid' ]);

  grunt.registerTask('default', [ 'jshint', 'test:build' ]);<commit_msg>More succint grunt-titanium config<commit_after>'use strict';

var path = require('path');

module.exports = function(grunt) {

  grunt.initConfig({

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

    jshint: {
      options: {
        jshintrc: true,
      },
      all: [
        'Gruntfile.js',
        'tasks/**/*.js'
      ]
    },

    clean: {
      "test": [ './test/build' ],
      "app": [ './test/fake-app/build', './test/fake-app/modules' ]
    },

    copy: {
      "dependencies": {
        files: {
          './test/fake-app/Resources/should.js': require.resolve('should/should'),
          './test/fake-app/Resources/ti-mocha.js': require.resolve('ti-mocha/ti-mocha')
        }
      }
    },

    titaniumifier: {
      "module": {
        files: { './test/build': 'test/fake-module' },
        options: {
          bare: false
        }
      },
      "bare-module": {
        files: { './test/build': 'test/fake-module' },
        options: {
          bare: true
        }
      },
      "renamed": {
        files: { './test/build': 'test/fake-module' },
        options: {
          as: "renamed-module"
        }
      }
    },

    unzip: {
      "module": {
        src: [
          'test/build/fake-module-commonjs-1.2.3.zip',
          'test/build/renamed-module-commonjs-1.2.3.zip'
        ],
        dest: 'test/fake-app'
      }
    },

    titanium: {
      options: {
        command: 'build',
        logLevel: (grunt.option('log-level') || 'info'),
        projectDir: './test/fake-app',
      },
      "ios": {
        options: {
          platform: 'ios'
        }
      },
      "droid": {
        options: {
          platform: 'android',
          deviceId: grunt.option('device-id')
        }
      }
    }

  });

  grunt.loadTasks('tasks');

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-titanium');
  grunt.loadNpmTasks('grunt-zip');

  grunt.registerTask('mkdir:build', function () {
    grunt.file.mkdir('./test/build');
  });

  grunt.registerTask('test:build', [ 'clean:test', 'mkdir:build', 'titaniumifier' ]);

  grunt.registerTask('setup:app', [ 'clean:app', 'test:build', 'unzip:module', 'copy:dependencies' ]);

  grunt.registerTask('test:ios', [ 'setup:app', 'titanium:ios' ]);
  grunt.registerTask('test:droid', [ 'setup:app', 'titanium:droid' ]);

  grunt.registerTask('default', [ 'jshint', 'test:build' ]);
{'fraction_non_alphanumeric': 0.19390415079205936, 'fraction_numerical': 0.00240625626629236, 'mean_word_length': 1.993997599039616, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 3, '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': '2674207', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1721, 'n_words': 217}