-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
77 lines (65 loc) · 2.75 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="current-number" name="mc-server-backup-util">
<property file="build_info.properties"/>
<property name="build.number" value="${build.major.number}.${build.minor.number}.${build.revision.number}"/>
<property name="dir.buildfile" value="."/>
<property name="dir.jarfile" value="${dir.buildfile}/dist"/>
<property name="dir.src" value="src"/>
<property name="dir.bin" value="bin"/>
<property name="dir.lib" value="lib"/>
<path id="classpath">
<fileset dir="${dir.lib}" includes="**/*.jar"/>
</path>
<target name="current-number">
<echo>Current build number: ${build.number}</echo>
</target>
<target name="major">
<propertyfile file="build_info.properties">
<entry key="build.major.number" type="int" operation="+" value="1"/>
<entry key="build.minor.number" type="int" value="0"/>
<entry key="build.revision.number" type="int" value="0"/>
</propertyfile>
</target>
<target name="minor">
<propertyfile file="build_info.properties">
<entry key="build.minor.number" type="int" operation="+" value="1"/>
<entry key="build.revision.number" type="int" value="0"/>
</propertyfile>
</target>
<target name="revision">
<propertyfile file="build_info.properties">
<entry key="build.revision.number" type="int" operation="+" value="1"/>
</propertyfile>
</target>
<target name="clean">
<delete dir="${dir.bin}"/>
</target>
<target name="compile">
<mkdir dir="${dir.bin}"/>
<javac destdir="${dir.bin}" classpathref="classpath" fork="yes" includeantruntime="false">
<src path="${dir.src}"/>
<exclude name="**/*Test.java"/>
</javac>
</target>
<target name="dist" depends="compile">
<antcall target="current-number"/>
<jar destfile="${dir.jarfile}/${ant.project.name}-${build.number}.jar">
<manifest>
<attribute name="Main-Class" value="io.github.thelegendofbrian.utility.Main"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.buildfile}/bin"/>
<!--zipfileset dir="./lib" includes="TalkarLogger-0.2.0.jar"/>
<zipfileset dir="./lib" includes="slf4j-api-1.7.25.jar"/>
<zipfileset dir="./lib" includes="slf4j-simple-1.7.25.jar"/>
<zipfileset dir="./lib" includes="zt-zip-1.11.jar"/-->
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/TalkarLogger-0.2.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/slf4j-api-1.7.25.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/slf4j-simple-1.7.25.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/zt-zip-1.11.jar" />
</jar>
</target>
<target name="run" depends="dist">
<java jar="${dir.jarfile}/${ant.project.name}-${build.number}.jar" dir="${dir.bin}" fork="true" />
</target>
</project>