Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

specify '-Dprecompiled=true' to `play run|start` to use precompiled c…

…lasses
  • Loading branch information...
commit b94cf4c45c1233e5f14e7c571056fb3e5df3bb28 1 parent 9e0b8cd
Yamashita Yuu authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 conf/play-recipes.rb
View
18 conf/play-recipes.rb
@@ -68,6 +68,7 @@
_cset :play_pid_file do
fetch(:app_pid, File.join(shared_path, 'pids', 'server.pid')) # for backward compatibility
end
+ _cset :play_use_precompile, true # performe precompilation before restarting service if true
namespace :setup do
desc "install play if needed"
@@ -124,9 +125,16 @@
# nop
end
+ _cset :play_start_options do
+ options = []
+ options << "-Xss2048k"
+ options << "--%prod"
+ options << "-Dprecompiled=true" if play_use_precompile
+ options
+ end
task :start, :roles => :app, :except => { :no_release => true } do
run "rm -f #{play_pid_file}" # FIXME: should check if the pid is active
- run "cd #{release_path} && nohup #{play_cmd} start -Xss2048k --pid_file=#{play_pid_file} --%prod"
+ run "cd #{release_path} && nohup #{play_cmd} start --pid_file=#{play_pid_file} #{play_start_options.join(' ')}"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@@ -151,7 +159,11 @@
File.join('/etc', 'init', "#{play_upstart_service}.conf")
end
_cset :play_upstart_config_template, File.join(File.dirname(__FILE__), 'templates', 'upstart.erb')
- _cset :play_upstart_options, []
+ _cset :play_upstart_options do
+ options = []
+ options << "-Dprecompiled=true" if play_use_precompile
+ options
+ end
_cset :play_upstart_runner do
user
end
@@ -192,7 +204,7 @@
transaction {
dependencies
- precompile if fetch(:play_use_precompile, true)
+ precompile if play_use_precompile
}
end
Please sign in to comment.
Something went wrong with that request. Please try again.