File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 288288 <orderEntry type =" library" scope =" PROVIDED" name =" rspec-expectations (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level =" application" />
289289 <orderEntry type =" library" scope =" PROVIDED" name =" rspec-mocks (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level =" application" />
290290 <orderEntry type =" library" scope =" PROVIDED" name =" rspec-support (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level =" application" />
291- <orderEntry type =" library" scope =" PROVIDED" name =" rubocop (v0.19.0 , rbenv: 1.9.3-p545) [gem]" level =" application" />
291+ <orderEntry type =" library" scope =" PROVIDED" name =" rubocop (v0.19.1 , rbenv: 1.9.3-p545) [gem]" level =" application" />
292292 <orderEntry type =" library" scope =" PROVIDED" name =" ruby-debug-base19x (v0.11.30.pre15, rbenv: 1.9.3-p545) [gem]" level =" application" />
293293 <orderEntry type =" library" scope =" PROVIDED" name =" ruby-debug-ide (v0.4.22, rbenv: 1.9.3-p545) [gem]" level =" application" />
294294 <orderEntry type =" library" scope =" PROVIDED" name =" ruby-progressbar (v1.4.2, rbenv: 1.9.3-p545) [gem]" level =" application" />
Original file line number Diff line number Diff line change @@ -29,10 +29,20 @@ class OpenJDKLike < JavaBuildpack::Component::VersionedDependencyComponent
2929 #
3030 # @param [Hash] context a collection of utilities used the component
3131 def initialize ( context )
32- super ( context )
32+ @application = context [ :application ]
33+ @component_name = self . class . to_s . space_case
34+ @configuration = context [ :configuration ]
35+ @droplet = context [ :droplet ]
36+
3337 @droplet . java_home . root = @droplet . sandbox
3438 end
3539
40+ # (see JavaBuildpack::Component::BaseComponent#detect)
41+ def detect
42+ @version , @uri = JavaBuildpack ::Repository ::ConfiguredItem . find_item ( @component_name , @configuration )
43+ super
44+ end
45+
3646 # (see JavaBuildpack::Component::BaseComponent#compile)
3747 def compile
3848 download_tar
@@ -47,13 +57,6 @@ def release
4757 . concat memory
4858 end
4959
50- protected
51-
52- # (see JavaBuildpack::Component::VersionedDependencyComponent#supports?)
53- def supports?
54- true
55- end
56-
5760 private
5861
5962 KEY_MEMORY_HEURISTICS = 'memory_heuristics' . freeze
Original file line number Diff line number Diff line change 3838 it 'should extract Java from a GZipped TAR' ,
3939 cache_fixture : 'stub-java.tar.gz' do
4040
41+ component . detect
4142 component . compile
4243
4344 expect ( sandbox + 'bin/java' ) . to exist
5051 end
5152
5253 it 'should add memory options to java_opts' do
54+ component . detect
5355 component . release
5456
5557 expect ( java_opts ) . to include ( 'opt-1' )
5658 expect ( java_opts ) . to include ( 'opt-2' )
5759 end
5860
5961 it 'adds OnOutOfMemoryError to java_opts' do
62+ component . detect
6063 component . release
6164
6265 expect ( java_opts ) . to include ( '-XX:OnOutOfMemoryError=$PWD/.java-buildpack/open_jdk_jre/bin/killjava.sh' )
6568 it 'places the killjava script (with appropriately substituted content) in the diagnostics directory' ,
6669 cache_fixture : 'stub-java.tar.gz' do
6770
71+ component . detect
6872 component . compile
6973
7074 expect ( sandbox + 'bin/killjava.sh' ) . to exist
7175 end
7276
7377 it 'adds java.io.tmpdir to java_opts' do
78+ component . detect
7479 component . release
7580
7681 expect ( java_opts ) . to include ( '-Djava.io.tmpdir=$TMPDIR' )
Original file line number Diff line number Diff line change 3838 it 'should extract Java from a GZipped TAR' ,
3939 cache_fixture : 'stub-java.tar.gz' do
4040
41+ component . detect
4142 component . compile
4243
4344 expect ( sandbox + 'bin/java' ) . to exist
5051 end
5152
5253 it 'should add memory options to java_opts' do
54+ component . detect
5355 component . release
5456
5557 expect ( java_opts ) . to include ( 'opt-1' )
5658 expect ( java_opts ) . to include ( 'opt-2' )
5759 end
5860
5961 it 'adds OnOutOfMemoryError to java_opts' do
62+ component . detect
6063 component . release
6164
6265 expect ( java_opts ) . to include ( '-XX:OnOutOfMemoryError=$PWD/.java-buildpack/oracle_jre/bin/killjava.sh' )
6568 it 'places the killjava script (with appropriately substituted content) in the diagnostics directory' ,
6669 cache_fixture : 'stub-java.tar.gz' do
6770
71+ component . detect
6872 component . compile
6973
7074 expect ( sandbox + 'bin/killjava.sh' ) . to exist
7175 end
7276
7377 it 'adds java.io.tmpdir to java_opts' do
78+ component . detect
7479 component . release
7580
7681 expect ( java_opts ) . to include ( '-Djava.io.tmpdir=$TMPDIR' )
You can’t perform that action at this time.
0 commit comments