Gruntfile.js 5.5 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: 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: 'support/parser.pegjs',
  20. dest: 'support/parser.js',
  21. }
  22. },
  23. amberc: {
  24. options: {
  25. amber_dir: process.cwd(),
  26. closure_jar: ''
  27. },
  28. all: {
  29. output_dir : 'js',
  30. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  31. 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st',
  32. 'st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
  33. 'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st',
  34. 'st/Canvas.st', 'st/SUnit.st', 'st/IDE.st',
  35. 'st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st',
  36. 'st/Helios-Core.st', 'st/Helios-Exceptions.st', 'st/Helios-Announcements.st',
  37. 'st/Helios-KeyBindings.st', 'st/Helios-Layout.st',
  38. 'st/Helios-Commands-Core.st', 'st/Helios-Commands-Tools.st', 'st/Helios-Commands-Browser.st',
  39. 'st/Helios-References.st', 'st/Helios-Inspector.st', 'st/Helios-Browser.st',
  40. 'st/Helios-Transcript.st', 'st/Helios-Workspace.st', 'st/Helios-Debugger.st',
  41. 'st/Helios-Workspace-Tests.st',
  42. 'st/Benchfib.st', 'st/Examples.st', 'st/Spaces.st'
  43. ],
  44. jsGlobals: ['navigator'],
  45. deploy: true
  46. },
  47. amber_kernel: {
  48. output_dir : 'js',
  49. src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
  50. 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st'],
  51. deploy: true
  52. },
  53. amber_compiler: {
  54. output_dir : 'js',
  55. src: ['st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
  56. 'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st'],
  57. output_name: 'Compiler',
  58. deploy: true
  59. },
  60. amber_canvas: {
  61. output_dir : 'js',
  62. src: ['st/Canvas.st', 'st/SUnit.st'],
  63. deploy: true
  64. },
  65. amber_IDE: {
  66. output_dir : 'js',
  67. src: ['st/IDE.st'],
  68. libraries: ['Canvas'],
  69. deploy: true
  70. },
  71. amber_tests: {
  72. output_dir : 'js',
  73. src: ['st/Kernel-Tests.st', 'st/Compiler-Tests.st', 'st/SUnit-Tests.st'],
  74. libraries: ['SUnit']
  75. },
  76. amber_test_runner: {
  77. src: ['test/Test.st'],
  78. libraries: [
  79. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  80. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser',
  81. 'SUnit', 'Importer-Exporter',
  82. 'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
  83. output_name: 'test/amber_test_runner'
  84. },
  85. amber_dev: {
  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: 'js/amber_dev'
  92. },
  93. amber_cli: {
  94. output_dir: 'cli/js',
  95. src: ['cli/st/AmberCli.st'],
  96. libraries: [
  97. 'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
  98. 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser'
  99. ],
  100. main_class: 'AmberCli',
  101. output_name: 'amber-cli'
  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. };