-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
92 lines (84 loc) · 3.43 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
<project name="MiSPILab3" default="build">
<property file="build.properties"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="*.jar"/>
<fileset dir="${main.dir}" includes="*.java"/>
</path>
<path id="classpath.test">
<pathelement location="${junit}"/>
<pathelement location="${hamcrest}"/>
<pathelement location="${classes.dir}"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${junit.report.dir}"/>
<echo message="––– CLEAN DONE –––"/>
</target>
<target name="compile" depends="clean">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.classes.dir}"/>
<javac srcdir="${main.dir}" destdir="${classes.dir}" classpathref="classpath" source="1.8"
includeantruntime="false"/>
<copy todir="${classes.dir}">
<fileset dir="${resources.dir}"/>
</copy>
<echo message="––– COMPILE DONE –––"/>
</target>
<target name="build" depends="compile">
<copy todir="${artifact.dir}" >
<fileset dir="${web.dir}"/>
</copy>
<copy todir="${artifact-lib.dir}">
<fileset dir="${lib.dir}"/>
</copy>
<war destfile="${build.dir}/${ant.project.name}.war">
<fileset dir="${artifact.dir}"/>
<manifest>
<attribute name="Created-By" value="Artyom + Anvar" />
<attribute name="Manifest-Version" value="1.0" />
<attribute name="Main-Class" value="NoClass" />
</manifest>
</war>
<echo message="––– BUILD DONE –––"/>
</target>
<target name="test" depends="compile">
<mkdir dir="${junit.report.dir}"/>
<javac destdir="${test.classes.dir}" srcdir="${test.dir}" includeantruntime="false"
classpathref="classpath.test"/>
<junit printsummary="on" haltonfailure="yes">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.classes.dir}"/>
</classpath>
<batchtest fork="yes" todir="${junit.report.dir}">
<formatter type="xml"/>
<fileset dir="${test.dir}" includes="*Test*.java"/>
</batchtest>
</junit>
<echo message="––– TESTS COMPLETED –––"/>
</target>
<target name="xml">
<xmlvalidate warn="yes" failonerror="no" >
<fileset dir="${project.dir}" includes="**/*.xml">
<exclude>name=".idea/**"</exclude>
</fileset>
<attribute name="http://xml.org/sax/features/validation" value="true"/>
<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
</xmlvalidate>
<echo message="––– XML VALIDATION DONE –––"/>
</target>
<target name="env" depends="clean">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${main.dir}" destdir="${classes.dir}" classpathref="classpath" source="${compile.version}"
includeantruntime="false">
</javac>
<copy todir="${classes.dir}">
<fileset dir="${resources.dir}"/>
</copy>
<antcall target="build"/>
<exec executable="bash">
<arg value="env.sh"/>
</exec>
</target>
</project>