AppController update jsp jar when rebuilding java application server
@@ -3642,26 +3642,37 @@ class Djinn
Djinn.log_info("Finished building target '#{target}' using #{pip}.")
end
- def build_java_appserver
- Djinn.log_info('Building uncommitted Java AppServer changes')
-
- # Cache package if it doesn't exist.
- java_sdk_archive = 'appengine-java-sdk-1.8.4.zip'
- local_archive = "#{APPSCALE_CACHE_DIR}/#{java_sdk_archive}"
+ def cache_package(package_file)
+ local_archive = "#{APPSCALE_CACHE_DIR}/#{package_file}"
unless File.file?(local_archive)
Net::HTTP.start(PACKAGE_MIRROR_DOMAIN) do |http|
- resp = http.get("#{PACKAGE_MIRROR_PATH}/#{java_sdk_archive}")
+ resp = http.get("#{PACKAGE_MIRROR_PATH}/#{package_file}")
open(local_archive, 'wb') do |file|
file.write(resp.body)
end
end
end
+ return local_archive
+ end
+
+ def build_java_appserver
+ Djinn.log_info('Building uncommitted Java AppServer changes')
+
+ new_jsp_jar = 'repackaged-appengine-eclipse-jdt-ecj.jar'
+ old_jsp_jar = 'repackaged-appengine-jasper-jdt-6.0.29.jar'
+
+ # Ensure packages cached
+ local_sdk_path = cache_package('appengine-java-sdk-1.8.4.zip')
+ new_jsp_jar_path = cache_package(new_jsp_jar)
java_server = "#{APPSCALE_HOME}/AppServer_Java"
- unzip = "unzip -o #{local_archive} -d #{java_server} > /dev/null 2>&1"
+ jsp_lib_path = "#{java_server}/appengine-java-sdk-1.8.4/lib/tools/jsp"
+ unzip = "unzip -o #{local_sdk_path} -d #{java_server} > /dev/null 2>&1"
+ update = "rm #{jsp_lib_path}/#{old_jsp_jar}; " \
+ "cp #{new_jsp_jar_path} #{jsp_lib_path}/ > /dev/null 2>&1"
install = "ant -f #{java_server}/build.xml install > /dev/null 2>&1"
clean = "ant -f #{java_server}/build.xml clean-build > /dev/null 2>&1"
- if system(unzip) && system(install) && system(clean)
+ if system(unzip) && system(update) && system(install) && system(clean)
Djinn.log_info('Finished building Java AppServer')
else
Djinn.log_error('Unable to build Java AppServer')
