2013-01-22 00:11:28 +01:00
|
|
|
<project name="scriptcraft" default="package" basedir=".">
|
2013-01-13 18:00:30 +01:00
|
|
|
<property file="build.properties"/>
|
|
|
|
<description>Builds the scriptcraft.jar file - a plugin for bukkit</description>
|
2013-01-22 00:11:28 +01:00
|
|
|
<property name="src" location="src/main/java"/>
|
|
|
|
<property name="build" location="target/classes"/>
|
|
|
|
<property name="dist" location="target/" />
|
2013-01-15 20:15:40 +01:00
|
|
|
|
2013-01-13 18:00:30 +01:00
|
|
|
<target name="init">
|
2013-01-22 00:11:28 +01:00
|
|
|
<tstamp/>
|
|
|
|
<mkdir dir="${build}"/>
|
2013-01-13 18:00:30 +01:00
|
|
|
</target>
|
|
|
|
|
2013-01-22 00:11:28 +01:00
|
|
|
<target name="compile" depends="init" description="compile bukkit plugin source">
|
2013-02-19 20:09:03 +01:00
|
|
|
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" classpath="${bukkit-lib}" />
|
2013-01-13 18:00:30 +01:00
|
|
|
</target>
|
2013-01-22 00:11:28 +01:00
|
|
|
|
2013-02-08 22:23:15 +01:00
|
|
|
<target name="gendocs" description="Generate API documentation">
|
2013-02-19 20:09:03 +01:00
|
|
|
<javac includeantruntime="false" srcdir="src/docs/java"/>
|
2013-02-08 22:23:15 +01:00
|
|
|
<java classname="jscript" failonerror="true" fork="true" output="docs/api.md">
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="src/docs/java"/>
|
|
|
|
</classpath>
|
|
|
|
<arg value="src/docs/javascript/generateApiDocs.js"/>
|
|
|
|
<arg value="src/main/javascript"/>
|
|
|
|
</java>
|
|
|
|
</target>
|
2013-01-15 22:11:18 +01:00
|
|
|
|
2013-01-13 18:00:30 +01:00
|
|
|
<target name="zip_js">
|
2013-01-22 00:11:28 +01:00
|
|
|
<zip zipfile="${build}/js-plugins.zip" basedir="./src/main/javascript"/>
|
2013-01-13 18:00:30 +01:00
|
|
|
</target>
|
|
|
|
|
2013-02-08 22:23:15 +01:00
|
|
|
<target name="package" depends="gendocs,zip_js,compile"
|
2013-01-22 00:11:28 +01:00
|
|
|
description="generate the distribution" >
|
2013-02-19 20:09:03 +01:00
|
|
|
<!-- ensure plugin.yml is always copied -->
|
|
|
|
<delete file="${build}/plugin.yml" />
|
2013-01-22 00:11:28 +01:00
|
|
|
<copy file="src/main/resources/plugin.yml" todir="${build}"/>
|
|
|
|
<replace file="${build}/plugin.yml" value="${bukkit-version}-${DSTAMP}">
|
|
|
|
<replacetoken>[[version]]</replacetoken>
|
|
|
|
</replace>
|
2013-02-19 20:09:03 +01:00
|
|
|
|
2013-01-13 18:00:30 +01:00
|
|
|
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
|
|
|
|
<jar jarfile="${dist}/scriptcraft-${bukkit-version}-${DSTAMP}.jar" basedir="${build}"/>
|
|
|
|
</target>
|
2013-01-14 23:55:39 +01:00
|
|
|
|
2013-01-13 18:00:30 +01:00
|
|
|
<target name="clean" description="clean up" >
|
2013-01-22 00:11:28 +01:00
|
|
|
<delete dir="${dist}"/>
|
2013-01-13 18:00:30 +01:00
|
|
|
</target>
|
|
|
|
|
2013-01-22 00:11:28 +01:00
|
|
|
<target name="update-live-cb" depends="package" description="Copy the built plugin to the live craftbukkit folder for testing.">
|
|
|
|
<delete>
|
|
|
|
<fileset dir="${craftbukkit}/plugins/" includes="scriptcraft*.*"/>
|
|
|
|
</delete>
|
|
|
|
<copy file="${dist}/scriptcraft-${bukkit-version}-${DSTAMP}.jar" todir="${craftbukkit}/plugins"/>
|
2013-01-14 23:55:39 +01:00
|
|
|
</target>
|
2013-01-13 18:00:30 +01:00
|
|
|
</project>
|