Gruntfile.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. server: {
  94. working_dir: 'server',
  95. src: ['FileServer.st'],
  96. main_class: 'FileServer',
  97. output_name: 'server'
  98. },
  99. repl: {
  100. working_dir: 'repl',
  101. src: ['REPL.st'],
  102. main_class: 'Repl',
  103. output_name: 'amber'
  104. }
  105. },
  106. jshint: {
  107. amber: ['js/*.js'],
  108. server: ['server/*.js'],
  109. repl: ['repl/*.js'],
  110. tests: ['test/*.js'],
  111. grunt: ['grunt.js', 'grunt/**/*.js']
  112. },
  113. /*
  114. concat: {
  115. deploy: {
  116. src: ['tmp/amber-compiled.deploy.js'],
  117. dest: 'dist/amber-<%= pkg.version %>.deploy.js'
  118. },
  119. css: {
  120. src: [
  121. 'css/amber.css',
  122. 'js/lib/CodeMirror/codemirror.css',
  123. 'js/lib/CodeMirror/amber.css'
  124. ],
  125. dest: 'tmp/amber.css'
  126. },
  127. dev: {
  128. src: [
  129. 'js/lib/jQuery/jquery-ui-1.8.16.custom.min.js',
  130. 'js/lib/jQuery/jquery.textarea.js',
  131. 'js/lib/CodeMirror/codemirror.js',
  132. 'js/lib/CodeMirror/smalltalk.js',
  133. 'tmp/amber-compiled.js',
  134. 'tmp/css.js'
  135. ],
  136. dest: 'dist/amber-<%= pkg.version %>.js'
  137. }
  138. },
  139. imageEmbed: {
  140. dev: {
  141. src: ['tmp/amber.css'],
  142. dest: 'tmp/amber-images.css',
  143. options: {baseDir: 'public'}
  144. }
  145. },
  146. mincss: {
  147. dev: {
  148. src: ['tmp/amber-images.css'],
  149. dest: 'tmp/amber.min.css'
  150. }
  151. },
  152. css2js: {
  153. dev: {
  154. src: 'tmp/amber.min.css',
  155. dest: 'tmp/css.js'
  156. }
  157. },
  158. min: {
  159. deploy: {
  160. src: 'dist/amber-<%= pkg.version %>.deploy.js',
  161. dest: 'dist/amber-<%= pkg.version %>.deploy.min.js'
  162. }
  163. }
  164. */
  165. });
  166. };