forked from FallenMoonNetwork/CanaryMod
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
92 lines (82 loc) · 3.6 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<project name="CanaryMod Full Package Compiler" default="dist" basedir=".">
<description>
This script will build the CanaryMod jarfile and zip appropriate files.
</description>
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<path id="classpath">
<fileset dir="jarjar">
<include name="minecraft_servero.jar" />
<include name="jarjar.jar" />
</fileset>
</path>
<target name="verifyRequirements" description="Checks if the necessary requirements for building Handler are fulfilled">
<available classname="javax.script.ScriptContext" property="JDK6.present" />
<fail unless="JDK6.present" message="JDK 6 or greater is required." />
</target>
<target name="init" depends="clean, verifyRequirements" description="Create the output directories.">
<mkdir dir="${build}" />
<mkdir dir="${build}/classes" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}/plugins" />
<mkdir dir="${dist}/logs" />
</target>
<target name="compile" depends="init" description="Compile the source.">
<javac destdir="${build}/classes" optimize="on" debug="on" includeantruntime="false" debuglevel="lines,vars,source" source="1.6" target="1.6" nowarn="off">
<src path="${src}" />
<classpath refid="classpath" />
<compilerarg value="-Xlint:deprecation" />
</javac>
</target>
<target name="jar" depends="compile" description="Create the jar file">
<jar destfile="${dist}/CanaryMod.jar">
<fileset dir="${build}/classes" />
<manifest>
<attribute name="Main-Class" value="Main" />
<attribute name="Class-Path" value="minecraft_servero.jar jarjar.jar mysql-connector-java-bin.jar plugins/ lib/" />
</manifest>
</jar>
</target>
<target name="-get-version" unless="version">
<exec executable="git" outputproperty="version">
<arg value="describe" />
</exec>
</target>
<target name="dist" depends="jar,-get-version">
<echo file="files/version.txt">${version}${line.separator}</echo>
<copy todir="${dist}">
<fileset dir="files">
<include name="*.sql" />
<include name="*.txt" />
<include name="*.bat" />
<include name="*.sh" />
</fileset>
<fileset dir="jarjar">
<include name="jarjar.jar" />
<include name="mysql-connector-java-bin.jar" />
<include name="rules.rules" />
</fileset>
</copy>
<copy todir="${dist}/plugins">
<fileset dir="files/plugins">
<include name="*.txt" />
</fileset>
</copy>
<zip destfile="${dist}/CanaryMod.zip" basedir="${dist}" />
</target>
<target name="clean" description="Remove the output directories">
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="javadoc" description="Generate javadocs">
<javadoc author="true" charset="UTF-8" classpathref="classpath" destdir="docs" docencoding="UTF-8" failonerror="true" use="true" useexternalfile="true" version="true">
<fileset dir="${src}">
<filename name="**/*.java" />
<filename regex="O[A-Z].*\.java" negate="true" />
</fileset>
</javadoc>
</target>
</project>