2002-10-25 11:04:24 +00:00
<!-- @author David Chandler, dchandler@users.sourceforge.net
We have a document,
http://thdltools.sourceforge.net/BuildSystems.html, that you
2003-01-12 20:24:01 +00:00
probably should read.
2002-10-25 11:04:24 +00:00
-->
2003-02-01 05:55:31 +00:00
<project name= "THDLTools-JWS" default= "fail-nicely" basedir= "." >
2002-10-25 11:04:24 +00:00
<description >
This Jakarta Ant buildfile is used to build the Java Web Start
releases of Jskad, Savant, QuillDriver, and the Translation Tool.
This is separate from build.xml because to use this build file,
you must have installed the Venus Application Publisher's (Vamp's)
Ant tasks. Read the comments of this buildfile to learn more, or
2003-01-12 20:24:01 +00:00
see 'http://thdltools.sourceforge.net/BuildSystems.html'.
2002-10-25 11:04:24 +00:00
</description>
<!-- -->
<!-- Ant extensions we use: -->
<!-- -->
<!-- See http://www.vamphq.com/ant.html for vamp*: -->
<taskdef name= "vampwar" classname= "venus.ant.taskdefs.VampWar" />
<taskdef name= "vampinstaller" classname= "venus.ant.taskdefs.VampInstaller" />
<target name= "fail-nicely" description= "Tells the user to use build.xml, not this subbuildfile." >
2003-02-03 08:21:37 +00:00
<fail message= "Do not use this file directly; use build.xml instead, which then uses this file." />
2002-10-25 11:04:24 +00:00
</target>
<target name= "this-init" >
<!-- Create the time stamp -->
<tstamp />
<mkdir dir= "${dist}/java-web-start" />
</target>
<target name= "package-for-java-web-start"
depends="this-init"
2002-11-18 16:12:25 +00:00
description="Builds the Java Web Start version of ${my.app} given that you have compiled it to a JAR with the suffix ${jwsjarsuffix} (and from scratch, since our compilation procedure doesn't konw about dependencies)">
2002-10-25 11:04:24 +00:00
<!-- First, you must give the passwords so that we can sign the JARs. -->
<fail message= "Use 'ant -Dkeystore.password=psst' to sign a Java Web Start WAR file."
unless="keystore.password"/>
<fail message= "Use 'ant -Ddgkey.password=psst' to sign a Java Web Start WAR file."
unless="dgkey.password"/>
<!-- Use the Venus Application Publisher's (Vamp's) Ant task to
create a .war file. If you use Tomcat or the like to
distribute, then the WAR is all you need. If not, you don't
need the full WAR file. You in fact need only the JAR file
inside it. There is a ${my.app}.jnlp file inside it, too,
but that file uses macros like $$name and $$codebase, which
are only appropriate to Tomcat-type environments.
Thus, you non-Tomcat-users should run 'jar xf
2002-11-16 18:04:47 +00:00
${my.app}-web-start.war ${my.app}.jar' to extract the
2002-10-25 11:04:24 +00:00
signed JAR file and copy the .jar and the
${dist}/${my.app}.jnlp file (NOT the one in the WAR) to the
web server. (Be sure that the web server has its MIME types
configured correctly so that the .jnlp file is served as an
application/jnlp or the like, not text/xml.)
Yes, it means that we're requiring anyone who wishes to cut a
JWS release to install vamp.jar, when we could use the
built-in SignJar task instead for non-Tomcat-users. BUT,
this method means that we're ready for a J2EE application
server framework like the one at Virginia.
If you change web servers or the location on the web server
where the JAR and jnlp file are located, you have to edit
${my.app}.jnlp. Note that doing so will mean that users who've
installed ${my.app} from the old location will NOT be able to
seamlessly upgrade, so don't do this often.
To install the Vamp Ant task, visit
'http://www.vamphq.com/ant.html' and follow the instructions.
Note that you *CAN* just drop vamp.jar into Ant's 'lib'
directory with Ant 1.5.1.
-->
<vampwar dest= "${dist}/java-web-start/${my.app}-web-start.war" >
<jnlp src= "${dist}/${my.app}.jnlp" >
<resources >
2002-11-16 18:04:47 +00:00
<fileset dir= "${lib}" >
2002-11-18 16:12:25 +00:00
<include name= "${my.app}${jwsjarsuffix}.jar" />
2002-10-25 11:04:24 +00:00
</fileset>
</resources>
</jnlp>
<jarsigner
keystore = "${keystore}"
storepass = "${keystore.password}"
keypass = "${dgkey.password}"
alias = "${key.alias}"/>
</vampwar>
<!-- Extract the JAR file: -->
<unwar src= "${dist}/java-web-start/${my.app}-web-start.war"
dest="${dist}/java-web-start/">
<patternset >
2003-02-03 08:21:37 +00:00
<include name= "${my.app}*.jar" />
2002-10-25 11:04:24 +00:00
<exclude name= "**/*" />
</patternset>
</unwar>
</target>
</project>