Skip to content
Newer
Older
100644 115 lines (102 sloc) 2.93 KB
0ded1dc @headius Add Apache License 2.0 header to all source files (I could find).
headius authored
1 # Copyright (c) 2010 The Mirah project authors. All Rights Reserved.
2 # All contributing project authors may be found in the NOTICE file.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
b2d8c9a Add Rakefile with TestTask.
headius authored
16 require 'rake'
17 require 'rake/testtask'
805586f @baroquebobcat add rake gem task
baroquebobcat authored
18 require 'rubygems'
19 require 'rubygems/package_task'
5da2c15 Add simple import syntax that's close to Java, update examples for it…
headius@cnutter.local authored
20 require 'java'
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
21 $: << './lib'
d3f9a62 @ribrdb Rename duby.rb -> mirah.rb
ribrdb authored
22 require 'mirah'
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
23 require 'jruby/compiler'
24 require 'ant'
b2d8c9a Add Rakefile with TestTask.
headius authored
25
805586f @baroquebobcat add rake gem task
baroquebobcat authored
26 Gem::PackageTask.new Gem::Specification.load('mirah.gemspec') do |pkg|
27 pkg.need_zip = true
28 pkg.need_tar = true
29 end
30
31 task :gem => 'jar:bootstrap'
32
da60e32 Add default target to build.
headius authored
33 task :default => :test
34
21a2aaa Reenable some compilation tests that got turned off at some point.
headius@cnutter.local authored
35 Rake::TestTask.new :test do |t|
b2d8c9a Add Rakefile with TestTask.
headius authored
36 t.libs << "lib"
2b86ddb @headius Fixes to spin a release:
headius authored
37 # This is hacky, I know
38 t.libs.concat Dir["../bitescript*/lib"]
b2d8c9a Add Rakefile with TestTask.
headius authored
39 t.test_files = FileList["test/**/*.rb"]
5da2c15 Add simple import syntax that's close to Java, update examples for it…
headius@cnutter.local authored
40 java.lang.System.set_property("jruby.duby.enabled", "true")
756e06f @ribrdb Add support for compiling multiple files and a separate output directory
ribrdb authored
41 end
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
42
e9d892e @headius Clean up Rakefile, don't create dirs multiple times and eliminate unu…
headius authored
43 task :init do
44 mkdir_p 'dist'
45 mkdir_p 'build'
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
46 end
47
6ac3fb1 @baroquebobcat add descriptions to rake tasks
baroquebobcat authored
48 desc "clean up build artifacts"
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
49 task :clean do
50 ant.delete :quiet => true, :dir => 'build'
51 ant.delete :quiet => true, :dir => 'dist'
52 end
53
e9d892e @headius Clean up Rakefile, don't create dirs multiple times and eliminate unu…
headius authored
54 task :compile => :init do
15fb902 @headius Add a Compile Ant task and twiddle the build as appropriate to get it…
headius authored
55 # build the Ruby sources
56 puts "Compiling Ruby sources"
57 JRuby::Compiler.compile_argv([
58 '-t', 'build',
59 '--javac',
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
60 'src/org/mirah/mirah_command.rb'
15fb902 @headius Add a Compile Ant task and twiddle the build as appropriate to get it…
headius authored
61 ])
d3f9a62 @ribrdb Rename duby.rb -> mirah.rb
ribrdb authored
62
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
63 # build the Mirah sources
64 puts "Compiling Mirah sources"
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
65 Dir.chdir 'src' do
8e357e9 @headius Cleanups and improvements.
headius authored
66 classpath = Mirah::Env.encode_paths([
3e1bb63 @Osseta Add encoding/decoding of classpath strings using system PATH_SEPARATO…
Osseta authored
67 'javalib/jruby-complete.jar',
68 'javalib/JRubyParser.jar',
69 'build',
70 '/usr/share/ant/lib/ant.jar'
71 ])
8e357e9 @headius Cleanups and improvements.
headius authored
72 Mirah.compile(
3e1bb63 @Osseta Add encoding/decoding of classpath strings using system PATH_SEPARATO…
Osseta authored
73 '-c', classpath,
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
74 '-d', '../build',
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
75 'org/mirah',
ec7fa68 @ribrdb Add Hash and Symbol literals.
ribrdb authored
76 'duby/lang',
77 'mirah'
78 )
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
79 end
80 end
81
6ac3fb1 @baroquebobcat add descriptions to rake tasks
baroquebobcat authored
82 desc "build basic jar for distribution"
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
83 task :jar => :compile do
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
84 ant.jar :jarfile => 'dist/mirah.jar' do
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
85 fileset :dir => 'lib'
86 fileset :dir => 'build'
87 fileset :dir => '.', :includes => 'bin/*'
88 fileset :dir => '../bitescript/lib'
15fb902 @headius Add a Compile Ant task and twiddle the build as appropriate to get it…
headius authored
89 manifest do
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
90 attribute :name => 'Main-Class', :value => 'org.mirah.MirahCommand'
15fb902 @headius Add a Compile Ant task and twiddle the build as appropriate to get it…
headius authored
91 end
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
92 end
93 end
94
95 namespace :jar do
6ac3fb1 @baroquebobcat add descriptions to rake tasks
baroquebobcat authored
96 desc "build self-contained, complete jar"
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
97 task :complete => :jar do
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
98 ant.jar :jarfile => 'dist/mirah-complete.jar' do
99 zipfileset :src => 'dist/mirah.jar'
44938b9 @headius Add a 1.5.0.dev jruby-complete to avoid needing that dependency alrea…
headius authored
100 zipfileset :src => 'javalib/jruby-complete.jar'
155e8ef @ribrdb Fix building mirah-complete.jar
ribrdb authored
101 zipfileset :src => 'javalib/mirah-parser.jar'
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
102 manifest do
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
103 attribute :name => 'Main-Class', :value => 'org.mirah.MirahCommand'
a7886e2 @headius Port build.xml bits into Rakefile (JRuby 1.5 required now)
headius authored
104 end
105 end
106 end
f9171ae @ribrdb Initial support for writing macros in duby.
ribrdb authored
107
6ac3fb1 @baroquebobcat add descriptions to rake tasks
baroquebobcat authored
108 desc "build bootstrap jar used by the gem"
f9171ae @ribrdb Initial support for writing macros in duby.
ribrdb authored
109 task :bootstrap => :compile do
37eac87 @headius More renames to get the jar and complete jar moved over to the "Mirah…
headius authored
110 ant.jar :jarfile => 'javalib/mirah-bootstrap.jar' do
f9171ae @ribrdb Initial support for writing macros in duby.
ribrdb authored
111 fileset :dir => 'build'
112 end
113 end
155e8ef @ribrdb Fix building mirah-complete.jar
ribrdb authored
114 end
Something went wrong with that request. Please try again.