File tree Expand file tree Collapse file tree
lib/java_buildpack/container Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ Additional documentation can be found by following the links below.
2626* [ Design] ( docs/design.md )
2727* Standard Containers
2828 * [Java Main Class](docs/container-java-main.md) ([Configuration](docs/container-java-main.md#configuration))
29+ * [Play](docs/container-play.md)
2930 * [Tomcat](docs/container-tomcat.md) ([Configuration](docs/container-tomcat.md))
3031* Standard Frameworks
3132 * [`JAVA_OPTS`](docs/framework-java_opts.md) ([Configuration](docs/framework-java_opts.md#configuration))
Original file line number Diff line number Diff line change 1+ # JPlay Container
2+ The Play Container allows Play applications to be run.
3+
4+ <table >
5+ <tr >
6+ <td><strong>Detection Criteria</strong></td><td><tt>start</tt> script and <tt>lib/play.play_*.jar</tt> exist in the application</td>
7+ </tr >
8+ <tr >
9+ <td><strong>Tags</strong></td><td><tt>Play</tt></td>
10+ </tr >
11+ </table >
12+ Tags are printed to standard output by the buildpack detect script
13+
14+ ## Configuration
15+ The Play Container cannot be configured.
16+
17+
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def initialize(context)
4343 # @return [String] returns +Play+ if and only if the application has a +start+ script, otherwise
4444 # returns +nil+
4545 def detect
46- play_script ? ? PLAY_TAG : nil
46+ play_app ? ? PLAY_TAG : nil
4747 end
4848
4949 # Makes the +start+ script executable.
@@ -69,8 +69,11 @@ def release
6969
7070 PLAY_TAG = 'Play' . freeze
7171
72- def play_script?
73- File . exists? ( @start_script_path ) && !File . directory? ( @start_script_path )
72+ PLAY_JAR_PATTERN = 'lib/play.play_*.jar' . freeze
73+
74+ def play_app?
75+ File . exists? ( @start_script_path ) && !File . directory? ( @start_script_path ) &&
76+ !Dir . glob ( File . join ( @app_dir , PLAY_JAR_PATTERN ) ) . empty?
7477 end
7578
7679 def java_opts
Original file line number Diff line number Diff line change @@ -40,14 +40,22 @@ module JavaBuildpack::Container
4040 expect ( detected ) . to be_nil
4141 end
4242
43- it 'should detect an application with a start script' do
43+ it 'should detect an application with a start script and a suitable Play JAR ' do
4444 detected = Play . new (
4545 :app_dir => 'spec/fixtures/container_play' ,
4646 :configuration => { } ) . detect
4747
4848 expect ( detected ) . to eq ( 'Play' )
4949 end
5050
51+ it 'should not detect an application with a start script but no suitable Play JAR' do
52+ detected = Play . new (
53+ :app_dir => 'spec/fixtures/container_play_like' ,
54+ :configuration => { } ) . detect
55+
56+ expect ( detected ) . to be_nil
57+ end
58+
5159 it 'should make the start script executable in the compile step' do
5260 play = Play . new (
5361 :app_dir => 'spec/fixtures/container_play' ,
You can’t perform that action at this time.
0 commit comments