Gruntfile.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. trackLineAndColumn: true,
  14. cache: true,
  15. export_var: 'smalltalk.parser'
  16. },
  17. src: 'support/parser.pegjs',
  18. dest: 'support/parser.js',
  19. }
  20. },
  21. amberc: {
  22. options: {
  23. amber_dir: process.cwd(),
  24. closure_jar: ''
  25. },
  26. all: {
  27. output_dir : 'js',
  28. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  29. 'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st',
  30. 'st/Kernel-ImportExport.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
  31. 'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st', 'st/Compiler-Interpreter.st',
  32. 'st/Canvas.st', 'st/SUnit.st', 'st/IDE.st',
  33. 'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st',
  34. 'st/Helios-Core.st', 'st/Helios-Exceptions.st', 'st/Helios-Announcements.st',
  35. 'st/Helios-KeyBindings.st', 'st/Helios-Layout.st',
  36. 'st/Helios-Commands-Core.st', 'st/Helios-Commands-Tools.st', 'st/Helios-Commands-Browser.st',
  37. 'st/Helios-References.st', 'st/Helios-Inspector.st', 'st/Helios-Browser.st',
  38. 'st/Helios-Transcript.st', 'st/Helios-Workspace.st', 'st/Helios-Debugger.st',
  39. 'st/Helios-Workspace-Tests.st',
  40. 'st/Benchfib.st', 'st/Examples.st', 'st/Spaces.st'
  41. ],
  42. jsGlobals: ['navigator']
  43. },
  44. amber_kernel: {
  45. output_dir : 'js',
  46. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  47. 'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st']
  48. },
  49. amber_canvas: {
  50. output_dir : 'js',
  51. src: ['st/Canvas.st', 'st/SUnit.st']
  52. },
  53. amber_IDE: {
  54. output_dir : 'js',
  55. src: ['st/IDE.st'],
  56. libraries: ['Canvas']
  57. },
  58. amber_tests: {
  59. output_dir : 'js',
  60. src: ['st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st'],
  61. libraries: ['SUnit']
  62. },
  63. amber_test_runner: {
  64. src: ['test/Test.st'],
  65. libraries: [
  66. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  67. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
  68. 'SUnit', 'Kernel-ImportExport',
  69. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  70. main_class: 'NodeTestRunner',
  71. output_name: 'test/amber_test_runner'
  72. },
  73. amber_cli: {
  74. output_dir: 'cli/js',
  75. src: ['cli/st/AmberCli.st'],
  76. libraries: [
  77. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  78. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser'
  79. ],
  80. main_class: 'AmberCli',
  81. output_name: '../support/amber-cli',
  82. amd_namespace: 'amber_cli'
  83. }
  84. },
  85. jshint: {
  86. amber: ['js/*.js'],
  87. server: ['server/*.js'],
  88. repl: ['repl/*.js'],
  89. tests: ['test/*.js'],
  90. grunt: ['grunt.js', 'grunt/**/*.js']
  91. }
  92. });
  93. };