2
0

Gruntfile.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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:amber', 'amberc:cli']);
  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. 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. amber: {
  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. cli: {
  44. output_dir: 'external/amber-cli/src',
  45. src: ['external/amber-cli/src/AmberCli.st'],
  46. libraries: [
  47. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  48. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
  49. 'SUnit', 'Kernel-ImportExport',
  50. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'
  51. ],
  52. main_class: 'AmberCli',
  53. output_name: '../support/amber-cli',
  54. amd_namespace: 'amber_cli'
  55. },
  56. dev: {
  57. output_dir: 'external/amber-dev/lib',
  58. src: ['external/amber-dev/lib/Test.st']
  59. },
  60. test_runner: {
  61. src: ['node_modules/amber-dev/lib/Test.st'],
  62. libraries: [
  63. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  64. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
  65. 'SUnit', 'Kernel-ImportExport',
  66. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  67. main_class: 'NodeTestRunner',
  68. output_name: 'test_runner'
  69. }
  70. },
  71. execute: {
  72. test_runner: {
  73. src: ['test_runner.js']
  74. }
  75. },
  76. clean: {
  77. test_runner: ['test_runner.js']
  78. },
  79. jshint: {
  80. amber: ['src/*.js'],
  81. cli: ['external/amber-cli/src/*.js', 'external/amber-cli/support/*.js'],
  82. dev: ['external/amber-dev/lib/*.js'],
  83. grunt: ['Gruntfile.js', 'internal/grunt-tasks/*.js', 'external/amber-dev/tasks/*.js']
  84. }
  85. });
  86. };