2
0

Gruntfile.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. module.exports = function(grunt) {
  2. grunt.loadTasks('./grunt/tasks');
  3. grunt.loadNpmTasks('grunt-contrib-jshint');
  4. // grunt.loadNpmTasks('grunt-image-embed');
  5. // grunt.loadNpmTasks('grunt-contrib-mincss');
  6. grunt.registerTask('default', ['peg', 'amberc:all']);
  7. grunt.initConfig({
  8. pkg: grunt.file.readJSON('package.json'),
  9. meta: {
  10. banner: '/*!\n <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> \n License: <%= pkg.license.type %> \n*/\n'
  11. },
  12. peg: {
  13. amber_parser: {
  14. options: {
  15. trackLineAndColumn: true,
  16. cache: true,
  17. export_var: 'smalltalk.parser'
  18. },
  19. src: 'js/parser.pegjs',
  20. dest: 'js/parser.js',
  21. }
  22. },
  23. amberc: {
  24. _config: {
  25. amber_dir: process.cwd(),
  26. closure_jar: ''
  27. },
  28. all: {
  29. working_dir: 'st',
  30. target_dir : 'js',
  31. src: ['Kernel-Objects.st', 'Kernel-Classes.st', 'Kernel-Methods.st', 'Kernel-Collections.st',
  32. 'Kernel-Exceptions.st', 'Kernel-Transcript.st', 'Kernel-Announcements.st',
  33. 'Importer-Exporter.st', 'Compiler-Exceptions.st', 'Compiler-Core.st', 'Compiler-AST.st',
  34. 'Compiler-IR.st', 'Compiler-Inlining.st', 'Compiler-Semantic.st',
  35. 'Canvas.st', 'SUnit.st', 'IDE.st',
  36. 'Kernel-Tests.st', 'Compiler-Tests.st', 'SUnit-Tests.st'
  37. ],
  38. deploy: true
  39. },
  40. amber_kernel: {
  41. working_dir: 'st',
  42. target_dir : 'js',
  43. src: ['Kernel-Objects.st', 'Kernel-Classes.st', 'Kernel-Methods.st', 'Kernel-Collections.st',
  44. 'Kernel-Exceptions.st', 'Kernel-Transcript.st', 'Kernel-Announcements.st'],
  45. deploy: true
  46. },
  47. amber_compiler: {
  48. working_dir: 'st',
  49. target_dir : 'js',
  50. src: ['Importer-Exporter.st', 'Compiler-Exceptions.st', 'Compiler-Core.st', 'Compiler-AST.st',
  51. 'Compiler-IR.st', 'Compiler-Inlining.st', 'Compiler-Semantic.st'],
  52. output_name: 'Compiler',
  53. deploy: true
  54. },
  55. amber_canvas: {
  56. working_dir: 'st',
  57. target_dir : 'js',
  58. src: ['Canvas.st', 'SUnit.st'],
  59. deploy: true
  60. },
  61. amber_IDE: {
  62. working_dir: 'st',
  63. target_dir : 'js',
  64. src: ['IDE.st'],
  65. libraries: ['Canvas'],
  66. deploy: true
  67. },
  68. amber_tests: {
  69. working_dir: 'st',
  70. target_dir : 'js',
  71. src: ['Kernel-Tests.st', 'Compiler-Tests.st', 'SUnit-Tests.st'],
  72. libraries: ['SUnit']
  73. },
  74. amber_test_runner: {
  75. working_dir: 'test',
  76. src: ['Test.st'],
  77. libraries: [
  78. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  79. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
  80. 'SUnit',
  81. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  82. output_name: 'amber_test_runner'
  83. },
  84. amber_dev: {
  85. working_dir: 'js',
  86. src: [
  87. 'Compiler-Exceptions.js', 'Compiler-Core.js', 'Compiler-AST.js',
  88. 'Compiler-IR.js', 'Compiler-Inlining.js', 'Compiler-Semantic.js',
  89. 'Canvas.js', 'IDE.js', 'SUnit.js',
  90. 'Kernel-Tests.js', 'Compiler-Tests.js', 'SUnit-Tests.js'],
  91. output_name: 'amber_dev'
  92. },
  93. amber_cli: {
  94. working_dir: 'cli/js',
  95. src: ['../st/AmberCli.st'],
  96. main_class: 'AmberCli',
  97. output_name: 'amber-cli'
  98. }
  99. },
  100. jshint: {
  101. amber: ['js/*.js'],
  102. server: ['server/*.js'],
  103. repl: ['repl/*.js'],
  104. tests: ['test/*.js'],
  105. grunt: ['grunt.js', 'grunt/**/*.js']
  106. },
  107. /*
  108. concat: {
  109. deploy: {
  110. src: ['tmp/amber-compiled.deploy.js'],
  111. dest: 'dist/amber-<%= pkg.version %>.deploy.js'
  112. },
  113. css: {
  114. src: [
  115. 'css/amber.css',
  116. 'js/lib/CodeMirror/codemirror.css',
  117. 'js/lib/CodeMirror/amber.css'
  118. ],
  119. dest: 'tmp/amber.css'
  120. },
  121. dev: {
  122. src: [
  123. 'js/lib/jQuery/jquery-ui-1.8.16.custom.min.js',
  124. 'js/lib/jQuery/jquery.textarea.js',
  125. 'js/lib/CodeMirror/codemirror.js',
  126. 'js/lib/CodeMirror/smalltalk.js',
  127. 'tmp/amber-compiled.js',
  128. 'tmp/css.js'
  129. ],
  130. dest: 'dist/amber-<%= pkg.version %>.js'
  131. }
  132. },
  133. imageEmbed: {
  134. dev: {
  135. src: ['tmp/amber.css'],
  136. dest: 'tmp/amber-images.css',
  137. options: {baseDir: 'public'}
  138. }
  139. },
  140. mincss: {
  141. dev: {
  142. src: ['tmp/amber-images.css'],
  143. dest: 'tmp/amber.min.css'
  144. }
  145. },
  146. css2js: {
  147. dev: {
  148. src: 'tmp/amber.min.css',
  149. dest: 'tmp/css.js'
  150. }
  151. },
  152. min: {
  153. deploy: {
  154. src: 'dist/amber-<%= pkg.version %>.deploy.js',
  155. dest: 'dist/amber-<%= pkg.version %>.deploy.min.js'
  156. }
  157. }
  158. */
  159. });
  160. };