2
0

Gruntfile.js 4.9 KB

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