Gruntfile.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. module.exports = function(grunt) {
  2. grunt.loadTasks('./grunt/tasks');
  3. grunt.loadNpmTasks('amber-dev');
  4. grunt.loadNpmTasks('grunt-contrib-jshint');
  5. grunt.registerTask('default', ['peg', 'amberc:all']);
  6. grunt.initConfig({
  7. pkg: grunt.file.readJSON('package.json'),
  8. meta: {
  9. banner: '/*!\n <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> \n License: <%= pkg.license.type %> \n*/\n'
  10. },
  11. peg: {
  12. amber_parser: {
  13. options: {
  14. cache: true,
  15. export_var: 'globals.SmalltalkParser'
  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 : 'src',
  28. src: ['src/Kernel-Objects.st', 'src/Kernel-Classes.st', 'src/Kernel-Methods.st', 'src/Kernel-Collections.st',
  29. 'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st',
  30. 'src/Kernel-ImportExport.st', 'src/Compiler-Exceptions.st', 'src/Compiler-Core.st', 'src/Compiler-AST.st',
  31. 'src/Compiler-IR.st', 'src/Compiler-Inlining.st', 'src/Compiler-Semantic.st', 'src/Compiler-Interpreter.st',
  32. 'src/Web.st', 'src/SUnit.st', 'src/IDE.st',
  33. 'src/Kernel-Tests.st', 'src/Compiler-Tests.st', 'src/SUnit-Tests.st',
  34. 'src/Helios-Core.st', 'src/Helios-Exceptions.st', 'src/Helios-Announcements.st',
  35. 'src/Helios-KeyBindings.st', 'src/Helios-Layout.st',
  36. 'src/Helios-Commands-Core.st', 'src/Helios-Commands-Tools.st', 'src/Helios-Commands-Browser.st',
  37. 'src/Helios-References.st', 'src/Helios-Inspector.st', 'src/Helios-Browser.st',
  38. 'src/Helios-Transcript.st', 'src/Helios-Workspace.st', 'src/Helios-Debugger.st',
  39. 'src/Helios-Workspace-Tests.st',
  40. 'src/Benchfib.st', 'src/Examples.st', 'src/Spaces.st'
  41. ],
  42. jsGlobals: ['navigator']
  43. },
  44. amber_kernel: {
  45. output_dir : 'src',
  46. src: ['src/Kernel-Objects.st', 'src/Kernel-Classes.st', 'src/Kernel-Methods.st', 'src/Kernel-Collections.st',
  47. 'src/Kernel-Infrastructure.st', 'src/Kernel-Exceptions.st', 'src/Kernel-Transcript.st', 'src/Kernel-Announcements.st']
  48. },
  49. amber_web: {
  50. output_dir : 'src',
  51. src: ['src/Web.st', 'src/SUnit.st']
  52. },
  53. amber_IDE: {
  54. output_dir : 'src',
  55. src: ['src/IDE.st'],
  56. libraries: ['Web']
  57. },
  58. amber_tests: {
  59. output_dir : 'src',
  60. src: ['src/Kernel-Tests.st', 'src/Compiler-Tests.st', 'src/SUnit-Tests.st'],
  61. libraries: ['SUnit']
  62. },
  63. test_runner: {
  64. src: ['node_modules/amber-dev/lib/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_runner'
  72. }
  73. },
  74. jshint: {
  75. amber: ['src/*.js'],
  76. server: ['server/*.js'],
  77. repl: ['repl/*.js'],
  78. tests: ['test/*.js'],
  79. grunt: ['grunt.js', 'grunt/**/*.js']
  80. }
  81. });
  82. };