Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #42 from ggilder/gabriel/fix-java-version
Browse files Browse the repository at this point in the history
Gabriel/fix java version
  • Loading branch information
ggilder committed May 1, 2014
2 parents 14454b9 + 7294f9b commit 0bb2951
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/jetpack
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ script_start_time = Time.now
# Don't set min memory size when making the build artifact
@jar_build_options = @settings.java_options.gsub(/(\s*)-Xms\S+/,'\1')

@java_dash_jar = "GEM_HOME=#{@gem_home} exec java #{@jar_build_options} -jar"
@java_dash_jar = "GEM_HOME=#{@gem_home} exec #{@settings.java} #{@jar_build_options} -jar"
@jruby_opts = "--#{@settings.ruby_version}"

def jruby!(cmd)
Expand Down
17 changes: 17 additions & 0 deletions spec/java_config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require "spec_helper"

describe "jetpack - configurable java version" do
before(:all) do
reset
@project = 'spec/sample_projects/java_config'
@result = x!("bin/jetpack #{@project}")
end

after(:all) do
reset
end

it "uses the desired version of java" do
File.read("#{@project}/bin/ruby").should include("/dev/null/java")
end
end
2 changes: 2 additions & 0 deletions spec/sample_projects/java_config/config/jetpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
java: "/dev/null/java"
jruby: "file://<%= File.expand_path('spec/local_mirror') %>/jruby-complete-1.7.12.jar"
2 changes: 1 addition & 1 deletion spec/sample_projects/webapp/config/jetpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
java: "/usr/java/latest/java/bin/java"
java: "java"
jruby: "file://<%= File.expand_path('spec/local_mirror') %>/jruby-complete-1.7.12.jar"
jetty: "file://<%= File.expand_path('spec/local_mirror') %>/jetty-hightide-8.1.15.v20140411.zip"
jruby-rack: "file://<%= File.expand_path('spec/local_mirror') %>/jruby-rack-1.1.14.jar"
Expand Down
2 changes: 1 addition & 1 deletion spec/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

it "places a launch script, and includes java_options" do
File.exists?("spec/sample_projects/webapp/bin/launch").should == true
File.read("spec/sample_projects/webapp/bin/launch").should include("/usr/java/latest/java/bin/java -jar -Xmx256M")
File.read("spec/sample_projects/webapp/bin/launch").should include("java -jar -Xmx256M")
File.read("spec/sample_projects/webapp/bin/launch").should include("start.jar")
end

Expand Down

0 comments on commit 0bb2951

Please sign in to comment.