Gruntfile.coffee 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. module.exports = (grunt) ->
  2. grunt.initConfig
  3. forever:
  4. app:
  5. options:
  6. index: "app.js"
  7. coffee:
  8. app_src:
  9. expand: true,
  10. flatten: true,
  11. cwd: "app"
  12. src: ['coffee/*.coffee'],
  13. dest: 'app/js/',
  14. ext: '.js'
  15. app:
  16. src: "app.coffee"
  17. dest: "app.js"
  18. unit_tests:
  19. expand: true
  20. cwd: "test/unit/coffee"
  21. src: ["**/*.coffee"]
  22. dest: "test/unit/js/"
  23. ext: ".js"
  24. acceptance_tests:
  25. expand: true
  26. cwd: "test/acceptance/coffee"
  27. src: ["**/*.coffee"]
  28. dest: "test/acceptance/js/"
  29. ext: ".js"
  30. clean:
  31. app: ["app/js/"]
  32. unit_tests: ["test/unit/js"]
  33. acceptance_tests: ["test/acceptance/js"]
  34. smoke_tests: ["test/smoke/js"]
  35. execute:
  36. app:
  37. src: "app.js"
  38. mochaTest:
  39. unit:
  40. options:
  41. reporter: grunt.option('reporter') or 'spec'
  42. src: ["test/unit/js/**/*.js"]
  43. acceptance:
  44. options:
  45. reporter: grunt.option('reporter') or 'spec'
  46. timeout: 40000
  47. grep: grunt.option("grep")
  48. src: ["test/acceptance/js/**/*.js"]
  49. grunt.loadNpmTasks 'grunt-contrib-coffee'
  50. grunt.loadNpmTasks 'grunt-contrib-clean'
  51. grunt.loadNpmTasks 'grunt-mocha-test'
  52. grunt.loadNpmTasks 'grunt-shell'
  53. grunt.loadNpmTasks 'grunt-execute'
  54. grunt.loadNpmTasks 'grunt-bunyan'
  55. grunt.loadNpmTasks 'grunt-forever'
  56. grunt.registerTask 'compile:app', ['clean:app', 'coffee:app', 'coffee:app_src']
  57. grunt.registerTask 'run', ['compile:app', 'bunyan', 'execute']
  58. grunt.registerTask 'compile:unit_tests', ['clean:unit_tests', 'coffee:unit_tests']
  59. grunt.registerTask 'test:unit', ['compile:app', 'compile:unit_tests', 'mochaTest:unit']
  60. grunt.registerTask 'compile:acceptance_tests', ['clean:acceptance_tests', 'coffee:acceptance_tests']
  61. grunt.registerTask 'test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']
  62. grunt.registerTask 'install', 'compile:app'
  63. grunt.registerTask 'default', ['run']