-
Notifications
You must be signed in to change notification settings - Fork 6
/
buildconfig.xml
125 lines (101 loc) · 4.72 KB
/
buildconfig.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0" encoding="UTF-8"?>
<project name="DUEC" default="std" basedir=".">
<property environment="env"/>
<property name="version-number" value="${env.MAJORVERSION}.${env.MINORVERSION}.${env.BUILD_NUMBER}" />
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="class.dir" value="classes" />
<property name="javadoc.dir" value="${build.dir}/javadoc" />
<property name="test.dir" value="test"/>
<property name="test.classes.dir" value="${build.dir}/src/test/classes" />
<property name="test.results.dir" value="${build.dir}/src/test/results" />
<path id="project-classpath">
<!-- libs from local project (local lib) -->
<fileset id="project-lib" dir="lib" includes="**/*.jar" />
</path>
<path id="test.classpath">
<pathelement location="lib/junit-4.10.jar" />
<pathelement location="lib/jcifs-1.3.17.jar" />
<pathelement location="lib/wiseman.jar" />
<pathelement location="${build.classes.dir}" />
</path>
<target name="clean">
<!--<delete dir="${result.dir}" />-->
<delete dir="${build.dir}" />
</target>
<target name="jar" depends="clean, compile">
<mkdir dir="${class.dir}" />
<property name="jarpath" value="${build.dir}/DUEC-${env.MAJORVERSION}.${env.MINORVERSION}.jar" />
<jar destfile="${jarpath}" basedir="${class.dir}">
<manifest>
<attribute name="Implementation-Version" value="${version-number}" />
</manifest>
</jar>
</target>
<target name="compile" depends="create">
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${class.dir}" classpathref="project-classpath" />
</target>
<target name="create" depends="delete">
<mkdir dir="${class.dir}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${javadoc.dir}"/>
</target>
<target name="delete" >
<delete dir="classes"/>
<delete dir="${build.dir}"/>
</target>
<target name="copy">
<copy todir="${build.dir}">
<fileset refid="project-lib" />
</copy>
</target>
<target name="javadoc" description="Create API documentation">
<javadoc charset="UTF-8" destdir="${javadoc.dir}" classpathref="project-classpath">
<!-- classpath refid="project-classpath" / -->
<fileset dir="${src.dir}">
<filename name="**/*.java" />
<exclude name="**/dcim/**"/>
</fileset>
</javadoc>
</target>
<!-- This target cleans all test classes and results before test suite compilation -->
<target name="clean-testclasses" description="cleans the test directories">
<delete dir="${test.classes.dir}"/>
<delete dir="${test.results.dir}"/>
</target>
<!-- This target compiles all the test classes and depends clean-up of test classes -->
<target name="compile-test" depends="clean-testclasses" description="compiles all Test classes">
<mkdir dir="${test.classes.dir}" />
<mkdir dir="${test.results.dir}" />
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${test.classes.dir}"
classpathref="project-classpath" />
<javac includeantruntime="true" srcdir="${test.dir}" destdir="${test.classes.dir}"
debug="on" classpathref="project-classpath">
<classpath refid="test.classpath"/>
</javac>
<copy todir="${test.classes.dir}">
<fileset dir="${test.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- This target runs all the junit test cases available in the comlete test suite-->
<target name="test" depends="compile-test" description="runs all Test classes">
<junit>
<formatter type="brief" usefile="false" />
<formatter type="xml" />
<classpath refid ="test.classpath"/>
<classpath location="${test.classes.dir}" />
<batchtest todir="${test.results.dir}">
<fileset dir="${test.classes.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
<junitreport todir="${test.results.dir}">
<fileset dir="${test.results.dir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${test.results.dir}" format="frames"/>
</junitreport>
</target>
<target name="std" description="clean compile with JAR ouput and test whole project" depends="clean, compile, jar, copy, javadoc" />
</project>