-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
76 lines (66 loc) · 2.29 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
<project name="RokClock" basedir="." default="run">
<property name="config.file" value="config.txt.default" />
<property name="projects.file" value="projects.txt.default" />
<property name="main.class" value="rokclock.Main" />
<property name="src.dir" value="src" />
<property name="bin.dir" value="bin" />
<property name="dist.dir" value="dist" />
<property name="contents.dir" value="${dist.dir}/RokClock" />
<property name="jar.file" value="${contents.dir}/RokClock.jar" />
<property name="zip.file" value="${dist.dir}/RokClock.zip" />
<property name="readme.markdown" value="README.markdown" />
<property name="readme.html" value="${contents.dir}/README.html" />
<target name="clean-dist">
<delete dir="${contents.dir}" />
<mkdir dir="${contents.dir}" />
</target>
<target name="clean" depends="clean-dist">
<delete dir="${bin.dir}" />
<delete file="${jar.file}" />
<delete file="${zip.file}" />
</target>
<target name="compile">
<mkdir dir="${bin.dir}" />
<javac srcdir="${src.dir}" destdir="${bin.dir}" />
</target>
<target name="run" depends="compile">
<java classpath="${bin.dir}" classname="${main.class}"
fork="true" spawn="true" />
</target>
<target name="no-daemon" depends="compile">
<exec executable="java">
<arg value="-cp"/>
<arg value="${bin.dir}"/>
<arg value="${main.class}"/>
</exec>
</target>
<target name="jar" depends="compile">
<jar destfile="${jar.file}" basedir="${bin.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
<target name="readme">
<exec executable="markdown" output="${readme.html}">
<arg value="${readme.markdown}"/>
</exec>
</target>
<target name="copy-to-dist">
<copy todir="${contents.dir}" overwrite="true" preservelastmodified="true">
<fileset file="${config.file}" />
<fileset file="${projects.file}" />
<fileset file="${dist.dir}/run.*" />
</copy>
<chmod file="${contents.dir}/run.*" perm="+x" />
</target>
<target name="win-format">
<exec executable="todos">
<arg value="${contents.dir}/${config.file}" />
<arg value="${contents.dir}/${projects.file}" />
</exec>
</target>
<target name="dist" depends="clean-dist,jar,readme,copy-to-dist,win-format">
<zip destfile="${zip.file}" basedir="${contents.dir}" />
</target>
</project>