2
0

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 : 'js',
  27. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  28. 'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st',
  29. 'st/Kernel-ImportExport.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
  30. 'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st', 'st/Compiler-Interpreter.st',
  31. 'st/Canvas.st', 'st/SUnit.st', 'st/IDE.st',
  32. 'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st',
  33. 'st/Helios-Core.st', 'st/Helios-Exceptions.st', 'st/Helios-Announcements.st',
  34. 'st/Helios-KeyBindings.st', 'st/Helios-Layout.st',
  35. 'st/Helios-Commands-Core.st', 'st/Helios-Commands-Tools.st', 'st/Helios-Commands-Browser.st',
  36. 'st/Helios-References.st', 'st/Helios-Inspector.st', 'st/Helios-Browser.st',
  37. 'st/Helios-Transcript.st', 'st/Helios-Workspace.st', 'st/Helios-Debugger.st',
  38. 'st/Helios-Workspace-Tests.st',
  39. 'st/Benchfib.st', 'st/Examples.st', 'st/Spaces.st'
  40. ],
  41. jsGlobals: ['navigator']
  42. },
  43. amber_kernel: {
  44. output_dir : 'js',
  45. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  46. 'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st']
  47. },
  48. amber_canvas: {
  49. output_dir : 'js',
  50. src: ['st/Canvas.st', 'st/SUnit.st']
  51. },
  52. amber_IDE: {
  53. output_dir : 'js',
  54. src: ['st/IDE.st'],
  55. libraries: ['Canvas']
  56. },
  57. amber_tests: {
  58. output_dir : 'js',
  59. src: ['st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/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/js',
  74. src: ['cli/st/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: ['js/*.js'],
  86. server: ['server/*.js'],
  87. repl: ['repl/*.js'],
  88. tests: ['test/*.js'],
  89. grunt: ['grunt.js', 'grunt/**/*.js']
  90. }
  91. });
  92. };