merge mrdon's changes
This commit is contained in:
parent
6a649647b1
commit
3031a0216a
5 changed files with 62 additions and 15 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,3 +2,6 @@ target
|
|||
*.class
|
||||
*.js~
|
||||
*.js#
|
||||
*.iml
|
||||
*.idea
|
||||
build.local.properties
|
||||
|
|
4
build.local.properties.sample
Normal file
4
build.local.properties.sample
Normal 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
|
|
@ -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
|
||||
|
|
46
build.xml
46
build.xml
|
@ -4,18 +4,53 @@
|
|||
<property name="src" location="src/main/java"/>
|
||||
<property name="build" location="target/classes"/>
|
||||
<property name="dist" location="target/" />
|
||||
<property name="minecraft.dir" location="${dist}/minecraft" />
|
||||
|
||||
<target name="init">
|
||||
<property file="build.local.properties"/>
|
||||
<tstamp>
|
||||
<format property="DSTAMP"
|
||||
pattern="yyyy-MM-dd"
|
||||
locale="en,UK"/>
|
||||
</tstamp>
|
||||
<mkdir dir="${build}"/>
|
||||
|
||||
<available file="${minecraft.dir}" property="minecraft.present"/>
|
||||
</target>
|
||||
|
||||
<target name="compile" depends="init" description="compile bukkit plugin source">
|
||||
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" classpath="${bukkit-lib}" />
|
||||
<target name="server-setup" depends="init" description="Downloads the latest bukkit dev jar"
|
||||
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 name="gendocs" depends="init" description="Generate API documentation">
|
||||
|
@ -43,6 +78,7 @@
|
|||
</replace>
|
||||
|
||||
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
|
||||
<mkdir dir="${dist}/${DSTAMP}" />
|
||||
<jar jarfile="${dist}/${DSTAMP}/ScriptCraft.jar" basedir="${build}"/>
|
||||
</target>
|
||||
|
||||
|
@ -51,9 +87,11 @@
|
|||
</target>
|
||||
|
||||
<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>
|
||||
<fileset dir="${craftbukkit}/plugins/" includes="scriptcraft*.*"/>
|
||||
<fileset dir="${minecraft.dir}/plugins/" includes="scriptcraft*.*"/>
|
||||
</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>
|
||||
</project>
|
||||
|
|
13
build/bukkit-to-url.xsl
Normal file
13
build/bukkit-to-url.xsl
Normal 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>
|
Reference in a new issue