Gruntfile.coffee 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. client:
  13. expand: true,
  14. flatten: false,
  15. cwd: 'public/coffee',
  16. src: ['**/*.coffee'],
  17. dest: 'public/build/',
  18. ext: '.js'
  19. server:
  20. expand: true,
  21. flatten: false,
  22. cwd: 'app/coffee',
  23. src: ['**/*.coffee'],
  24. dest: 'app/js/',
  25. ext: '.js'
  26. app_server:
  27. expand: true,
  28. flatten: false,
  29. src: ['app.coffee'],
  30. dest: './',
  31. ext: '.js'
  32. unit_tests:
  33. expand: true,
  34. flatten: false,
  35. cwd: 'test/unit/coffee',
  36. src: ['**/*.coffee'],
  37. dest: 'test/unit/js/',
  38. ext: '.js'
  39. acceptance_tests:
  40. expand: true,
  41. flatten: false,
  42. cwd: 'test/acceptance/coffee',
  43. src: ['**/*.coffee'],
  44. dest: 'test/acceptance/js/',
  45. ext: '.js'
  46. watch:
  47. server_coffee:
  48. files: ['app/**/*.coffee', 'test/unit/**/*.coffee']
  49. tasks: ['compile:server', 'compile:unit_tests', 'mochaTest']
  50. client_coffee:
  51. files: ['public/**/*.coffee']
  52. tasks: ['compile']
  53. less:
  54. files: ['public/less/*.less']
  55. tasks: ['compile']
  56. jade:
  57. files: ['public/jade/*.jade']
  58. tasks: ['compile']
  59. less:
  60. production:
  61. files:
  62. "public/build/css/chat.css": "public/less/chat.less"
  63. jade:
  64. compile:
  65. files:
  66. "public/build/html/templates.html": ["public/jade/templates.jade"]
  67. requirejs:
  68. compile:
  69. options:
  70. mainConfigFile: 'public/app.build.js',
  71. uglify:
  72. my_target:
  73. files:
  74. 'public/build/chat.js': ['public/build/chat.js']
  75. copy:
  76. main:
  77. expand: true
  78. cwd: 'public/js'
  79. src: '**'
  80. dest: 'public/build/'
  81. clean: ["public/build", "app/js", "test/unit/js"]
  82. nodemon:
  83. dev:
  84. options:
  85. file: 'app.js'
  86. concurrent:
  87. dev:
  88. tasks: ['nodemon', 'watch']
  89. options:
  90. logConcurrentOutput: true
  91. mochaTest:
  92. unit:
  93. options:
  94. reporter: process.env.MOCHA_RUNNER || "spec"
  95. grep: grunt.option("grep")
  96. src: ['test/unit/**/*.js']
  97. acceptance:
  98. options:
  99. reporter: process.env.MOCHA_RUNNER || "spec"
  100. grep: grunt.option("grep")
  101. src: ['test/acceptance/**/*.js']
  102. plato:
  103. your_task:
  104. files: 'plato': ['app/js/**/*.js'],
  105. grunt.loadNpmTasks 'grunt-contrib-coffee'
  106. grunt.loadNpmTasks 'grunt-contrib-watch'
  107. grunt.loadNpmTasks 'grunt-contrib-copy'
  108. grunt.loadNpmTasks 'grunt-contrib-less'
  109. grunt.loadNpmTasks 'grunt-contrib-jade'
  110. grunt.loadNpmTasks 'grunt-contrib-requirejs'
  111. grunt.loadNpmTasks 'grunt-contrib-uglify'
  112. grunt.loadNpmTasks 'grunt-nodemon'
  113. grunt.loadNpmTasks 'grunt-contrib-clean'
  114. grunt.loadNpmTasks 'grunt-concurrent'
  115. grunt.loadNpmTasks 'grunt-mocha-test'
  116. grunt.loadNpmTasks 'grunt-plato'
  117. grunt.loadNpmTasks 'grunt-execute'
  118. grunt.loadNpmTasks 'grunt-bunyan'
  119. grunt.loadNpmTasks 'grunt-forever'
  120. grunt.registerTask 'compile', ['clean', 'copy', 'coffee', 'less', 'jade', 'requirejs']
  121. grunt.registerTask 'install', ['compile']
  122. grunt.registerTask 'default', ['compile', 'bunyan', 'execute']
  123. grunt.registerTask 'compileAndCompress', ['compile', 'uglify']
  124. grunt.registerTask 'test:unit', ['compile', 'mochaTest:unit']
  125. grunt.registerTask 'test:acceptance', ['compile:acceptance_tests', 'mochaTest:acceptance']