Permalink
Browse files

Constantize JRuby and Processing versions

  • Loading branch information...
jurisgalang committed Apr 12, 2012
1 parent de3e185 commit a2aede66cb739e5eecb79489f0e9ff689ef0b348
Showing with 23 additions and 20 deletions.
  1. +23 −20 vendors/Rakefile
View
@@ -1,48 +1,51 @@
require 'rake/clean'
-CLOBBER.include("processing-1.5.1-windows-expert.zip", "jruby-complete-1.6.5.jar")
+JRUBY_VERSION = "1.6.5"
+PROCESSING_VERSION = "1.5.1"
+
+CLOBBER.include("processing-#{PROCESSING_VERSION}-windows-expert.zip", "jruby-complete-#{JRUBY_VERSION}.jar")
desc "download, sign and copy to ruby-processing"
task :default => [:download, :signjar, :copy]
desc "download Processing & JRuby upstream sources"
-task :download => ["processing-1.5.1-windows-expert.zip", "jruby-complete-1.6.5.jar"]
+task :download => ["processing-#{PROCESSING_VERSION}-windows-expert.zip", "jruby-complete-#{JRUBY_VERSION}.jar"]
# taking this version is because this is the smallest build available with all the librairies we need
-file "processing-1.5.1-windows-expert.zip" do
- # /home/moumar/src/processing-1.5.1/build/linux/work/modes/java/libraries
- sh "wget http://processing.googlecode.com/files/processing-1.5.1-windows-expert.zip"
- check_sha1("processing-1.5.1-windows-expert.zip", "d3044e07c34b6eda2360987d67faf8c1cd687ffa")
- #unzip -o /home/moumar/src/processing-1.5.1-windows-expert.zip 'processing-1.5.1/modes/java/libraries/opengl/library/*' 'processing-1.5.1/modes/java/libraries/minim/library/*'"
+file "processing-#{PROCESSING_VERSION}-windows-expert.zip" do
+ # /home/moumar/src/processing-#{PROCESSING_VERSION}/build/linux/work/modes/java/libraries
+ sh "wget http://processing.googlecode.com/files/processing-#{PROCESSING_VERSION}-windows-expert.zip"
+ check_sha1("processing-#{PROCESSING_VERSION}-windows-expert.zip", "d3044e07c34b6eda2360987d67faf8c1cd687ffa")
+ #unzip -o /home/moumar/src/processing-#{PROCESSING_VERSION}-windows-expert.zip 'processing-#{PROCESSING_VERSION}/modes/java/libraries/opengl/library/*' 'processing-#{PROCESSING_VERSION}/modes/java/libraries/minim/library/*'"
end
-file "jruby-complete-1.6.5.jar" do
- sh "wget http://jruby.org.s3.amazonaws.com/downloads/1.6.5/jruby-complete-1.6.5.jar"
- check_sha1("jruby-complete-1.6.5.jar", "c1fb0df18f4fbc6dcb3221feea0cbd37eb7ad37e")
+file "jruby-complete-#{JRUBY_VERSION}.jar" do
+ sh "wget http://jruby.org.s3.amazonaws.com/downloads/#{JRUBY_VERSION}/jruby-complete-#{JRUBY_VERSION}.jar"
+ check_sha1("jruby-complete-#{JRUBY_VERSION}.jar", "c1fb0df18f4fbc6dcb3221feea0cbd37eb7ad37e")
end
-task :signjar => "jruby-complete-1.6.5.jar" do
- unless `jarsigner -verify jruby-complete-1.6.5.jar`.chop == "jar verified."
- sh "cat ~/.keystore_pass | jarsigner jruby-complete-1.6.5.jar ruby-processing"
+task :signjar => "jruby-complete-#{JRUBY_VERSION}.jar" do
+ unless `jarsigner -verify jruby-complete-#{JRUBY_VERSION}.jar`.chop == "jar verified."
+ sh "cat ~/.keystore_pass | jarsigner jruby-complete-#{JRUBY_VERSION}.jar ruby-processing"
end
end
directory "../lib/core"
desc "copy libs & jars"
task :copy => ["../lib/core", :signjar ] do
- sh "cp -v jruby-complete-1.6.5.jar ../lib/core/jruby-complete.jar"
+ sh "cp -v jruby-complete-#{JRUBY_VERSION}.jar ../lib/core/jruby-complete.jar"
- processing_zip = File.expand_path("processing-1.5.1-windows-expert.zip")
- sh "cd ../lib/core && unzip -qoj #{processing_zip} processing-1.5.1/lib/core.jar"
+ processing_zip = File.expand_path("processing-#{PROCESSING_VERSION}-windows-expert.zip")
+ sh "cd ../lib/core && unzip -qoj #{processing_zip} processing-#{PROCESSING_VERSION}/lib/core.jar"
dirs = %w{dxf javascript minim net opengl pdf serial video}
Dir.chdir("../library/") do
- sh "rm -rf processing-1.5.1/ #{dirs.join(" ")}"
- inside_zip_dirs = dirs.collect { |d| "processing-1.5.1/modes/java/libraries/#{d}/library/*" }
+ sh "rm -rf processing-#{PROCESSING_VERSION}/ #{dirs.join(" ")}"
+ inside_zip_dirs = dirs.collect { |d| "processing-#{PROCESSING_VERSION}/modes/java/libraries/#{d}/library/*" }
sh "unzip -q #{processing_zip} #{inside_zip_dirs.join(" ")}"
- sh "mv processing-1.5.1/modes/java/libraries/* ."
- sh "rm -r processing-1.5.1/"
+ sh "mv processing-#{PROCESSING_VERSION}/modes/java/libraries/* ."
+ sh "rm -r processing-#{PROCESSING_VERSION}/"
end
end

0 comments on commit a2aede6

Please sign in to comment.