-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
99 lines (97 loc) · 3.8 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="JBookReader">
<!-- Loads global properties for this build -->
<property file="build.properties"/>
<filter filtersfile="build.properties" />
<path id="project.classpath">
<pathelement path="${classpath}" />
<pathelement location="bin" />
<fileset dir="lib" includes="**/*.jar" />
<pathelement location="${JUNIT_HOME}/junit.jar" />
</path>
<target name="init">
<mkdir dir="bin"/>
<mkdir dir="tests/temp"/>
<copy overwrite="true" filtering="true" file="src/org/jbookreader/Values.java.in" tofile="src/org/jbookreader/Values.java" />
</target>
<target name="clean">
<delete dir="bin"/>
<delete>
<fileset dir="." includes="TEST-*"/>
<fileset dir="." includes="TESTS-*"/>
</delete>
<delete file="src/org/jbookreader/Values.java" />
<delete dir="docs/api" />
<delete dir="docs/report" />
</target>
<target depends="init" name="build">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="${build.debug}" destdir="bin" classpathref="project.classpath">
<src path="src"/>
</javac>
<copy todir="bin">
<fileset dir="src" includes="**/*.properties" />
</copy>
</target>
<target name="Main" depends="build">
<java classname="org.jbookreader.ui.swing.Main" failonerror="true" fork="yes">
<classpath refid="project.classpath"/>
</java>
</target>
<target name="TextUI" depends="build">
<java classname="org.jbookreader.ui.text.TextUI" failonerror="true" fork="yes">
<classpath refid="project.classpath"/>
</java>
</target>
<target name="javadoc" depends="init">
<javadoc destdir="docs/api" version="true" use="true" author="true">
<fileset dir="src"/>
</javadoc>
</target>
<target name="jdepend" depends="build">
<jdepend outputfile="jdepend-report.txt">
<exclude name="java.*" />
<exclude name="javax.*" />
<exclude name="org.xml.*" />
<exclude name="org.w3c.*" />
<classespath refid="project.classpath" />
</jdepend>
</target>
<target name="test" depends="build">
<junit fork="yes" printsummary="on" haltonfailure="off" failureproperty="project.test.failed">
<formatter type="xml"/>
<batchtest>
<fileset dir="src" includes="**/*Test.java" excludes="**/AllTests.java, **/Abstract*" />
</batchtest>
<classpath refid="project.classpath"/>
</junit>
<junitreport >
<fileset dir="." includes="TEST-*.xml"/>
<report format="frames" todir="docs/report" />
</junitreport>
<fail if="project.test.failed" />
</target>
<target name="jar" depends="test">
<jar destfile="${ant.project.name}-${project.version}.jar">
<fileset dir="bin" excludes="**/*Test*" />
<fileset file="COPYING" />
<manifest>
<attribute name="Sealed" value="true" />
<attribute name="Main-Class" value="org.jbookreader.ui.swing.Main" />
</manifest>
</jar>
</target>
<target name="srczip" >
<zip destfile="${ant.project.name}-${project.version}-src.zip" >
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="src/**"/>
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="tests/**" excludes="tests/temp/**"/>
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="docs/**" excludes="docs/api/**, docs/report/**"/>
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="build.*"/>
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="COPYING"/>
<zipfileset prefix="${ant.project.name}-${project.version}" dir="." includes="TODO"/>
</zip>
</target>
<target name="help">
<echo message="Please run: $ ant -v -projecthelp"/>
</target>
</project>