2
0

Gruntfile.js 4.4 KB

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