-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
67 lines (54 loc) · 1.75 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
desc "Remove build artifacts"
task :clean do
# Remove any cached builds from the local maven repo
system "rm -rf ~/.m2/repository/com/steelcity"
system "rm -rf ~/.m2/repository/jruby"
# Remove any installed deps in the clojure project
system "rm -rf speaker_selector/lib/*"
# Remove compliled clojure classes
system "cd speaker_selector && lein clean"
# Remove Java classes compliled with JRuby
system "rm -rf build"
end
task :compile_ruby do
mkdir_p "build/jar"
# Compile Ruby into Java source and bytecode
system "cd steel_city && jrubyc --javac schedule.rb -t ../build"
# Jar up Ruby bytecode for including into the clojure project
system "cd build && jar -cf jar/schedule.jar com/steelcity/Schedule.class"
# Copy JRuby library for including into the clojure project
system "cp \`which jruby | sed 's/bin\\/jruby//'\`/lib/jruby.jar build/jar/"
end
desc "Compile Ruby into Java bytecode"
task :compile => [:clean, :compile_ruby]
desc "Install and copy to Clojure project"
task :install => :compile do
# Install compiled Ruby with Maven
system <<-CMD
cd speaker_selector &&
mvn install:install-file \
-DgroupId=com.steelcity \
-DartifactId=schedule \
-Dversion=0.0.0 \
-Dpackaging=jar \
-Dfile=../build/jar/schedule.jar
CMD
# Install JRuby lib with Maven
system <<-CMD
cd speaker_selector &&
mvn install:install-file \
-DgroupId=jruby \
-DartifactId=jruby \
-Dversion=1.6.7.2 \
-Dpackaging=jar \
-Dfile=../build/jar/jruby.jar
CMD
# Copy the installed deps into the clojure project
system "cd speaker_selector && lein deps"
end
desc "Start leiningen repl"
task :run => :install do
# Open repl with leiningen
system "cd speaker_selector && lein repl"
end
task :default => :run