-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·175 lines (158 loc) · 8.21 KB
/
Copy pathbuild.xml
File metadata and controls
executable file
·175 lines (158 loc) · 8.21 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?xml version="1.0" encoding="UTF-8"?>
<project name="Visualgorithm" default="default" basedir=".">
<property name="platform.version" value="1.7"/>
<property name="project.name" value="Visualgorithm"/>
<property name="project.version" value="0.20"/>
<property name="project.encoding" value="UTF-8"/>
<property name="main.class" value="main.Visualgorithm"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="lib.dir" location="lib"/>
<property name="img.dir" location="img"/>
<property name="build.dir" location="bin"/>
<property name="build.src.dir" location="${build.dir}/src"/>
<property name="build.test.dir" location="${build.dir}/test"/>
<property name="dist.dir" location="dist"/>
<property name="dist.javadoc.dir" location="${dist.dir}/Javadoc"/>
<property name="dist.test.dir" location="${dist.dir}/Test"/>
<property name="dist.instrument.dir" location="${dist.dir}/Instrument"/>
<path id="lib.path">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<dirset dir="${build.src.dir}">
<include name="**"/>
</dirset>
</path>
<target name="-pre-compile-src">
<delete dir="${build.src.dir}"/>
<mkdir dir="${build.src.dir}"/>
</target>
<target name="-pre-compile-test">
<delete dir="${build.test.dir}"/>
<mkdir dir="${build.test.dir}"/>
</target>
<target name="-pre-jar">
<mkdir dir="${dist.dir}"/>
<copy todir="${build.src.dir}/img">
<fileset dir="${img.dir}"/>
</copy>
</target>
<target name="clean" description="Clean build products.">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="compile-src-release" depends="-pre-compile-src" description="Compile src directory of the project.">
<javac destdir="${build.src.dir}" encoding="${project.encoding}" fork="yes" includeantruntime="false" includes="**" source="${platform.version}" sourcepath="" srcdir="${src.dir}" target="${platform.version}"/>
</target>
<target name="compile-test-release" depends="compile-src-release, -pre-compile-test" description="Compile test directory of the project.">
<javac destdir="${build.test.dir}" encoding="${project.encoding}" fork="yes" includeantruntime="false" includes="**" source="${platform.version}" sourcepath="" srcdir="${test.dir}" target="${platform.version}">
<classpath refid="lib.path"/>
</javac>
</target>
<target name="compile-src-debug" depends="-pre-compile-src" description="Compile src directory of the project.">
<javac destdir="${build.src.dir}" encoding="${project.encoding}" fork="yes" includeantruntime="false" includes="**" source="${platform.version}" sourcepath="" srcdir="${src.dir}" target="${platform.version}" debug="yes"/>
</target>
<target name="compile-test-debug" depends="compile-src-debug, -pre-compile-test" description="Compile test directory of the project.">
<javac destdir="${build.test.dir}" encoding="${project.encoding}" fork="yes" includeantruntime="false" includes="**" source="${platform.version}" sourcepath="" srcdir="${test.dir}" target="${platform.version}" debug="yes">
<classpath refid="lib.path"/>
</javac>
</target>
<target name="jar" depends="compile-src-release, -pre-jar" description="Build JAR.">
<jar jarfile="${dist.dir}/${project.name}-${project.version}.jar" basedir="${build.src.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar" description="Run a main class.">
<java jar="${dist.dir}/${project.name}-${project.version}.jar" fork="true"/>
</target>
<target name="test" depends="compile-test-release" description="Run unit tests.">
<mkdir dir="${dist.test.dir}"/>
<junit printsummary="yes" fork="yes">
<classpath>
<path refid="lib.path"/>
<pathelement path="${build.test.dir}"/>
</classpath>
<formatter type="xml" usefile="true"/>
<batchtest haltonfailure="no" todir="${dist.test.dir}">
<fileset dir="${build.test.dir}">
<include name="**/*Test.class"/>
<exclude name="**/*FunctionalTest.class"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${dist.dir}" tofile="Report-JUnit.xml">
<fileset dir="${dist.test.dir}" includes="*.xml"/>
</junitreport>
<delete dir="${dist.test.dir}"/>
</target>
<target name="cobertura" depends="compile-test-debug" description="Check code coverage. Parameter : ${cobertura.dir}.">
<mkdir dir="${dist.instrument.dir}"/>
<mkdir dir="${dist.test.dir}"/>
<taskdef resource="tasks.properties">
<classpath>
<fileset dir="${cobertura.dir}">
<include name="cobertura*.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<cobertura-instrument datafile="${build.dir}/Cobertura.ser" todir="${dist.instrument.dir}">
<fileset dir="${build.src.dir}">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
<junit printsummary="yes" fork="yes" failureProperty="test.failed">
<sysproperty key="net.sourceforge.cobertura.datafile" file="${build.dir}/Cobertura.ser"/>
<classpath>
<pathelement path="${dist.instrument.dir}"/>
<pathelement path="${build.src.dir}"/>
<pathelement path="${build.test.dir}"/>
<fileset dir="${cobertura.dir}">
<include name="cobertura*.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
<path refid="lib.path"/>
</classpath>
<formatter type="xml" usefile="true"/>
<batchtest haltonfailure="no" todir="${dist.test.dir}">
<fileset dir="${build.test.dir}">
<include name="**/*Test.class"/>
<exclude name="**/*FunctionalTest.class"/>
</fileset>
</batchtest>
</junit>
<cobertura-report datafile="${build.dir}/Cobertura.ser" srcdir="${src.dir}" destdir="${dist.dir}" format="xml"/>
<move file="${dist.dir}/coverage.xml" tofile="${dist.dir}/Report-Cobertura.xml"/>
<delete dir="${dist.instrument.dir}"/>
<delete dir="${dist.test.dir}"/>
</target>
<target name="javadoc" description="Build Javadoc.">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc author="true" charset="${project.encoding}" destdir="${dist.javadoc.dir}" docencoding="${project.encoding}" encoding="${project.encoding}" failonerror="true" noindex="false" nonavbar="false" notree="false" private="false" source="${platform.version}" splitindex="true" use="true" useexternalfile="true" version="true" windowtitle="${project.name}">
<fileset dir="${src.dir}">
<filename name="**/*.java"/>
</fileset>
</javadoc>
</target>
<target name="checkstyle" description="Check Java conventions. Parameters : ${checkstyle.dir}, ${checkstyle.rules.file}.">
<mkdir dir="${dist.dir}"/>
<taskdef resource="checkstyletask.properties">
<classpath>
<fileset dir="${checkstyle.dir}">
<include name="checkstyle*.jar"/>
<include name="lib/**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<checkstyle config="${checkstyle.rules.file}" failOnViolation="false">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
<formatter type="xml" toFile="${dist.dir}/Report-Checkstyle.xml"/>
</checkstyle>
</target>
<target depends="test, jar, javadoc" description="Build and test whole project." name="default"/>
</project>