lib/appengine-tools/dev_appserver.rb in appengine-tools-0.0.14 vs lib/appengine-tools/dev_appserver.rb in appengine-tools-0.0.15.pre
- old
+ new
@@ -13,11 +13,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'appengine-sdk'
-require 'appengine-tools/boot'
require 'appengine-tools/bundler'
require 'appengine-tools/update_check'
module AppEngine
module Development
@@ -25,19 +24,19 @@
class JRubyDevAppserver
class << self
def run(args)
path, java_args, server_args = parse_argv(ARGV)
if path and File::directory?(path)
- puts "=> Booting DevAppServer"
- puts "=> Press Ctrl-C to shutdown server"
AppEngine::Admin.bundle_app(path)
updater = AppEngine::Admin::UpdateCheck.new(path)
updater.nag if updater.can_nag?
+ puts "=> Booting DevAppServer"
+ puts "=> Press Ctrl-C to shutdown server"
end
start_java(path, java_args, server_args)
end
-
+
def parse_argv(argv)
java_args = []
server_args = []
start_on_first_thread = false
if RUBY_PLATFORM =~ /darwin/ ||
@@ -57,34 +56,37 @@
if start_on_first_thread
java_args << '-XstartOnFirstThread'
end
return server_args[-1], java_args, server_args
end
-
+
def start_java(path, java_args, server_args)
if path
jruby_home = get_jruby_home(path)
java_args << "-Djruby.home=#{jruby_home}" if jruby_home
server_args[-1] = File.expand_path(path)
Dir.chdir(path)
end
server_args.unshift '--disable_update_check'
ENV.delete 'GEM_HOME'
ENV.delete 'GEM_PATH'
+ plugin_jar = File.join(File.dirname(__FILE__), 'app_yaml.jar')
+
java_args << '-classpath'
java_args << AppEngine::SDK::TOOLS_JAR
java_args << '-Djava.util.logging.config.file=' +
AppEngine::SDK::SDK_ROOT + '/config/sdk/logging.properties'
+ java_args << "-Dcom.google.appengine.plugin.path=#{plugin_jar}"
if defined? AppEngine::SDK::AGENT_JAR
java_args << '-javaagent:' + AppEngine::SDK::AGENT_JAR
end
command = ['java'] + java_args + DEV_APPSERVER + server_args
if ENV['VERBOSE']
puts "exec #{command.map{|x| x.inspect}.join(' ')}"
end
exec(*command)
end
-
+
def get_jruby_home(path)
return unless path
Dir.chdir("#{path}/WEB-INF/lib") do
jars = Dir.glob("appengine-jruby-*.jar").grep(
/^appengine-jruby-\d+[.]\d+[.]\d+[.]jar$/)