Permalink
Browse files

Update AUTHORS and clean up Rake file

  • Loading branch information...
1 parent e75fc17 commit f8c4bf8782c70781e2533101f5016e05556b77e3 @jsl committed Aug 4, 2012
Showing with 32 additions and 3 deletions.
  1. +2 −0 AUTHORS
  2. +30 −3 Rakefile
View
@@ -5,3 +5,5 @@ Square
Justin Leitgeb
@justinleitgeb
Stack Builders
+
+http://github.com/jsl/ruby_from_clojure
View
@@ -1,38 +1,65 @@
+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"
- mkdir_p "build/jar"
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
+ 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
+ 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

0 comments on commit f8c4bf8

Please sign in to comment.