Gruntfile.coffee 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. module.exports = (grunt) ->
  2. # Project configuration.
  3. grunt.initConfig
  4. forever:
  5. app:
  6. options:
  7. index: "app.js"
  8. execute:
  9. app:
  10. src: "app.js"
  11. coffee:
  12. server:
  13. expand: true,
  14. flatten: false,
  15. cwd: 'app/coffee',
  16. src: ['**/*.coffee'],
  17. dest: 'app/js/',
  18. ext: '.js'
  19. app_server:
  20. expand: true,
  21. flatten: false,
  22. src: ['app.coffee'],
  23. dest: './',
  24. ext: '.js'
  25. unit_tests:
  26. expand: true,
  27. flatten: false,
  28. cwd: 'test/unit/coffee',
  29. src: ['**/*.coffee'],
  30. dest: 'test/unit/js/',
  31. ext: '.js'
  32. acceptance_tests:
  33. expand: true,
  34. flatten: false,
  35. cwd: 'test/acceptance/coffee',
  36. src: ['**/*.coffee'],
  37. dest: 'test/acceptance/js/',
  38. ext: '.js'
  39. watch:
  40. server_coffee:
  41. files: ['app/**/*.coffee', 'test/unit/**/*.coffee']
  42. tasks: ['compile:server', 'compile:unit_tests', 'mochaTest']
  43. clean: ["app/js", "test/unit/js"]
  44. nodemon:
  45. dev:
  46. options:
  47. file: 'app.js'
  48. concurrent:
  49. dev:
  50. tasks: ['nodemon', 'watch']
  51. options:
  52. logConcurrentOutput: true
  53. mochaTest:
  54. unit:
  55. options:
  56. reporter: process.env.MOCHA_RUNNER || "spec"
  57. grep: grunt.option("grep")
  58. src: ['test/unit/**/*.js']
  59. acceptance:
  60. options:
  61. reporter: process.env.MOCHA_RUNNER || "spec"
  62. grep: grunt.option("grep")
  63. src: ['test/acceptance/**/*.js']
  64. plato:
  65. your_task:
  66. files: 'plato': ['app/js/**/*.js'],
  67. grunt.loadNpmTasks 'grunt-contrib-coffee'
  68. grunt.loadNpmTasks 'grunt-contrib-watch'
  69. grunt.loadNpmTasks 'grunt-nodemon'
  70. grunt.loadNpmTasks 'grunt-contrib-clean'
  71. grunt.loadNpmTasks 'grunt-concurrent'
  72. grunt.loadNpmTasks 'grunt-mocha-test'
  73. grunt.loadNpmTasks 'grunt-plato'
  74. grunt.loadNpmTasks 'grunt-execute'
  75. grunt.loadNpmTasks 'grunt-bunyan'
  76. grunt.loadNpmTasks 'grunt-forever'
  77. grunt.registerTask 'compile', ['clean', 'coffee']
  78. grunt.registerTask 'install', ['compile']
  79. grunt.registerTask 'default', ['compile', 'bunyan', 'execute']
  80. grunt.registerTask 'test:unit', ['compile', 'mochaTest:unit']
  81. grunt.registerTask 'test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']