Path: blob/master/SLICK_HOME/scripts/game-build-example.xml
1455 views
<!--1The Slick2D Build file. It has the following capabilities:23dist - Build the complete distribution4build-key-store - Build a valid key store for distributing your game5sign-a-jar - Sign a JAR file for distribution using a key store generated here67javadoc - generate the javadoc for Slick8-->9<project name="kitipong" default="build-game" basedir=".">1011<!--12Initialise the build script13-->14<target name="init">15<property name="username" value="kevin"/>16<property name="host" value="bob.newdawnsoftware.com"/>17<property name="dir" value="/home/kevin/public_html/slick/demos"/>18<property name="webstartURL" value="http://slick.cokeandcode.com/demos"/>19<property name="homepage" value="http://slick.cokeandcode.com"/>20<property name="vendor" value="Slick 2D"/>2122<property name="build.dir" value="target"/>2324<property name="game.name" value="kitipong"/>25<property name="game.title" value="Kitipong"/>26<property name="game.mainclass" value="puzzle.Puzzle"/>2728<property name="slick.install" value="../Slick"/>2930<delete dir="${build.dir}"/>31<mkdir dir="${build.dir}/classes"/>32<delete dir="webstart"/>33<mkdir dir="webstart"/>34</target>3536<!--37Build the java source to the Slick Demo RPG38-->39<target name="build-game" depends="init">40<delete dir="lib/${game.name}.jar"/>41<javac debug="true" srcdir="src" destdir="${build.dir}/classes" target="1.4" source="1.4">42<classpath>43<pathelement path="${slick.install}/lib/slick.jar"/>44<pathelement path="${slick.install}/lib/lwjgl.jar"/>45<pathelement path="${slick.install}/lib/ibxm.jar"/>46<pathelement path="${slick.install}/lib/jogg-0.0.7.jar"/>47<pathelement path="${slick.install}/lib/jorbis-0.0.15.jar"/>48</classpath>49</javac>50<jar destfile="lib/kitipong.jar"51basedir="${build.dir}/classes"/>52<jar update="true" destfile="lib/kitipong.jar"53basedir="." includes="res/**"/>54</target>5556<target name="build-game-webstart" depends="build-game">57<copy file="lib/${game.name}.jar" toDir="webstart"/>58<createdemojnlp name="${game.name}" title="${game.title}" mainclass="${game.mainclass}"59template="slickwithextension.jnlp" projectjar="${game.name}.jar"/>60</target>6162<!--63Upload the Game demo to the Slick website64-->65<target name="upload-game-webstart" depends="build-game-webstart">66<input message="Upload password:" addproperty="password"/>6768<scp todir="${username}:${password}@${host}:${dir}"69file="webstart/${game.name}.jar"70trust="true"71port="122"72verbose="true"/>73<scp todir="${username}:${password}@${host}:${dir}"74trust="true"75port="122"76verbose="true">77<fileset dir="webstart">78<include name="${game.name}.jnlp"/>79</fileset>80</scp>81</target>8283<!--84A macro to copy and preprocess the JNLP template for all webstart demos85-->86<macrodef name="createdemojnlp">87<attribute name="name" default="NOT SET"/>88<attribute name="title" default="NOT SET"/>89<attribute name="mainclass" default="NOT SET"/>90<attribute name="template" default="slickdemo.jnlp"/>91<attribute name="datajar" default="testdata.jar"/>92<attribute name="projectjar" default=""/>93<sequential>94<delete file="webstart/@{name}.jnlp"/>95<copy file="${slick.install}/scripts/@{template}" toFile="webstart/@{name}.jnlp">96<filterchain>97<replacetokens>98<token key="title" value="@{title}"/>99<token key="mainclass" value="@{mainclass}"/>100<token key="jnlpname" value="@{name}.jnlp"/>101<token key="homepage" value="${homepage}"/>102<token key="datajar" value="@{datajar}"/>103<token key="projectjar" value="@{projectjar}"/>104<token key="vendor" value="${vendor}"/>105<token key="codebase" value="${webstartURL}"/>106</replacetokens>107</filterchain>108</copy>109110<echo file="webstart/demos.txt" append="true">111<a href="${webstartURL}/@{name}.jnlp"> @{title} </a>112<br/>113</echo>114</sequential>115</macrodef>116117</project>118119