Skip to content

Commit

Permalink
Update AUTHORS and clean up Rake file
Browse files Browse the repository at this point in the history
  • Loading branch information
jsl committed Aug 4, 2012
1 parent e75fc17 commit f8c4bf8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Square
Justin Leitgeb
@justinleitgeb
Stack Builders

http://github.com/jsl/ruby_from_clojure
33 changes: 30 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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.