-
Notifications
You must be signed in to change notification settings - Fork 45
/
build.xml
124 lines (114 loc) · 4.5 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="build" name="Create runnable jar for project Dayon!">
<property name="dir.binfile" value="."/>
<property name="dir.src" value="${dir.binfile}/src/main/java"/>
<property name="dir.jares" value="${dir.binfile}/src/main/resources"/>
<property name="dir.docs" value="${dir.binfile}/docs"/>
<property name="dir.lib" value="${dir.binfile}/lib"/>
<property name="dir.res" value="${dir.binfile}/resources"/>
<property name="dir.bin" value="${dir.binfile}/bin"/>
<property name="dir.build" value="${dir.binfile}/build"/>
<property name="dir.dist" value="${dir.binfile}/dist"/>
<property name="dir.ppa" value="${dir.binfile}/debian"/>
<property name="main.class" value="mpo.dayon.common.Runner"/>
<property name="ant.build.javac.release" value="11"/>
<property name="version" value="15.0.1"/>
<path id="project.classpath">
<fileset dir="${dir.lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${dir.bin}"/>
<delete dir="${dir.build}"/>
<delete dir="${dir.dist}"/>
</target>
<target name="init">
<tstamp/>
<mkdir dir="${dir.bin}"/>
<mkdir dir="${dir.build}"/>
<mkdir dir="${dir.dist}"/>
</target>
<target name="compile" depends="init" description="Compile the sources">
<javac debug="true" includeantruntime="false" srcdir="${dir.src}" destdir="${dir.bin}" classpathref="project.classpath">
<compilerarg compiler="modern" line="-Xlint"/>
<compilerarg compiler="modern" line="-implicit:none"/>
</javac>
<copy todir="${dir.bin}">
<fileset dir="${dir.src}">
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${dir.jares}"/>
</copy>
</target>
<target name="build" depends="compile" description="Build the jar">
<jar destfile="${dir.build}/dayon.jar">
<zipfileset src="${dir.binfile}/lib/xz-1.10.jar" excludes="META-INF/**"/>
<zipfileset src="${dir.binfile}/lib/com/dosse/upnp/WaifUPnP/1.3.1/WaifUPnP-1.3.1.jar" excludes="META-INF/**"/>
<manifest>
<attribute name="Application-Name" value="Dayon!"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Trusted-Library" value="true"/>
</manifest>
<fileset dir="${dir.bin}"/>
</jar>
</target>
<target name="dist" depends="build" description="Creates directory structure with files for distribution">
<copy file="${dir.build}/dayon.jar" todir="${dir.dist}"/>
<copy todir="${dir.dist}">
<fileset dir="${dir.res}">
<exclude name="snap/"/>
<exclude name="jre/"/>
<exclude name="jrex/"/>
</fileset>
</copy>
<copy file="${dir.docs}/favicon.ico" todir="${dir.dist}"/>
<chmod dir="${dir.dist}" perm="ugo+rx" includes="**/*.sh"/>
</target>
<target name="ppa" depends="build" description="Creates directory structure with files for ppa">
<copy file="${dir.build}/dayon.jar" todir="${dir.ppa}"/>
<copy todir="${dir.ppa}">
<fileset dir="${dir.res}">
<exclude name="snap/"/>
<exclude name="jre/"/>
<exclude name="jrex/"/>
<exclude name="readme.txt"/>
<exclude name="setup.sh"/>
</fileset>
</copy>
<chmod dir="${dir.ppa}" perm="ugo+rx" includes="**/*.sh"/>
</target>
<target name="dist_with_jre" depends="dist" description="Creates directory structure with files for distribution, including openJDK for Windows">
<copy todir="${dir.dist}">
<fileset dir="${dir.res}"/>
</copy>
<copy file="${dir.docs}/favicon.ico" todir="${dir.dist}"/>
</target>
<target name="sign" description="Signs the distribution project jar">
<signjar keystore="${dir.jares}/trust/X509" storepass="spasspass" alias="mykey" jar="${dir.dist}/dayon.jar" tsaurl="http://timestamp.sectigo.com"/>
</target>
<target name="tar" description="Creates a gzipped tar archive of the distribution for Linux">
<copy todir="${dir.dist}/tar/dayon">
<fileset dir="${dir.dist}">
<exclude name="jre/"/>
<exclude name="jrex/"/>
</fileset>
</copy>
<tar destfile="${dir.dist}/dayon.${version}.tgz" longfile="gnu" compression="gzip">
<tarfileset dir="${dir.dist}/tar">
<include name="**/*"/>
<exclude name="**/*.sh"/>
<exclude name="**/favicon.ico"/>
</tarfileset>
<tarfileset dir="${dir.dist}/tar" filemode="755">
<include name="**/dayon.sh"/>
<include name="**/dayon_assistant.sh"/>
<include name="**/dayon_assisted.sh"/>
<include name="**/setup.sh"/>
</tarfileset>
</tar>
<delete dir="${dir.dist}/tar"/>
</target>
</project>