-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
98 lines (78 loc) · 2.76 KB
/
build.xml
File metadata and controls
98 lines (78 loc) · 2.76 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
<project name="SimpleProject">
<property name="build.dir" value="build"/>
<property name="build.prod.dir" value="${build.dir}/prod"/>
<property name="build.test.dir" value="${build.dir}/test"/>
<property name="build.jar.dir" value="${build.dir}/jar"/>
<property name="src.dir" value="src"/>
<property name="unit.test.dir" value="unit-test"/>
<property name="system.test.dir" value="system-test"/>
<property name="lib.dir" value="lib"/>
<path id="classpath">
<pathelement location="${build.prod.dir}"/>
<pathelement location="${build.test.dir}"/>
<fileset dir="${lib.dir}" includes="*.jar"/>
</path>
<target name="prepare" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.prod.dir}"/>
<mkdir dir="${build.test.dir}"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.prod.dir}" classpathref="classpath"/>
</target>
<target name="compile-tests">
<javac srcdir="${unit.test.dir}" destdir="${build.test.dir}">
<classpath>
<path refid="classpath"/>
<pathelement location="${build.prod.dir}"/>
</classpath>
</javac>
<javac srcdir="${system.test.dir}" destdir="${build.test.dir}">
<classpath>
<path refid="classpath"/>
<pathelement location="${build.prod.dir}"/>
</classpath>
</javac>
</target>
<property name="test.report.dir" value="${build.dir}/junitreport"/>
<property name="unit.test.report.dir" value="${build.dir}/junitreport/unit-test"/>
<property name="system.test.report.dir" value="${build.dir}/junitreport/system-test"/>
<target name="run-unit-tests" depends="compile,compile-tests">
<mkdir dir="${test.report.dir}"/>
<mkdir dir="${unit.test.report.dir}"/>
<junit printsummary="yes" errorProperty="test.failed" failureProperty="test.failed">
<classpath refid="classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${unit.test.report.dir}">
<fileset dir="unit-test/" includes="**/*Test.java"/>
</batchtest>
</junit>
<junitreport todir="${unit.test.report.dir}">
<fileset dir="${unit.test.report.dir}" includes="TEST-*.xml"/>
<report todir="${unit.test.report.dir}"/>
</junitreport>
<fail message="Unit tests failed. Check log and/or reports." if="test.failed"/>
</target>
<!--
<target name="jar" depends="run-unit-tests">
<jar destfile="${build.jar.dir}/Encrypt.jar" basedir="${build.prod.dir}">
<manifest>
<attribute name="Main-Class" value="com.develogical.crypto.Encrypt"/>
</manifest>
</jar>
</target>
-->
<target name="jar" depends="run-unit-tests">
<jar destfile="${build.jar.dir}/Encrypt.jar" basedir="${build.prod.dir}">
<manifest>
<attribute name="Main-Class" value="com.develogical.crypto.Encrypt" />
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${build.jar.dir}/Encrypt.jar" fork="true" />
</target>
</project>