Gruntfile.js 3.7 KB

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