This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.xml
78 lines (64 loc) · 2.63 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
<?xml version="1.0" encoding="ISO-8859-1" ?>
<project name="JMkvpropedit" default="jar">
<property name="src.dir" value="src" />
<property name="res.dir" value="${src.dir}/res" />
<property name="dist.dir" value="dist" />
<property name="build.dir" value="build" />
<property name="lib.dir" value="lib" />
<property name="extra.dir" value="extra" />
<property name="launch4j.dir" location="launch4j" />
<property name="main.class" value="io.github.brunorex.JMkvpropedit" />
<path id="lib.classpath">
<fileset dir="${lib.dir}" >
<include name="**/*.jar" />
</fileset>
</path>
<condition property="isWindows">
<os family="windows" />
</condition>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}" />
<copy todir="${build.dir}/res">
<fileset dir="${res.dir}" includes="*.png" />
</copy>
<copy todir="${dist.dir}">
<fileset dir="." includes="*.txt" />
</copy>
<copy todir="${dist.dir}">
<fileset dir="${extra.dir}" includes="*.*" />
</copy>
</target>
<target name="compile" depends="init" >
<javac includeantruntime="false" target="8" source="8" srcdir="${src.dir}" destdir="${build.dir}" debug="false" encoding="UTF-8">
<classpath refid="lib.classpath" />
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="${dist.dir}/${ant.project.name}.jar" basedir="${build.dir}">
<zipfileset src="${lib.dir}/ini4j/ini4j-0.5.4.jar" excludes="**/META-INF/" />
<zipfileset src="${lib.dir}/commons-io/commons-io-2.11.0.jar" excludes="**/META-INF/" />
<manifest>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<target name="exe" depends="jar" if="isWindows" description="Compile standalone executable">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="${launch4j.dir}/config/exe-standalone.xml" />
</target>
<target name="exe-launcher" depends="jar" if="isWindows" description="Compile executable that launches the JAR file">
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<launch4j configFile="${launch4j.dir}/config/exe-with-jar.xml" />
</target>
<target name="run" depends="jar">
<java classname="${main.class}" classpath="${build.dir}" fork="true">
<classpath refid="lib.classpath" />
</java>
</target>
<target name="clean">
<delete dir="${dist.dir}" />
<delete dir="${build.dir}" />
<delete file="JMkvpropedit.ini" />
</target>
</project>