1
0

Gruntfile.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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/Importer-Exporter.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_compiler: {
  50. output_dir : 'js',
  51. src: ['st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
  52. 'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st', 'st/Compiler-Interpreter.st'],
  53. output_name: 'Compiler'
  54. },
  55. amber_canvas: {
  56. output_dir : 'js',
  57. src: ['st/Canvas.st', 'st/SUnit.st']
  58. },
  59. amber_IDE: {
  60. output_dir : 'js',
  61. src: ['st/IDE.st'],
  62. libraries: ['Canvas']
  63. },
  64. amber_tests: {
  65. output_dir : 'js',
  66. src: ['st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st'],
  67. libraries: ['SUnit']
  68. },
  69. amber_test_runner: {
  70. src: ['test/Test.st'],
  71. libraries: [
  72. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  73. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser',
  74. 'SUnit', 'Importer-Exporter',
  75. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  76. output_name: 'test/amber_test_runner'
  77. },
  78. amber_dev: {
  79. src: [
  80. 'Compiler-Exceptions.js', 'Compiler-Core.js', 'Compiler-AST.js',
  81. 'Compiler-IR.js', 'Compiler-Inlining.js', 'Compiler-Semantic.js',
  82. 'Canvas.js', 'IDE.js', 'SUnit.js',
  83. 'Kernel-Tests.js', 'Compiler-Tests.js', 'SUnit-Tests.js'],
  84. output_name: 'js/amber_dev'
  85. },
  86. amber_cli: {
  87. output_dir: 'cli/js',
  88. src: ['cli/st/AmberCli.st'],
  89. libraries: [
  90. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  91. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser'
  92. ],
  93. main_class: 'AmberCli',
  94. output_name: 'amber-cli'
  95. }
  96. },
  97. jshint: {
  98. amber: ['js/*.js'],
  99. server: ['server/*.js'],
  100. repl: ['repl/*.js'],
  101. tests: ['test/*.js'],
  102. grunt: ['grunt.js', 'grunt/**/*.js']
  103. }
  104. });
  105. };