This repository has been archived on 2021-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
scriptcraft/build.xml
2013-02-19 19:09:03 +00:00

55 lines
2.1 KiB
XML

<project name="scriptcraft" default="package" basedir=".">
<property file="build.properties"/>
<description>Builds the scriptcraft.jar file - a plugin for bukkit</description>
<property name="src" location="src/main/java"/>
<property name="build" location="target/classes"/>
<property name="dist" location="target/" />
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile bukkit plugin source">
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" classpath="${bukkit-lib}" />
</target>
<target name="gendocs" description="Generate API documentation">
<javac includeantruntime="false" srcdir="src/docs/java"/>
<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>
<target name="zip_js">
<zip zipfile="${build}/js-plugins.zip" basedir="./src/main/javascript"/>
</target>
<target name="package" depends="gendocs,zip_js,compile"
description="generate the distribution" >
<!-- ensure plugin.yml is always copied -->
<delete file="${build}/plugin.yml" />
<copy file="src/main/resources/plugin.yml" todir="${build}"/>
<replace file="${build}/plugin.yml" value="${bukkit-version}-${DSTAMP}">
<replacetoken>[[version]]</replacetoken>
</replace>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/scriptcraft-${bukkit-version}-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="clean" description="clean up" >
<delete dir="${dist}"/>
</target>
<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"/>
</target>
</project>