Gruntfile.js 4.9 KB

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