mirah 0.1.2-java → 0.1.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/History.txt +225 -0
  3. data/Rakefile +108 -315
  4. data/TODO.md +100 -0
  5. data/bin/bundler +16 -0
  6. data/bin/rake +16 -0
  7. data/dist/mirahc.jar +0 -0
  8. data/examples/appengine/Readme +0 -1
  9. data/examples/literals.mirah +17 -0
  10. data/examples/macros/string_each_char.mirah +1 -1
  11. data/lib/mirah.rb +11 -21
  12. data/lib/mirah/transform/transformer.rb +1 -2
  13. data/lib/mirah/util/class_loader.rb +1 -1
  14. data/lib/mirah/util/logging.rb +0 -63
  15. data/lib/mirah/util/process_errors.rb +1 -0
  16. data/lib/mirah/version.rb +1 -1
  17. data/{examples/simple_class.mirah~ → test/artifacts/jar_test.rb} +7 -11
  18. data/{lib/mirah/commands.rb → test/artifacts/jruby_test.rb} +8 -5
  19. data/test/core/typer_test.rb +29 -11
  20. data/test/core/util/argument_processor_test.rb +24 -23
  21. data/test/core/util/class_loader_test.rb +7 -4
  22. data/test/core/util/{compilation_state_test.rb → jvm_version_test.rb} +20 -16
  23. data/test/fixtures/org/foo/ImplicitClassRetAnno.java +4 -0
  24. data/test/fixtures/org/foo/IntAnno.java +9 -0
  25. data/test/jvm/annotations_test.rb +11 -11
  26. data/test/jvm/blocks_test.rb +16 -12
  27. data/test/jvm/constructors_test.rb +8 -8
  28. data/test/jvm/enumerable_test.rb +48 -24
  29. data/test/jvm/generics_test.rb +3 -7
  30. data/test/jvm/import_test.rb +14 -0
  31. data/test/jvm/interface_test.rb +9 -24
  32. data/test/jvm/jvm_commands_test.rb +22 -4
  33. data/test/jvm/jvm_compiler_test.rb +124 -79
  34. data/test/jvm/list_extensions_test.rb +1 -1
  35. data/test/jvm/macros_test.rb +67 -14
  36. data/test/jvm/main_method_test.rb +1 -1
  37. data/test/jvm/new_backend_test_helper.rb +100 -3
  38. data/{lib/mirah/jvm/types/bitescript_ext.rb → test/jvm/static_fields_test.rb} +22 -21
  39. data/test/mirrors/base_type_test.rb +4 -3
  40. data/test/mirrors/bytecode_mirror_test.rb +35 -15
  41. data/test/mirrors/generics_test.rb +14 -5
  42. data/test/mirrors/member_test.rb +2 -1
  43. data/test/mirrors/method_lookup_test.rb +18 -6
  44. data/test/mirrors/mirrors_test.rb +87 -20
  45. data/test/mirrors/simple_async_mirror_loader_test.rb +7 -3
  46. data/test/mirrors/simple_mirror_loader_test.rb +5 -5
  47. data/test/test_helper.rb +25 -1
  48. metadata +18 -78
  49. data/bin/mirahp +0 -27
  50. data/bin/mirahp.cmd +0 -16
  51. data/examples/Fib.class +0 -0
  52. data/javalib/mirah-bootstrap.jar +0 -0
  53. data/javalib/mirah-builtins.jar +0 -0
  54. data/javalib/mirah-compiler.jar +0 -0
  55. data/javalib/mirah-mirrors.jar +0 -0
  56. data/javalib/mirah-newast-transitional.jar +0 -0
  57. data/javalib/mirah-parser.jar +0 -0
  58. data/javalib/mirah-util.jar +0 -0
  59. data/lib/mirah/ast.rb +0 -43
  60. data/lib/mirah/ast/scope.rb +0 -262
  61. data/lib/mirah/commands/base.rb +0 -59
  62. data/lib/mirah/commands/compile.rb +0 -39
  63. data/lib/mirah/commands/parse.rb +0 -36
  64. data/lib/mirah/commands/run.rb +0 -78
  65. data/lib/mirah/generator.rb +0 -150
  66. data/lib/mirah/jvm/compiler.rb +0 -50
  67. data/lib/mirah/jvm/compiler/base.rb +0 -421
  68. data/lib/mirah/jvm/compiler/jvm_bytecode.rb +0 -1194
  69. data/lib/mirah/jvm/method_lookup.rb +0 -307
  70. data/lib/mirah/jvm/types.rb +0 -45
  71. data/lib/mirah/jvm/types/array_type.rb +0 -60
  72. data/lib/mirah/jvm/types/ast_ext.rb +0 -31
  73. data/lib/mirah/jvm/types/basic_types.rb +0 -41
  74. data/lib/mirah/jvm/types/block_type.rb +0 -15
  75. data/lib/mirah/jvm/types/boolean.rb +0 -70
  76. data/lib/mirah/jvm/types/enumerable.rb +0 -80
  77. data/lib/mirah/jvm/types/extensions.rb +0 -110
  78. data/lib/mirah/jvm/types/factory.rb +0 -830
  79. data/lib/mirah/jvm/types/floats.rb +0 -99
  80. data/lib/mirah/jvm/types/generic_type.rb +0 -72
  81. data/lib/mirah/jvm/types/implicit_nil_type.rb +0 -29
  82. data/lib/mirah/jvm/types/integers.rb +0 -131
  83. data/lib/mirah/jvm/types/interface_definition.rb +0 -20
  84. data/lib/mirah/jvm/types/intrinsics.rb +0 -385
  85. data/lib/mirah/jvm/types/literals.rb +0 -89
  86. data/lib/mirah/jvm/types/meta_type.rb +0 -54
  87. data/lib/mirah/jvm/types/methods.rb +0 -946
  88. data/lib/mirah/jvm/types/null_type.rb +0 -39
  89. data/lib/mirah/jvm/types/number.rb +0 -184
  90. data/lib/mirah/jvm/types/primitive_type.rb +0 -76
  91. data/lib/mirah/jvm/types/source_mirror.rb +0 -274
  92. data/lib/mirah/jvm/types/type.rb +0 -311
  93. data/lib/mirah/jvm/types/type_definition.rb +0 -72
  94. data/lib/mirah/jvm/types/void_type.rb +0 -19
  95. data/lib/mirah/util/compilation_state.rb +0 -60
  96. data/test/core/commands_test.rb +0 -89
  97. data/test/core/generator_test.rb +0 -26
  98. data/test/fixtures/org/foo/LowerCaseInnerClass$inner.class +0 -0
  99. data/test/fixtures/org/foo/LowerCaseInnerClass.class +0 -0
  100. data/test/jvm/bytecode_test_helper.rb +0 -193
  101. data/test/jvm/factory_test.rb +0 -28
  102. data/test/jvm/java_typer_test.rb +0 -283
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94bd269f142b48ceb3d74a18a8b55830d23abef4
4
- data.tar.gz: db296eba09334207d811878f5c703ca7dafd8167
3
+ metadata.gz: 9c43543a6d373e0cc8f1dbc80ba79635dbe8ac93
4
+ data.tar.gz: b26f831bf81940b7268657bd1d8839e17dae25b6
5
5
  SHA512:
6
- metadata.gz: 103411eeafff8608f3ee284ef2298fd85f14b065c70b69799ed94d5c2650e3a7806fa9aaabe327a3db73fdccb1e46c64d3d7161c0d971ec5bf35ee9210fb7af9
7
- data.tar.gz: 591ed4759862e3ecf0b9c33a4332a87639ea82c761b925ea7b56a961610af0f0fb3a7efd8ccd1b2e3aef602d521fcac9b49bf05e4a2590b688984977e4870607
6
+ metadata.gz: bb72ed358c9b843a5dfcc10f0f452f434fa332c35771e725822ef973a622862a75b8b501f7e325e51832e92aad0dd5edf15df71b3d4350b9db6c911013cbf61e
7
+ data.tar.gz: 8ad01e2fcb6ebdebb56bc1c1d6e8d30fb4b78fe5e4fcf0273ed62a0f7eb5f8020379a63637ee5e8c6d43b72c4fd7ef7f820bb647e4e2bfa681a9d244a93ad070
@@ -1,3 +1,228 @@
1
+
2
+ === 0.1.3 Metacircularity: Achieved / 2014-08-06
3
+
4
+ 5b1454c bump parser w/ java 7 jar
5
+ 8c0be9d de-SNAPSHOT/dev ify versions
6
+ 0bb1553 update parser
7
+ 1c90452 update NOTICE
8
+ 2ade81b if the type params are unconstrained wildcards, consider them resolved
9
+ 347c633 allow jruby-head build to fail
10
+ a6bb171 add 1.8 - 1.8 to travis
11
+ 9019478 fix failing generics test
12
+ d2c8ba2 fix test workaround for asm version
13
+ e5133d5 formatting + while -> each in mirah_arguments
14
+ 7f37cd4 add another guard for a bundler require
15
+ 0d5cdd8 add COPYING to zip dist
16
+ 48298cf add place to put artifact tests, w/ happy path examples
17
+ 44955db bump copyright year in Rakefile
18
+ 447a878 begin rescue load error hack
19
+ 10dfe71 maybe a well placed rescue'll fix jruby-head build
20
+ 02b0fcd skip tests that will NPE on JRuby 1.7.13
21
+ 3f0114c forgot java.lang in last change. Oops
22
+ 2364325 always compile mirahc for 1.7 or lower
23
+ 9d482e5 rm 1.8 -> 1.7 bytecode since 1.8 is available in new asm dep
24
+ 0691433 try moving bundler/setup require
25
+ 9c53cda always get latest SNAPSHOT
26
+ 52d850c bump snapshot to download
27
+ c0a7c57 ignore downloaded asm lib jar
28
+ e454796 add asm license to a file that's included in the compiler jar
29
+ e7d6153 update asm to 5.0.3 for java 8 support & awesomeness
30
+ c1537a7 oops. Fix missed escape in gemspec
31
+ 27567c6 rm some refs to old jars + depend only on mirahc.jar in gem
32
+ d934870 clean up typer a little
33
+ ba8acf7 missed a place where there should be a require test_helper
34
+ d88d880 ensure -V overrides the default silent for run
35
+ 71e6fa8 silence logger for run commands
36
+ a2abfb7 update parser to one that can parse the parser
37
+ 6480725 add consistent sorting to tool sources
38
+ e02ca0b depend on a good snapshot in sonatype
39
+ fe339bf more Rakefile cruft. Now dist task shouldn't error out
40
+ f96626b add some whitespace
41
+ 442519b remove using confusing space char literal that doesn't parse
42
+ b3bd746 merge unquotes in block args before constructing the block future.
43
+ 3ff0d0a Revert "use latest snapshot as the compiler to bootstrap with"
44
+ 85bdbd3 add note about pushing snapshots to maven instructions
45
+ 6f9e336 rm apparently unused jar
46
+ 7036f6b ignore the downloaded bootstrap compiler
47
+ 96c563a use latest snapshot as the compiler to bootstrap with
48
+ d7d14ec add Nick to the author list in the gemspec
49
+ 638c47f rm mirahp from gemspec as it's gone
50
+ 46f622b clean up unused / needed portions of rakefile
51
+ 3c4cc9a refer to jruby exception w/ string instead of class obj
52
+ be3fc9f remove commented requires
53
+ 7aa9091 remove references to bitescript
54
+ 5cd2e93 add tests for JvmVersion
55
+ a8d3f2d have gem depend on dist/mirahc.jar
56
+ 1b51fe7 Merge pull request #252 from KeenS/master
57
+ 16f7623 more literals
58
+ 15ca101 remove dependency on bitescript, rm CompilationState, set max bytecode version to 1.7
59
+ aa282e5 Squashed commit of the following:
60
+ fe7bd6c add literal examples
61
+ 487d737 Merge branch 'shannah-master'
62
+ f9100a2 Added wrapper around JVMScope.import method so that it can be called from java. import is a reserved word in java.
63
+ 9ae690f Fixed stack overflow error because of two static compile and object compile method implemented in Mirahc. https://github.com/mirah/mirah/issues/250
64
+ b981113 use 1.7 target when running on 1.8 for now
65
+ 6013668 1.8 isn't supported in the asm version we're currently using. duh
66
+ 222f5ed exclude jdk7 targeting 8 from build matrix
67
+ b334a0a update travis w/ java target version builds+jruby head vs 19 mode
68
+ 0b4cdbd make test target JVM version configable by MIRAH_TEST_JVM_VERSION env var
69
+ f1f859d add some whitespace to Rakefile
70
+ 2b319e8 update test_local_field_conflict to test_local_method_conflict
71
+ f02d9b1 rm unused local in ProxyNode
72
+ 3677f5e Merge branch 'new_bootstrap' of git://github.com/ribrdb/mirah into ribrdb-new_bootstrap
73
+ 5dbd5b9 Merge branch 'master' into bootstrap_with_new_compiler
74
+ 89d4447 allow unquoted block args, both with and without pipes
75
+ 39d7946 whitespace in examples/macros/string_each_char.mirah
76
+ fe16b3f add unary negation test
77
+ b283dd8 add position based content lookup to typer for debugging
78
+ b2cb3f0 add some more logging around redeclaring types
79
+ dc9f253 fix nested error descriptions popping up in test runs
80
+ 17165f6 fix map collection extension method
81
+ b2aef50 rename Typer scope creation for methods to be more consistent
82
+ 70a95a7 fix BlocksTest#test_block_with_method_def
83
+ 22efc0c fix system reference in test helper
84
+ 30955f6 blocks_test whitespace
85
+ df57318 log source of AST to be typed, where available
86
+ d15e37f fix up logging. typo, multi install, rm ruby impl
87
+ 9cd7f6e allow variable shadowing, fix rescue shadowing test failure
88
+ c2bb20b raise a better error in bytecode generation on missing local
89
+ 93f4de2 rename handle_args back to applyArgs
90
+ 30cf680 rm factory_test since it's subject is gone
91
+ c59d04b deprecate -c for classpath in favor of -cp / --classpath
92
+ 9ef9329 delay exiting to the main methods of commands so they're testable. Also more JRuby friendly
93
+ e569bf2 delete all the things! rm JRuby Compiler bits
94
+ b045cde use File::PATH_SEPARATOR for classpath when constructing classpaths in Rakefile
95
+ 486d634 clean up some lost changes removing the old test helper code
96
+ 2dff436 rm require of removed file
97
+ bb7d224 rm mirahp
98
+ f9761b2 rm old generator test
99
+ cfa7c39 rm bytecode test helper as it's not needed anymore
100
+ 80d02da oops. fix typo in args code
101
+ 554860a rm old backend rake tasks
102
+ 78596fa only do new_ci and not bytecode_ci
103
+ b45d158 move logger setup to MirahArguments
104
+ 68bef4a pull out arg object into its own file
105
+ 04a3b08 convert class loader tests to point directly at Mirah classes
106
+ d884d90 extract an object to hold onto MirahTool cfg
107
+ 3a58e94 fix c&p'd test case name
108
+ 4f86094 add color toggle to self hosted jar
109
+ 3b3713a use CLASS as default retention for annotations
110
+ ddf6782 fix annotation value test
111
+ 3422c00 rm accidentally checked fix for editor that doesn't understand 'EOF'
112
+ 8208a27 rm test that identified broken behavior that's fixed wrt interfaces
113
+ 32c2f1e replace System.out.println w/ puts in tests
114
+ 7ae7d17 change field setter test so it doesn't depend on ast
115
+ 3c7a417 improve compile, parse_and_type new backend test helpers
116
+ 71536e6 extract diagnostic construction in error collector into helper method
117
+ 9df5e48 fix compilation helper s.t. separate compilation test passes
118
+ b0bfa37 use the pend w/ block form so that when ClassPath is added, it'll fail
119
+ 1b870c6 change mirror assertion from equality to same type check
120
+ 2581267 Revert "fix mirror lub equality assertion"
121
+ 87e47ae Merge branch 'master' into new_bootstrap
122
+ f84664a Add targets for bootstrapping mirahc.jar from itself.
123
+ 3eca2d3 Fix for generic types inside a binding.
124
+ 72ba91c Implement equality for ResolvedCall to prevent extra type updates.
125
+ 2bf331c Proxy node fixes.
126
+ dc23f9c Fix AssignmentFuture.
127
+ 366825f Revert "fix mirror lub equality assertion"
128
+ 4e9cbe4 Fix for MethodLookup debugging.
129
+ 40452c9 Fix error propagation with AssignableTypeFuture
130
+ 1b68b2f ProxyNode fixes.
131
+ 03b2238 Add debugging info to MethodLookup.
132
+ 7371f11 Improve CallFuture error propagation.
133
+ da701e2 Update parser again
134
+ bcce07e Merge branch 'bootstrap_with_new_compiler' of https://github.com/mirah/mirah into new_bootstrap
135
+ 2fc8bef Introduce a proxy node, so we can properly clone method calls.
136
+ 7b9408e Update parser
137
+ 2e7b404 Explicitly specify the package of AST types in case there's a conflicting type in the macro's package.
138
+ 8037711 Merge branch 'new_bootstrap' of git://github.com/ribrdb/mirah into ribrdb-new_bootstrap
139
+ 64fee4d Test fixes.
140
+ 29d335a try fixing travis by fixing file sorting
141
+ 67966e0 change rake deps to dist/mirahc for now + add clean for downloaded deps
142
+ 53123e1 fix superclass mirror type updates
143
+ 99350b3 move local var def in mirrors base_type closer to usage
144
+ f12196b add toString to NarrowingTypeFuture
145
+ a0053ba break out failing superclass type update mirror test
146
+ d69f90d move debugging help to the test helper
147
+ 673d9e4 add tmp dir to ignored files
148
+ 3007c6c add pend to test depending on undefined constant
149
+ d306a89 fix mirror lub equality assertion
150
+ 0099f67 move debugging module into test_helper
151
+ ea9d8ea typer formatting
152
+ 61bea51 Update test targets.
153
+ e0fff81 Merge branch 'jvm_version' into new_bootstrap
154
+ e645fbf Merge branch 'master' of https://github.com/mirah/mirah
155
+ 010280e Fix for static imports that are updated after use.
156
+ 13c055a Update tests to use new compiler.
157
+ d4231c6 Importing an undefined class should be an error
158
+ a4a72d2 Fix for loading compiler annotations.
159
+ ecff9e6 Fix MethodFuture error propagation
160
+ 492b08c Fix CallFuture error propagation
161
+ d62bdb0 External debugger support
162
+ b38a592 add helper for expanding and replacing macros
163
+ d4626eb extract isMacro helper in typer
164
+ be72bb5 Pause on inference errors when using type debugger.
165
+ 1431331 bump version to 0.1.3
166
+ fe53788 fix up maven release notes
167
+ a1f776e fix bug due to rm'd optional arg on typer.infer
168
+ 336d0ec Merge branch 'master' of git://github.com/ribrdb/mirah into ribrdb-master
169
+ 6ef42e7 fix invalid bytecode.
170
+ 944abf9 Fix maven build.
171
+ d9f9e9e Print a warning instead of raising an exception when building a closure with no methods.
172
+ 4706809 Update classpath for macro classloader.
173
+ 4ade702 Update the bootstrap compiler
174
+ 6335479 Fix comparison of MirrorProxies in LubFinder.
175
+ da24688 Fixes for generics.
176
+ db0c49e Fix rakefile syntax
177
+ 8cda99e Test fixes
178
+ cf46341 MirrorProxy.erasure should return a MirrorProxy.
179
+ 0709b89 Debugger improvements
180
+ 3311a0d Implement interactive type debugger.
181
+ 90f44dd Start implementing type debugger.
182
+ dd3f3bf Merge branch 'master' into jvm_version
183
+ fe037d1 Fix comparison of meta types after incompatible changes.
184
+ b045672 Fix supertypes of main class.
185
+ e088086 Fix debug formatting for LocalFuture
186
+ 4c0588b More classpath fixes.
187
+ 40ef885 Fix loading of macro types.
188
+ 6a5b61e Better support for extending SimpleDiagnostics
189
+ 93b0650 Implement MirahCommand.
190
+ cbb2630 Merge branch 'fb2' into jvm_version
191
+ 6c393f1 Add dependency on jruby-complete.jar
192
+ 56df34f Fix a couple bugs in conflicting method/macro detection.
193
+ 2622fa5 Fix typo in bootstrap mirahc.jar version.
194
+ 9dd9287 Fix classfile version of java classes.
195
+ e91515e Fix for test_method_def_after_macro_def_with_same_name_raises_error.
196
+ 0d6f12d Fix jvm version flag.
197
+ 3858e40 Add dependency on mirahc-1.1.2-dev.jar
198
+ 5a44329 Add --jvm option to mirahc.jar
199
+ b858825 Download bootstrap mirahc from mirah.googlecode.com.
200
+ aaa033e Fix constructors test.
201
+ d3b3697 Fix lub test.
202
+ e916083 Change test_findMethod failure to pending.
203
+ 0460f68 Fix negated comparisons with NaN.
204
+ 066fa56 Fix 'raise ex' where 'ex' is an exception object.
205
+ 21ce0df Fix classloader used for loading macros.
206
+ 3fec7e0 Fix inference for rescue body.
207
+ 6b47ed4 Implement unary minus operator.
208
+ ea578b3 Add intrinsics to NullType
209
+ f3837aa Improve debug output for type futures.
210
+ 41e6233 Test for nil methods.
211
+ 01cefa7 Fix vmofule -- loggers get garbage collected if no one retains them.
212
+ e4ea7d7 Methods shouldn't return NullType
213
+ 9b468e7 Support Noops inside ClassDefinition
214
+ 0d6675e Patch bad bytecode in mirah.lang.ast.Unquote
215
+ c35bb64 Add cast helper method for macros to use.
216
+ a0c92d5 Fix block arguments in macros.
217
+ ab3569f Support compiling a directory,
218
+ aa97f2f Fix macro classpath.
219
+ fc30632 Make sure UnreachableType doesn't leak out of method return values.
220
+ de4bbe7 Fix subtyping for NullType.
221
+ dac8dc1 Fix lub of raw and generic type.
222
+ 58d8305 Add todo to download compiler.
223
+ be3324f Clean up compilation using the new compiler.
224
+ ee560c4 Use real macros in org.mirah.macros.*
225
+
1
226
  === 0.1.2 New Year, New Release / 2014-01-05
2
227
 
3
228
  8421140 add desc'd rake task for building mirahc.jar
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2010-2013 The Mirah project authors. All Rights Reserved.
1
+ # Copyright (c) 2010-2014 The Mirah project authors. All Rights Reserved.
2
2
  # All contributing project authors may be found in the NOTICE file.
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,40 +12,36 @@
12
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
-
15
+ begin
16
+ require 'bundler/setup'
17
+ rescue LoadError
18
+ puts "couldn't load bundler. Check your environment."
19
+ end
16
20
  require 'rake'
17
21
  require 'rake/testtask'
18
22
  require 'rubygems'
19
23
  require 'rubygems/package_task'
20
- require 'bundler/setup'
21
24
  require 'java'
22
25
  require 'jruby/compiler'
23
26
  require 'ant'
24
27
 
28
+ #TODO update downloads st build reqs that are not run reqs go in a different dir
29
+ # put run reqs in javalib
30
+ # final artifacts got in dist
31
+
25
32
  # this definition ensures that the bootstrap tasks will be completed before
26
33
  # building the .gem file. Otherwise, the gem may not contain the jars.
27
- task :gem => [:bootstrap,
28
- "javalib/mirah-compiler.jar",
29
- "javalib/mirah-mirrors.jar"]
34
+ task :gem => :compile
35
+
30
36
  Gem::PackageTask.new Gem::Specification.load('mirah.gemspec') do |pkg|
31
37
  pkg.need_zip = true
32
38
  pkg.need_tar = true
33
39
  end
34
40
 
35
- bitescript_lib_dir = File.dirname Gem.find_files('bitescript').first
41
+ task :default => :new_ci
36
42
 
37
- task :bootstrap => ['javalib/mirah-bootstrap.jar',
38
- 'javalib/mirah-builtins.jar',
39
- 'javalib/mirah-util.jar']
40
-
41
-
42
- task :default => :bytecode_ci
43
-
44
- desc "run bytecode backend ci"
45
- task :bytecode_ci => [:'test:core',
46
- :'test:jvm:bytecode']
47
43
  desc "run new backend ci"
48
- task :new_ci => [:'test:core', :'test:jvm:new']
44
+ task :new_ci => [:'test:core', :'test:jvm', :'test:artifacts']
49
45
 
50
46
  def run_tests tests
51
47
  results = tests.map do |name|
@@ -65,61 +61,52 @@ end
65
61
 
66
62
  desc "run full test suite"
67
63
  task :test do
68
- run_tests [ 'test:core', 'test:plugins', 'test:jvm', 'test:jvm:new' ]
64
+ run_tests [ 'test:core', 'test:plugins', 'test:jvm', 'test:artifacts' ]
69
65
  end
70
66
 
71
67
  namespace :test do
72
68
 
73
69
  desc "run the core tests"
74
- Rake::TestTask.new :core => :bootstrap do |t|
70
+ Rake::TestTask.new :core => :compile do |t|
75
71
  t.libs << 'test'
76
72
  t.test_files = FileList["test/core/**/*test.rb"]
77
73
  java.lang.System.set_property("jruby.duby.enabled", "true")
78
74
  end
79
75
 
80
76
  desc "run tests for plugins"
81
- Rake::TestTask.new :plugins => :bootstrap do |t|
77
+ Rake::TestTask.new :plugins => :compile do |t|
82
78
  t.libs << 'test'
83
79
  t.test_files = FileList["test/plugins/**/*test.rb"]
84
80
  java.lang.System.set_property("jruby.duby.enabled", "true")
85
81
  end
86
82
 
87
- desc "run jvm tests, both bytecode and java source"
88
- task :jvm do
89
- run_tests ["test:jvm:bytecode"]
83
+ desc "run the artifact tests"
84
+ Rake::TestTask.new :artifacts => :compile do |t|
85
+ t.libs << 'test'
86
+ t.test_files = FileList["test/artifacts/**/*test.rb"]
90
87
  end
91
88
 
89
+
90
+ desc "run jvm tests"
91
+ task :jvm => 'test:jvm:all'
92
+
92
93
  namespace :jvm do
93
94
  task :test_setup => [:clean_tmp_test_directory, :build_test_fixtures]
94
95
 
95
- desc "run jvm tests compiling to bytecode"
96
- Rake::TestTask.new :bytecode => [:bootstrap,
97
- "javalib/mirah-compiler.jar",
98
- :test_setup] do |t|
99
- t.libs << 'test' <<'test/jvm'
100
- t.ruby_opts.concat ["-r", "bytecode_test_helper"]
101
- t.test_files = FileList["test/jvm/**/*test.rb"]
102
- end
103
-
104
96
  desc "run jvm tests using the new self hosted backend"
105
- task :new do
106
- run_tests ["test:jvm:new_backend", "test:jvm:mirrors"]
107
- end
108
-
109
- Rake::TestTask.new :new_backend => [:bootstrap, "javalib/mirah-compiler.jar", :test_setup] do |t|
110
- t.libs << 'test' << 'test/jvm'
111
- t.ruby_opts.concat ["-r", "new_backend_test_helper"]
112
- t.test_files = FileList["test/jvm/**/*test.rb"]
97
+ task :all do
98
+ run_tests ["test:jvm:mirror_compilation", "test:jvm:mirrors"]
113
99
  end
114
100
 
115
101
  desc "run tests for mirror type system"
116
- Rake::TestTask.new :mirrors => "javalib/mirah-mirrors.jar" do |t|
102
+ Rake::TestTask.new :mirrors => "dist/mirahc.jar" do |t|
117
103
  t.libs << 'test'
118
104
  t.test_files = FileList["test/mirrors/**/*test.rb"]
119
105
  end
120
- Rake::TestTask.new :mirror_compilation => "javalib/mirah-mirrors.jar" do |t|
106
+
107
+ Rake::TestTask.new :mirror_compilation => ["dist/mirahc.jar", :test_setup] do |t|
121
108
  t.libs << 'test' << 'test/jvm'
122
- t.ruby_opts.concat ["-r", "mirror_compilation_test_helper"]
109
+ t.ruby_opts.concat ["-r", "new_backend_test_helper"]
123
110
  t.test_files = FileList["test/jvm/**/*test.rb"]
124
111
  end
125
112
  end
@@ -133,8 +120,11 @@ task :clean_tmp_test_directory do
133
120
  end
134
121
 
135
122
  task :build_test_fixtures do
136
- ant.javac 'destdir' => "tmp_test/fixtures", 'srcdir' => 'test/fixtures',
137
- 'includeantruntime' => false, 'debug' => true, 'listfiles' => true
123
+ ant.javac 'destdir' => "tmp_test/fixtures",
124
+ 'srcdir' => 'test/fixtures',
125
+ 'includeantruntime' => false,
126
+ 'debug' => true,
127
+ 'listfiles' => true
138
128
  end
139
129
 
140
130
  task :init do
@@ -146,29 +136,27 @@ desc "clean up build artifacts"
146
136
  task :clean do
147
137
  ant.delete 'quiet' => true, 'dir' => 'build'
148
138
  ant.delete 'quiet' => true, 'dir' => 'dist'
149
- rm_f 'javalib/mirah-bootstrap.jar'
150
- rm_f 'javalib/mirah-compiler.jar'
151
- rm_f 'javalib/mirah-builtins.jar'
152
- rm_f 'javalib/mirah-util.jar'
153
- rm_f 'javalib/mirah-mirrors.jar'
139
+ rm_f 'dist/mirahc.jar'
154
140
  rm_rf 'tmp'
155
141
  end
156
142
 
157
- task :compile => [:init, :bootstrap, :util, :jvm_backend]
158
- task :util => 'javalib/mirah-util.jar'
159
- task :jvm_backend => 'javalib/mirah-compiler.jar'
143
+ desc "clean downloaded dependencies"
144
+ task :clean_downloads do
145
+ rm_f "javalib/mirahc-prev.jar"
146
+ rm_f 'javalib/jruby-complete.jar'
147
+ rm_f 'javalib/asm-5.jar'
148
+ end
149
+
150
+ task :compile => 'dist/mirahc.jar'
151
+ task :jvm_backend => 'dist/mirahc.jar'
160
152
 
161
- desc "build basic jar for distribution"
153
+ desc "build backwards-compatible ruby jar"
162
154
  task :jar => :compile do
163
155
  ant.jar 'jarfile' => 'dist/mirah.jar' do
164
156
  fileset 'dir' => 'lib'
165
157
  fileset 'dir' => 'build'
166
158
  fileset 'dir' => '.', 'includes' => 'bin/*'
167
- fileset 'dir' => bitescript_lib_dir
168
- zipfileset 'src' => 'javalib/mirah-bootstrap.jar'
169
- zipfileset 'src' => 'javalib/mirah-builtins.jar'
170
- zipfileset 'src' => 'javalib/mirah-util.jar'
171
- zipfileset 'src' => 'javalib/mirah-compiler.jar'
159
+ zipfileset 'src' => 'dist/mirahc.jar'
172
160
  manifest do
173
161
  attribute 'name' => 'Main-Class', 'value' => 'org.mirah.MirahCommand'
174
162
  end
@@ -176,15 +164,11 @@ task :jar => :compile do
176
164
  end
177
165
 
178
166
  namespace :jar do
179
- desc "build mirahc.jar"
180
- task :mirahc => 'javalib/mirahc.jar'
181
-
182
- desc "build self-contained, complete jar"
183
- task :complete => [:jar, 'javalib/jruby-complete.jar'] do
167
+ desc "build self-contained, complete ruby jar"
168
+ task :complete => [:jar, 'javalib/asm-5.jar'] do
184
169
  ant.jar 'jarfile' => 'dist/mirah-complete.jar' do
185
170
  zipfileset 'src' => 'dist/mirah.jar'
186
- zipfileset 'src' => 'javalib/jruby-complete.jar'
187
- zipfileset 'src' => 'javalib/mirah-parser.jar'
171
+ zipfileset 'src' => 'javalib/asm-5.jar'
188
172
  manifest do
189
173
  attribute 'name' => 'Main-Class', 'value' => 'org.mirah.MirahCommand'
190
174
  end
@@ -206,6 +190,7 @@ task :zip => 'jar:complete' do
206
190
  cp 'README.md', "#{basedir}"
207
191
  cp 'NOTICE', "#{basedir}"
208
192
  cp 'LICENSE', "#{basedir}"
193
+ cp 'COPYING', "#{basedir}"
209
194
  cp 'History.txt', "#{basedir}"
210
195
  sh "sh -c 'cd tmp ; zip -r ../dist/mirah-#{Mirah::VERSION}.zip mirah-#{Mirah::VERSION}/*'"
211
196
  rm_rf 'tmp'
@@ -214,274 +199,82 @@ end
214
199
  desc "Build all redistributable files"
215
200
  task :dist => [:gem, :zip]
216
201
 
217
- file_create 'javalib/jruby-complete.jar' do
202
+ #TODO find/create ssl location for this jar
203
+ file_create 'javalib/asm-5.jar' do
218
204
  require 'open-uri'
219
- puts "Downloading jruby-complete.jar"
220
- open('http://jruby.org.s3.amazonaws.com/downloads/1.7.4/jruby-complete-1.7.4.jar', 'rb') do |src|
221
- open('javalib/jruby-complete.jar', 'wb') do |dest|
205
+ puts "Downloading asm-5.jar"
206
+ open('http://central.maven.org/maven2/org/ow2/asm/asm-all/5.0.3/asm-all-5.0.3.jar', 'rb') do |src|
207
+ open('javalib/asm-5.jar', 'wb') do |dest|
222
208
  dest.write(src.read)
223
209
  end
224
210
  end
225
211
  end
226
212
 
227
- file_create 'javalib/mirah-newast-transitional.jar' do
213
+ file_create 'javalib/mirahc-prev.jar' do
228
214
  require 'open-uri'
229
- puts "Downloading mirah-newast-transitional.jar"
230
- open('http://mirah.googlecode.com/files/mirah-newast-transitional.jar', 'rb') do |src|
231
- open('javalib/mirah-newast-transitional.jar', 'wb') do |dest|
232
- dest.write(src.read)
233
- end
234
- end
235
- end
215
+ # get latest snapshot from XML description.
216
+ xml = open('https://oss.sonatype.org/service/local/repositories/snapshots/content/org/mirah/mirah/0.1.3-SNAPSHOT/').read
217
+ url = xml.scan(%r{<resourceURI>(https:.*\.jar)</resourceURI>}).map(&:first).sort.last
236
218
 
237
- file 'javalib/mirah-bootstrap.jar' => ['javalib/mirah-newast-transitional.jar',
238
- 'src/org/mirah/MirahClassLoader.java',
239
- 'src/org/mirah/IsolatedResourceLoader.java',
240
- 'src/org/mirah/MirahLogFormatter.mirah',
241
- 'src/org/mirah/util/simple_diagnostics.mirah'] +
242
- Dir['src/org/mirah/{macros,typer}/*.mirah'] +
243
- Dir['src/org/mirah/typer/simple/*.mirah'] +
244
- Dir['src/org/mirah/macros/anno/*.java'] do
245
- build_dir = 'build/bootstrap'
246
- rm_rf build_dir
247
- mkdir_p build_dir
248
-
249
- # Compile annotations and class loader
250
- ant.javac 'destdir' => build_dir, 'srcdir' => 'src',
251
- 'includeantruntime' => false, 'debug' => true, 'listfiles' => true
252
-
253
- # Compile the Typer and Macro compiler
254
- bootstrap_mirahc('src/org/mirah/macros', 'src/org/mirah/MirahLogFormatter.mirah', 'src/org/mirah/typer',
255
- 'src/org/mirah/util/simple_diagnostics.mirah',
256
- :classpath => ['javalib/mirah-parser.jar', 'build/bootstrap'],
257
- :dest => build_dir
258
- # :options => ['-V']
259
- )
260
- add_quote_macro
261
- cp Dir['src/org/mirah/macros/*.tpl'], "#{build_dir}/org/mirah/macros"
262
-
263
- # Build the jar
264
- ant.jar 'jarfile' => 'javalib/mirah-bootstrap.jar' do
265
- fileset 'dir' => build_dir
266
- end
267
- end
219
+ puts "Downloading mirahc-prev.jar from #{url}"
268
220
 
269
- file 'javalib/mirahc-2.jar' => ['javalib/mirahc.jar'] do
270
- build_dir = 'build/bootstrap'
271
- rm_rf build_dir
272
- mkdir_p build_dir
273
-
274
- # Compile annotations and class loader
275
- ant.javac 'source' => '1.5', 'destdir' => build_dir, 'srcdir' => 'src',
276
- 'includeantruntime' => false, 'debug' => true, 'listfiles' => true
277
-
278
- # Compile the Typer and Macro compiler
279
- stage1_files = Dir['src/org/mirah/{builtins,jvm/types,macros,util,}/*.mirah',
280
- 'src/org/mirah/typer/**/*.mirah']
281
- runjava('javalib/mirahc.jar',
282
- '-d', build_dir,
283
- '-classpath', 'javalib/mirah-parser.jar',
284
- *stage1_files)
285
-
286
- add_quote_macro
287
- cp Dir['src/org/mirah/macros/*.tpl'], "#{build_dir}/org/mirah/macros"
288
-
289
- stage2_files = Dir['src/org/mirah/jvm/{compiler,mirrors,model}/**/*.mirah',
290
- 'src/org/mirah/tool/*.mirah']
291
- runjava('javalib/mirahc.jar',
292
- '-d', build_dir,
293
- '-classpath', "javalib/mirah-parser.jar:#{build_dir}",
294
- *stage2_files)
295
-
296
- # Build the jar
297
- ant.jar 'jarfile' => 'javalib/mirahc-2.jar' do
298
- fileset 'dir' => build_dir
299
- zipfileset :src => 'javalib/jruby-complete.jar', :includes => 'org/jruby/org/objectweb/**/*'
300
- zipfileset :src => 'javalib/mirah-parser.jar'
301
- manifest do
302
- attribute :name => 'Main-Class', :value => 'org.mirah.tool.Mirahc'
221
+ open(url, 'rb') do |src|
222
+ open('javalib/mirahc-prev.jar', 'wb') do |dest|
223
+ dest.write(src.read)
303
224
  end
304
225
  end
305
226
  end
306
227
 
307
- file 'javalib/mirah-util.jar' do
308
- require 'mirah'
309
- build_dir = 'build/util'
310
- rm_rf build_dir
311
- mkdir_p build_dir
312
-
313
- # build the Ruby sources
314
- puts "Compiling Ruby sources"
315
- JRuby::Compiler.compile_argv([
316
- '-t', build_dir,
317
- '--javac',
318
- 'src/org/mirah/mirah_command.rb'
319
- ])
320
-
321
- # compile ant stuff
322
- ant_classpath = $CLASSPATH.grep(/ant/).map{|x| x.sub(/^file:/,'')}.join(File::PATH_SEPARATOR)
323
- sh *%W(jruby -S mirahc --classpath #{ant_classpath}:#{build_dir} --dest #{build_dir} src/org/mirah/ant)
324
-
325
- # compile invokedynamic stuff
326
- ant.javac 'destdir' => build_dir, 'srcdir' => 'src',
327
- 'includes' => 'org/mirah/DynalangBootstrap.java',
328
- 'classpath' => 'javalib/dynalink-0.1.jar:javalib/jsr292-mock.jar',
329
- 'includeantruntime' => false
330
-
331
- # Build the jar
332
- ant.jar 'jarfile' => 'javalib/mirah-util.jar' do
333
- fileset 'dir' => build_dir
334
- end
335
- end
336
-
337
-
338
- file 'javalib/mirah-builtins.jar' => ['javalib/mirah-bootstrap.jar'] + Dir['src/org/mirah/builtins/*.mirah'] do
339
- rm_f 'javalib/mirah-builtins.jar'
340
- rm_rf 'build/builtins'
341
- mkdir_p 'build/builtins'
342
- sh *%w(jruby -S mirahc --dest build/builtins src/org/mirah/builtins)
343
- ant.jar 'jarfile' => 'javalib/mirah-builtins.jar' do
344
- fileset 'dir' => 'build/builtins'
345
- end
346
- rm_rf 'build/builtins'
347
- end
348
-
349
- file 'javalib/mirah-compiler.jar' => ['javalib/mirah-builtins.jar'] + Dir['src/org/mirah/{util,jvm/types,jvm/compiler}/*.mirah'] do
350
- rm_f 'javalib/mirah-compiler.jar'
351
- rm_rf 'build/compiler'
352
- mkdir_p 'build/compiler'
353
- phase3_files = Dir['src/org/mirah/jvm/compiler/{class,interface,script}_compiler.mirah'] + ['src/org/mirah/jvm/compiler/backend.mirah']
354
- phase2_files = Dir['src/org/mirah/jvm/compiler/{condition,method,string}_compiler.mirah']
355
- phase1_files = Dir['src/org/mirah/jvm/compiler/*.mirah'] - phase2_files - phase3_files
356
- sh *(%w(jruby -S mirahc --dest build/compiler ) +
357
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar) +
358
- %w(src/org/mirah/util src/org/mirah/jvm/types src/org/mirah/jvm/compiler/base_compiler.mirah))
359
- sh *(%w(jruby -S mirahc --dest build/compiler ) +
360
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar:build/compiler) +
361
- %w(src/org/mirah/util/context.mirah) + phase1_files)
362
- sh *(%w(jruby -S mirahc --dest build/compiler ) +
363
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar:build/compiler) +
364
- %w(src/org/mirah/util/context.mirah) + phase2_files)
365
- sh *(%w(jruby -S mirahc --dest build/compiler ) +
366
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar:build/compiler) +
367
- %w(src/org/mirah/util/context.mirah) + phase3_files)
368
- ant.jar 'jarfile' => 'javalib/mirah-compiler.jar' do
369
- fileset 'dir' => 'build/compiler'
370
- end
371
- end
372
-
373
- file 'javalib/mirah-mirrors.jar' => ['javalib/mirah-compiler.jar'] + Dir['src/org/mirah/jvm/mirrors/**/*.mirah','src/org/mirah/jvm/model/**/*.mirah'] do
374
- rm_f 'javalib/mirah-mirrors.jar'
375
- rm_rf 'build/mirrors'
376
- mkdir_p 'build/mirrors'
377
- sh *(%w(jruby -S mirahc -N --dest build/mirrors ) +
378
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar:javalib/mirah-compiler.jar) +
379
- %w(src/org/mirah/jvm/mirrors/ src/org/mirah/jvm/model/))
380
- ant.jar 'jarfile' => 'javalib/mirah-mirrors.jar' do
381
- fileset 'dir' => 'build/mirrors'
382
- end
383
- rm_rf 'build/mirrors'
384
- end
385
-
386
- file 'javalib/mirahc.jar' => ['javalib/mirah-mirrors.jar',
387
- 'src/org/mirah/tool/mirahc.mirah',
388
- ] do
389
- rm_f 'javalib/mirahc.jar'
390
- rm_rf 'build/mirahc'
391
- mkdir_p 'build/mirahc'
392
- sh *(%w(jruby -S mirahc -N --dest build/mirahc ) +
393
- %w(--classpath javalib/mirah-parser.jar:javalib/mirah-bootstrap.jar:javalib/mirah-compiler.jar:javalib/mirah-mirrors.jar) +
394
- %w(src/org/mirah/tool/))
395
- ant.jar :jarfile => 'javalib/mirahc.jar' do
396
- fileset :dir => 'build/mirahc'
397
- zipfileset :src => 'javalib/mirah-bootstrap.jar'
398
- zipfileset :src => 'javalib/mirah-builtins.jar'
399
- zipfileset :src => 'javalib/mirah-util.jar'
400
- zipfileset :src => 'javalib/mirah-compiler.jar'
401
- zipfileset :src => 'javalib/mirah-mirrors.jar'
402
- zipfileset :src => 'javalib/jruby-complete.jar', :includes => 'org/jruby/org/objectweb/**/*'
403
- zipfileset :src => 'javalib/mirah-parser.jar'
404
- manifest do
405
- attribute :name => 'Main-Class', :value => 'org.mirah.tool.Mirahc'
406
- end
407
- end
408
- end
409
228
 
410
- if Float(JRUBY_VERSION[0..2]) >= 1.7
411
- require 'bitescript'
412
- class Annotater < BiteScript::ASM::ClassVisitor
413
- def initialize(filename, &block)
414
- cr = BiteScript::ASM::ClassReader.new(java.io.FileInputStream.new(filename))
415
- cw = BiteScript::ASM::ClassWriter.new(0)
416
- super(BiteScript::ASM::Opcodes::ASM4, cw)
417
- @block = block
418
- cr.accept(self, 0)
419
- f = java.io.FileOutputStream.new(filename)
420
- f.write(cw.toByteArray)
421
- f.close
229
+ def bootstrap_mirah_from(old_jar, new_jar)
230
+ mirah_srcs = Dir['src/org/mirah/{builtins,jvm/types,macros,util,}/*.mirah'].sort +
231
+ Dir['src/org/mirah/typer/**/*.mirah'].sort +
232
+ Dir['src/org/mirah/jvm/{compiler,mirrors,model}/**/*.mirah'].sort +
233
+ Dir['src/org/mirah/tool/*.mirah'].sort
234
+ file new_jar => mirah_srcs + [old_jar, 'javalib/asm-5.jar', 'javalib/mirah-parser.jar'] do
235
+ build_dir = 'build/bootstrap'
236
+ rm_rf build_dir
237
+ mkdir_p build_dir
238
+
239
+ # Compile Java sources
240
+ ant.javac 'source' => '1.5',
241
+ 'target' => '1.5',
242
+ 'destdir' => build_dir,
243
+ 'srcdir' => 'src',
244
+ 'includeantruntime' => false,
245
+ 'debug' => true,
246
+ 'listfiles' => true
247
+
248
+ # mirahc needs to be 1.7 or lower
249
+ build_version = java.lang.System.getProperty('java.specification.version')
250
+ if build_version.to_f > 1.7
251
+ build_version = '1.7'
422
252
  end
423
- def visitSource(*args); end
424
- def visit(version, access, name, sig, superclass, interfaces)
425
- super
426
- @block.call(self)
253
+ # Compile Mirah sources
254
+ runjava('-Xmx512m',
255
+ old_jar,
256
+ '-d', build_dir,
257
+ '-classpath', "javalib/mirah-parser.jar:#{build_dir}:javalib/asm-5.jar",
258
+ '--jvm', build_version,
259
+ *mirah_srcs)
260
+
261
+ # Build the jar
262
+ ant.jar 'jarfile' => new_jar do
263
+ fileset 'dir' => build_dir
264
+ zipfileset 'src' => 'javalib/asm-5.jar', 'includes' => 'org/objectweb/**/*'
265
+ zipfileset 'src' => 'javalib/mirah-parser.jar'
266
+ metainf 'dir' => File.dirname(__FILE__), 'includes' => 'LICENSE,COPYING,NOTICE'
267
+ manifest do
268
+ attribute 'name' => 'Main-Class', 'value' => 'org.mirah.MirahCommand'
269
+ end
427
270
  end
428
271
  end
429
272
  end
430
273
 
431
- def add_quote_macro
432
- raise "Can't compile on JRuby less than 1.7" unless defined?(Annotater)
433
- Annotater.new('build/bootstrap/org/mirah/macros/QuoteMacro.class') do |klass|
434
- av = klass.visitAnnotation('Lorg/mirah/macros/anno/MacroDef;', true)
435
- av.visit("name", "quote")
436
- args = av.visitAnnotation('arguments', 'Lorg/mirah/macros/anno/MacroArgs;')
437
- req = args.visitArray('required')
438
- req.visit(nil, 'mirah.lang.ast.Block')
439
- req.visitEnd
440
- args.visitEnd
441
- av.visitEnd
442
- end
443
- Annotater.new('build/bootstrap/org/mirah/macros/CompilerQuoteMacro.class') do |klass|
444
- av = klass.visitAnnotation('Lorg/mirah/macros/anno/MacroDef;', true)
445
- av.visit("name", "quote")
446
- args = av.visitAnnotation('arguments', 'Lorg/mirah/macros/anno/MacroArgs;')
447
- req = args.visitArray('required')
448
- req.visit(nil, 'mirah.lang.ast.Block')
449
- req.visitEnd
450
- args.visitEnd
451
- av.visitEnd
452
- end
453
- Annotater.new('build/bootstrap/org/mirah/macros/Macro.class') do |klass|
454
- av = klass.visitAnnotation('Lorg/mirah/macros/anno/Extensions;', false)
455
- macros = av.visitArray('macros')
456
- macros.visit(nil, 'org.mirah.macros.QuoteMacro')
457
- macros.visitEnd
458
- av.visitEnd
459
- end
460
- Annotater.new('build/bootstrap/org/mirah/macros/Compiler.class') do |klass|
461
- av = klass.visitAnnotation('Lorg/mirah/macros/anno/Extensions;', false)
462
- macros = av.visitArray('macros')
463
- macros.visit(nil, 'org.mirah.macros.CompilerQuoteMacro')
464
- macros.visitEnd
465
- av.visitEnd
466
- end
467
- end
274
+ bootstrap_mirah_from('javalib/mirahc-prev.jar', 'dist/mirahc.jar')
275
+ bootstrap_mirah_from('dist/mirahc.jar', 'dist/mirahc2.jar')
276
+ bootstrap_mirah_from('dist/mirahc2.jar', 'dist/mirahc3.jar')
468
277
 
469
- def bootstrap_mirahc(*paths)
470
- options = if paths[-1].kind_of?(Hash)
471
- paths.pop
472
- else
473
- {}
474
- end
475
- args = options[:options] || []
476
- if options[:classpath]
477
- args << '--classpath' << options[:classpath].map {|p| File.expand_path(p)}.join(File::PATH_SEPARATOR)
478
- end
479
- args << '-d' << File.expand_path(options[:dest]) << '--jvm' << '1.5'
480
- jarfile = File.expand_path('javalib/mirah-newast-transitional.jar')
481
- Dir.chdir(options[:dir] || '.') do
482
- runjava(jarfile, 'compile', *(args + paths))
483
- end
484
- end
485
278
 
486
279
  def runjava(jar, *args)
487
280
  sh 'java', '-jar', jar, *args