forked from EngineHub/CraftBook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
104 lines (95 loc) · 3.46 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
93
94
95
96
97
98
99
100
101
102
103
104
<project name="CraftBook" default="dist" basedir=".">
<description>
CraftBook adds interactive mechanics, Redstone features, and
Minecart enhancements to Minecraft SMP.</description>
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="dist.dir" location="dist"/>
<property name="release.dir" location="release"/>
<property name="lib.dir" location="lib"/>
<target name="init">
<mkdir dir="${build.dir}"/>
</target>
<!-- Compile the source files -->
<target name="compile" depends="init">
<javac srcdir="${src.dir}" deprecation="true" includeantruntime="true" destdir="${build.dir}" debug="true">
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<!-- Build the .jar -->
<target name="jar" depends="compile">
<mkdir dir="${dist.dir}"/>
<manifest file="manifest.mf" mode="replace">
<attribute name="Implementation-Title" value="CraftBook"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="CraftBook-Version" value="${version}"/>
<attribute name="Class-Path" value="WorldEdit.jar"/>
</manifest>
<jar jarfile="${dist.dir}/CraftBook.jar" basedir="${build.dir}" manifest="manifest.mf"/>
</target>
<!-- Create the .jar -->
<target name="dist">
<property name="version" value="nightly"/>
<antcall target="jar"/>
</target>
<!-- Build a release -->
<target name="release">
<input message="Enter version:" addproperty="version"/>
<antcall target="jar"/>
<delete dir="${release.dir}"/>
<mkdir dir="${release.dir}"/>
<mkdir dir="${release.dir}/src"/>
<copy todir="${release.dir}/src">
<fileset dir="${src.dir}"/>
</copy>
<copy todir="${release.dir}">
<fileset dir="."/>
<globmapper from="*.txt" to="*.txt"/>
</copy>
<copy tofile="${release.dir}/CraftBook.jar" file="${dist.dir}/CraftBook.jar"/>
<!--<copy todir="${release.dir}">
<fileset dir="lib">
<exclude name="Minecraft_Mod.jar"/>
<exclude name="minecraft_server.jar"/>
<exclude name="WorldEdit.jar"/>
<exclude name="JFlex.jar"/>
</fileset>
</copy>-->
<zip destfile="${release.dir}/craftbook-${version}.zip" basedir="${release.dir}" excludes="*.zip"/>
</target>
<!-- Clean the output -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${release.dir}"/>
</target>
<!-- Run JFlex -->
<target name="run-jflex">
<taskdef classname="JFlex.anttask.JFlexTask" name="jflex">
<classpath>
<pathelement location="JFlex.jar"/>
</classpath>
</taskdef>
<!-- WARNING: Hardcoded. JFlex's Ant task is horrible. -->
<jflex file="src/lymia/customic/CustomICScanner.lex" destdir="${src.dir}"/>
</target>
<!--<target name="-get-version-git" if="git-revision">
<sequential>
<exec executable="git" failifexecutionfails="false" outputproperty="git-revision">
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<exec executable="git" outputproperty="git-revision-dirty">
<arg value="diff"/>
<arg value="- -shortstat"/>
</exec>
<condition else="dev-${git-revision}-modified" property="version" value="dev-${git-revision}">
<equals arg1="" arg2="${git-revision-dirty}"/>
</condition>
</sequential>
</target>-->
</project>