Gruntfile.coffee 2.3 KB

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