| //To build dist/thrift.js, dist/thrift.min.js and doc/* |
| //run grunt at the command line in this directory. |
| // Node Setup - nodejs.org |
| // Grunt Setup - npm install //reads the ./package.json and installs project dependencies |
| module.exports = function(grunt) { |
| pkg: grunt.file.readJSON('package.json'), |
| dest: 'dist/<%= pkg.name %>.js' |
| src: ['src/*.js', './README'], |
| banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' |
| 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] |
| 'http://localhost:8088/test.html' |
| files: ['Gruntfile.js', 'src/**/*.js', 'test/*.js'], |
| // options here to override JSHint defaults |
| grunt.loadNpmTasks('grunt-contrib-uglify'); |
| grunt.loadNpmTasks('grunt-contrib-jshint'); |
| grunt.loadNpmTasks('grunt-contrib-qunit'); |
| grunt.loadNpmTasks('grunt-contrib-concat'); |
| grunt.loadNpmTasks('grunt-jsdoc'); |
| grunt.registerTask('test', ['jshint', 'qunit']); |
| grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify', 'jsdoc']); |