Gruntfile.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. module.exports = function(grunt) {
  2. grunt.loadTasks('./grunt/tasks');
  3. grunt.loadNpmTasks('amber-dev');
  4. grunt.loadNpmTasks('grunt-contrib-jshint');
  5. grunt.loadNpmTasks('grunt-contrib-clean');
  6. grunt.loadNpmTasks('grunt-execute');
  7. grunt.registerTask('default', ['peg', 'amberc:all']);
  8. grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner', 'clean:test_runner']);
  9. grunt.initConfig({
  10. pkg: grunt.file.readJSON('package.json'),
  11. meta: {
  12. banner: '/*!\n <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> \n License: <%= pkg.license.type %> \n*/\n'
  13. },
  14. peg: {
  15. amber_parser: {
  16. options: {
  17. cache: true,
  18. export_var: 'globals.SmalltalkParser'
  19. },
  20. src: 'support/parser.pegjs',
  21. dest: 'support/parser.js',
  22. }
  23. },
  24. amberc: {
  25. options: {
  26. amber_dir: process.cwd(),
  27. closure_jar: ''
  28. },
  29. all: {
  30. output_dir : 'src',
  31. src: ['src/Kernel-Objects.st', 'src/Kernel-Classes.st', 'src/Kernel-Methods.st', 'src/Kernel-Collections.st',
  32. 'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st',
  33. 'src/Kernel-ImportExport.st', 'src/Compiler-Exceptions.st', 'src/Compiler-Core.st', 'src/Compiler-AST.st',
  34. 'src/Compiler-IR.st', 'src/Compiler-Inlining.st', 'src/Compiler-Semantic.st', 'src/Compiler-Interpreter.st',
  35. 'src/Web.st', 'src/SUnit.st', 'src/IDE.st',
  36. 'src/Kernel-Tests.st', 'src/Compiler-Tests.st', 'src/SUnit-Tests.st',
  37. 'src/Helios-Core.st', 'src/Helios-Exceptions.st', 'src/Helios-Announcements.st',
  38. 'src/Helios-KeyBindings.st', 'src/Helios-Layout.st',
  39. 'src/Helios-Commands-Core.st', 'src/Helios-Commands-Tools.st', 'src/Helios-Commands-Browser.st',
  40. 'src/Helios-References.st', 'src/Helios-Inspector.st', 'src/Helios-Browser.st',
  41. 'src/Helios-Transcript.st', 'src/Helios-Workspace.st', 'src/Helios-Debugger.st',
  42. 'src/Helios-Workspace-Tests.st',
  43. 'src/Benchfib.st', 'src/Examples.st', 'src/Spaces.st'
  44. ],
  45. jsGlobals: ['navigator']
  46. },
  47. amber_kernel: {
  48. output_dir : 'src',
  49. src: ['src/Kernel-Objects.st', 'src/Kernel-Classes.st', 'src/Kernel-Methods.st', 'src/Kernel-Collections.st',
  50. 'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st']
  51. },
  52. amber_web: {
  53. output_dir : 'src',
  54. src: ['src/Web.st', 'src/SUnit.st']
  55. },
  56. amber_IDE: {
  57. output_dir : 'src',
  58. src: ['src/IDE.st'],
  59. libraries: ['Web']
  60. },
  61. amber_tests: {
  62. output_dir : 'src',
  63. src: ['src/Kernel-Tests.st', 'src/Compiler-Tests.st', 'src/SUnit-Tests.st'],
  64. libraries: ['SUnit']
  65. },
  66. test_runner: {
  67. src: ['node_modules/amber-dev/lib/Test.st'],
  68. libraries: [
  69. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  70. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
  71. 'SUnit', 'Kernel-ImportExport',
  72. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  73. main_class: 'NodeTestRunner',
  74. output_name: 'test_runner'
  75. }
  76. },
  77. execute: {
  78. test_runner: {
  79. src: ['test_runner.js']
  80. }
  81. },
  82. clean: {
  83. test_runner: ['test_runner.js']
  84. },
  85. jshint: {
  86. amber: ['src/*.js'],
  87. server: ['server/*.js'],
  88. repl: ['repl/*.js'],
  89. tests: ['test/*.js'],
  90. grunt: ['grunt.js', 'grunt/**/*.js']
  91. }
  92. });
  93. };