merge mrdon's changes

This commit is contained in:
walterhiggins 2013-06-03 00:02:28 +01:00
parent 6a649647b1
commit 3031a0216a
5 changed files with 62 additions and 15 deletions

3
.gitignore vendored
View file

@ -2,3 +2,6 @@ target
*.class *.class
*.js~ *.js~
*.js# *.js#
*.iml
*.idea
build.local.properties

View file

@ -0,0 +1,4 @@
# Copy this file to build.local.properties and modify appropriately
# This setting will ensure the bukkit server will give you ops
op.name=YOUR_USERID_HERE

View file

@ -1,12 +1 @@
#
# If building the plugin from source you need to first install bukkit
# Change this property to suit your environment
#
# Bukkit jar file can normally be downloaded from
#
# http://dl.bukkit.org/downloads/bukkit/
#
#bukkit-lib=/home/walter/bukkit/target/original-bukkit-1.4.6-R0.4-SNAPSHOT.jar
bukkit-lib=/home/walter/bukkit-147/bukkit-1.4.7-R0.2-20130119.122210-3.jar
craftbukkit=/home/walter/craftbukkit/
bukkit-version=1.4.7 bukkit-version=1.4.7

View file

@ -4,18 +4,53 @@
<property name="src" location="src/main/java"/> <property name="src" location="src/main/java"/>
<property name="build" location="target/classes"/> <property name="build" location="target/classes"/>
<property name="dist" location="target/" /> <property name="dist" location="target/" />
<property name="minecraft.dir" location="${dist}/minecraft" />
<target name="init"> <target name="init">
<property file="build.local.properties"/>
<tstamp> <tstamp>
<format property="DSTAMP" <format property="DSTAMP"
pattern="yyyy-MM-dd" pattern="yyyy-MM-dd"
locale="en,UK"/> locale="en,UK"/>
</tstamp> </tstamp>
<mkdir dir="${build}"/> <mkdir dir="${build}"/>
<available file="${minecraft.dir}" property="minecraft.present"/>
</target> </target>
<target name="compile" depends="init" description="compile bukkit plugin source"> <target name="server-setup" depends="init" description="Downloads the latest bukkit dev jar"
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" classpath="${bukkit-lib}" /> unless="minecraft.present">
<mkdir dir="${minecraft.dir}" />
<echo>Retrieving CraftBukkit artifact info</echo>
<get src="http://dl.bukkit.org/api/1.0/downloads/projects/CraftBukkit?_accept=application/xml"
dest="${minecraft.dir}/bukkit.xml" />
<xslt in="${minecraft.dir}/bukkit.xml"
out="${minecraft.dir}/ant.properties.xml"
style="build/bukkit-to-url.xsl"/>
<xmlproperty file="${minecraft.dir}/ant.properties.xml" keeproot="true"/>
<echo>Retrieving CraftBukkit jar</echo>
<get src="${bukkit.url}"
dest="${minecraft.dir}/craftbukkit.jar"
verbose="true"/>
<echo>Creating default ops.txt for your user</echo>
<echo message="${op.name}" file="${minecraft.dir}/ops.txt" />
</target>
<target name="run" depends="server-setup, package, update-live-cb" description="Starts Bukkit with ScriptCraft">
<echo>Starting Bukkit with ScriptCraft</echo>
<java jar="${minecraft.dir}/craftbukkit.jar"
maxmemory="1024m"
fork="true"
dir="${minecraft.dir}"
/>
</target>
<target name="compile" depends="init, server-setup" description="compile bukkit plugin source">
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" classpath="${minecraft.dir}/craftbukkit.jar" />
</target> </target>
<target name="gendocs" depends="init" description="Generate API documentation"> <target name="gendocs" depends="init" description="Generate API documentation">
@ -43,6 +78,7 @@
</replace> </replace>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<mkdir dir="${dist}/${DSTAMP}" />
<jar jarfile="${dist}/${DSTAMP}/ScriptCraft.jar" basedir="${build}"/> <jar jarfile="${dist}/${DSTAMP}/ScriptCraft.jar" basedir="${build}"/>
</target> </target>
@ -51,9 +87,11 @@
</target> </target>
<target name="update-live-cb" depends="package" description="Copy the built plugin to the live craftbukkit folder for testing."> <target name="update-live-cb" depends="package" description="Copy the built plugin to the live craftbukkit folder for testing.">
<mkdir dir="${minecraft.dir}/plugins" />
<delete> <delete>
<fileset dir="${craftbukkit}/plugins/" includes="scriptcraft*.*"/> <fileset dir="${minecraft.dir}/plugins/" includes="scriptcraft*.*"/>
</delete> </delete>
<copy file="${dist}/${DSTAMP}/ScriptCraft.jar" todir="${craftbukkit}/plugins"/> <mkdir dir="${minecraft.dir}/plugins" />
<copy file="${dist}/${DSTAMP}/ScriptCraft.jar" todir="${minecraft.dir}/plugins"/>
</target> </target>
</project> </project>

13
build/bukkit-to-url.xsl Normal file
View file

@ -0,0 +1,13 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="list-item[name='Development Build']">
<bukkit>
<url><xsl:text>http://dl.bukkit.org</xsl:text><xsl:value-of select="latest_artifact/file/url" /></url>
</bukkit>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>