-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
106 lines (95 loc) · 3.25 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
<?xml version="1.0"?>
<project name="kmttg" basedir="." default="all">
<property name="rversion" value="v2.4i"/>
<tstamp/>
<property name="bversion" value="${DSTAMP}-${TSTAMP}"/>
<property name="lib" value="lib"/>
<property name="release" value="release"/>
<property name="main" value="."/>
<property name="main.class" value="com.tivo.kmttg.main.kmttg"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<path id="main.classpath">
<pathelement location="${lib}/jmdns.jar"/>
<pathelement location="${lib}/tivo-libre.jar"/>
</path>
<target name="clean">
<delete dir="bin"/>
<delete dir="dist"/>
</target>
<target name="create">
<mkdir dir="bin"/>
<mkdir dir="${release}"/>
</target>
<target name="create-dist">
<mkdir dir="dist"/>
<mkdir dir="dist/${dist}"/>
</target>
<target name="create-dist-src" depends="create-dist">
<mkdir dir="dist/${dist}-src"/>
</target>
<target name="writeversion">
<echo file="${main}/version.txt" append="false" message="${ant.project.name}|${version}"/>
</target>
<target name="jar" depends="build">
<delete file="${release}/kmttg.jar"/>
<jar destfile="${release}/kmttg.jar">
<fileset dir="${main}/bin"/>
<fileset dir="${main}/images"/>
<zipgroupfileset dir="${lib}" includes="jmdns.jar"/>
<zipgroupfileset dir="${lib}" includes="tivo-libre.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<target name="build" depends="create">
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="main.classpath"/>
</javac>
</target>
<target name="init">
<property name="version" value="${bversion}"/>
<property name="dist" value="kmttg_${version}"/>
</target>
<target name="all" depends="init,clean,build,jar,dist-both"/>
<target name="release">
<property name="version" value="${rversion}"/>
<antcall target="all"/>
</target>
<target name="dist-src" depends="create-dist-src">
<copy todir="dist/${dist}-src">
<fileset dir=".">
<include name="src/**"/>
<include name="build.xml"/>
<include name="release/**"/>
</fileset>
</copy>
<chmod file="dist/${release}/kmttg" perm="ugo+x"/>
<chmod file="dist/${release}/kmttg.bat" perm="ugo+x"/>
<zip destfile="dist/${dist}-src.zip">
<zipfileset dir="dist/${dist}-src" prefix="${dist}"
includes="**"
excludes="release META-INF"/>
<zipfileset file="dist/${dist}-src/${release}/kmttg" filemode="755"
prefix="${dist}"/>
<zipfileset file="dist/${dist}-src/${release}/kmttg.bat" filemode="755"
prefix="${dist}"/>
</zip>
<delete dir="dist/${dist}-src"/>
</target>
<target name="dist-both" depends="create-dist">
<antcall target="build"/>
<copy todir="dist/${dist}/release">
<fileset dir="release"/>
</copy>
<chmod file="dist/${dist}/${release}/kmttg" perm="ugo+x"/>
<zip destfile="dist/${dist}.zip">
<zipfileset dir="dist/${dist}/${release}" filemode="755"
includes="**"/>
</zip>
<delete dir="dist/${dist}"/>
</target>
</project>