Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion documentation/commands/cmd-start.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
~
~ Synopsis:
~ ~~~~~~~~~
~ play start [app_path] [-f] [--deps] [--%fwk_id] [--http[s].port=<value>] [--jpda.port=<value>] [--pid_file=<file>] [--java_options]
~ play start [app_path] [-f] [--deps] [--%fwk_id] [--http[s].port=<value>] [--jpda.port=<value>] [--pid_file=<file>] [--java_options] [--jvm_version=<value>]
~
~ Description:
~ ~~~~~~~~~~~~
Expand Down Expand Up @@ -45,3 +45,6 @@
~
~ --jpda.port=<value>:
~ Override the jpda.port and %fwk_id.jpda.port variables in application.conf. Use the specified port (<value>) as the remote debugging port for the application. Can be combined with the option -f
~
~ --jvm_version=<value>:
~ Specify which version of JVM runs the application. If omitted, the script will spawn a sub-process to obtain the value. This will have repercussions in environments where forking behaviour needs to be deterministic (e.g. Upstart).
4 changes: 4 additions & 0 deletions framework/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@
<arg value="${basedir}/../samples-and-tests/i-am-a-developer/tests.py" />
</exec>

<exec executable="python" failonerror="true">
<arg value="${basedir}/../samples-and-tests/i-am-a-developer/test_jvm_version_flag.py" />
</exec>

<echo message="Using ${basedir}/../play${playExtension}" />

<antcall target="play-test">
Expand Down
8 changes: 6 additions & 2 deletions framework/pym/play/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def log_path(self):
return log_path

def check_jpda(self):
self.jpda_port = self.readConf('jpda.port')
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think he might be referencing that in #835 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok saw it thanks

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('', int(self.jpda_port)))
Expand Down Expand Up @@ -274,7 +273,10 @@ def java_cmd(self, java_args, cp_args=None, className='play.server.Server', args
if application_mode == 'prod':
java_args.append('-server')

javaVersion = getJavaVersion()
if self.play_env.has_key('jvm_version'):
javaVersion = self.play_env['jvm_version']
else:
javaVersion = getJavaVersion()
print "~ using java version \"%s\"" % javaVersion
if javaVersion.startswith("1.7"):
# JDK 7 compat
Expand Down Expand Up @@ -339,6 +341,8 @@ def __init__(self, confFolder, env):
self.entries['jpda.port'] = env['jpda.port']
if env.has_key('http.port'):
self.entries['http.port'] = env['http.port']
if env.has_key('jvm_version'):
self.entries['jvm_version'] = env['jvm_version']

def readFile(self, confFolder, filename):
f = file(confFolder + filename)
Expand Down
3 changes: 3 additions & 0 deletions play
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ try:
# ~~~~~~~~~~~~~~~~~ Override pid_file
get_opt(remaining_args, "pid_file", play_env)

# ~~~~~~~~~~~~~~~~~ Override jvm_version
get_opt(remaining_args, "jvm_version", play_env)

# ~~~~~~~~~~~~~~~~~ Override port
get_opt(remaining_args, "http.port", play_env)
get_opt(remaining_args, "https.port", play_env)
Expand Down
Loading