forked from suitmedia/kirk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
44 lines (34 loc) · 991 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'ant'
directory 'build'
directory 'build/kirk'
directory 'build/kirk/classes'
FILES = Dir['src/**/*.java']
def class_path
Dir['lib/kirk/jetty/*.jar'].join(':')
end
desc 'Compile the library'
task :compile => ['build/kirk/classes'] + FILES do |t|
ant.property :name => "build.sysclasspath", :value => "ignore"
ant.javac :srcdir => "src", :destdir => t.prerequisites.first,
:debug => true, :source => "1.5", :target => "1.5",
:classpath => "#{class_path}:${java.class.path}:${sun.boot.class.path}"
end
desc 'Build the Jar'
task :jar => :compile do
ant.jar :basedir => "build/kirk/classes", :destfile => "build/kirk/native.jar",
:includes => "**/*.class"
cp "build/kirk/native.jar", "lib/kirk/native.jar"
end
desc 'Clean up build artifacts'
task :clean do
rm_rf 'build'
end
desc 'Run specs'
task :spec => :jar do
sh "ruby -S rspec spec"
end
desc 'Package the gem'
task :gem => :jar do
sh "ruby -S gem build kirk.gemspec"
end
task :default => :spec