Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial work for vendoring jvm into slug

  • Loading branch information...
commit d32113db86db7c99f5e12f51aa3aaed9ce1762c9 1 parent 96d8852
@hone hone authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/language_pack/ruby.rb
View
21 lib/language_pack/ruby.rb
@@ -11,6 +11,8 @@ class LanguagePack::Ruby < LanguagePack::Base
BUNDLER_GEM_PATH = "bundler-#{BUNDLER_VERSION}"
NODE_VERSION = "0.4.7"
NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
+ JVM_BASE_URL = "http://heroku-jvm-langpack-java.s3.amazonaws.com"
+ JVM_VERSION = "openjdk6-latest"
# detects if this is a valid Ruby app
# @return [Boolean] true if it's a Ruby app
@@ -47,6 +49,7 @@ def compile
Dir.chdir(build_path)
remove_vendor_bundle
install_ruby
+ install_jvm
setup_language_pack_environment
allow_git do
install_language_pack_gems
@@ -77,6 +80,12 @@ def slug_vendor_ruby
"vendor/#{ruby_version}"
end
+ # the relative path to the vendored jvm
+ # @return [String] resulting path
+ def slug_vendor_jvm
+ "vendor/jvm"
+ end
+
# the absolute path of the build ruby to use during the buildpack
# @return [String] resulting path
def build_ruby_path
@@ -214,6 +223,18 @@ def install_ruby
true
end
+ # vendors JVM into the slug for JRuby
+ def install_jvm
+ if ruby_version_jruby?
+ topic "Installing JVM: #{JVM_VERSION}"
+
+ FileUtils.mkdir_p(slug_vendor_jvm)
+ Dir.chdir(slug_vendor_jvm) do
+ run("curl #{JVM_BASE_URL}/#{JVM_VERSION}.tar.gz -s -o - | tar xzf -")
+ end
+ end
+ end
+
# find the ruby install path for its binstubs during build
# @return [String] resulting path or empty string if ruby is not vendored
def ruby_install_binstub_path
Please sign in to comment.
Something went wrong with that request. Please try again.