2
0

Gruntfile.js 3.5 KB

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