1
0

Gruntfile.js 4.1 KB

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