Newer
Older
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="minerva" default="main" basedir=".">
<property environment="env"/>
<property name="build.dir" value="web/target" />
<property name="war.file" value="web-1.0.war" />
<property name="tomcat.home" value="${env.CATALINA_HOME}" />
<property name="tomcat.deploy.dir" value="${tomcat.home}/webapps" />
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="isUnix">
<os family="unix" />
</condition>
<target name="war-exists">
<available file="${tomcat.deploy.dir}/${ant.project.name}.war" property="war.exists"/>
</target>
<target name="remove-war" depends="war-exists" if="war.exists">
<delete file="${tomcat.deploy.dir}/${ant.project.name}.war" />
</target>
<target name="war-dir-exists">
<available file="${tomcat.deploy.dir}/${ant.project.name}" property="war-dir.exists" type="dir"/>
</target>
<target name="remove-war-dir" depends="war-dir-exists" if="war-dir.exists">
<delete dir="${tomcat.deploy.dir}/${ant.project.name}" />
</target>
<target name="deploy" depends="remove-war,remove-war-dir">
<copy file="${build.dir}/${war.file}" todir="${tomcat.deploy.dir}" />
<move file="${tomcat.deploy.dir}/${war.file}" tofile="${tomcat.deploy.dir}/${ant.project.name}.war"/>
</target>
<target name="main" depends="tomcat-stop,maven-build,deploy,tomcat-start">
</target>
<target name="all" depends="main">
</target>
<target name="tomcat-start">
<exec executable="${tomcat.home}/bin/startup.bat">
</exec>
</target>
<target name="tomcat-stop">
<exec executable="${tomcat.home}/bin/shutdown.bat">
</exec>
</target>
<target name="maven-build" depends="svnversion, maven-build-windows, maven-build-unix"/>
<target name="maven-build-windows" if="isWindows">
<exec dir="." executable="cmd" >
<arg line="/c mvn -Dmaven.test.skip=true clean install -pl web -am" />
</exec>
</target>
<target name="maven-build-unix" if="isUnix">
<exec dir="." executable="sh" >
<arg line="-c 'mvn -Dmaven.test.skip=true clean install -pl web -am'" />
</exec>
</target>
<target name="maven-test" depends="maven-test-windows, maven-test-unix"/>
<target name="maven-test-windows" depends="maven-build" if="isWindows">
<exec dir="." executable="cmd" >
<arg line="/c mvn test -fn" />
<!-- <arg line="/c mvn surefire-report:report" /> -->
</exec>
</target>
<target name="maven-test-unix" depends="maven-build" if="isUnix">
<exec dir="." executable="sh" >
<arg line="-c 'mvn test -fn'" />
<!-- <arg line="-c 'mvn surefire-report:report'" /> -->
</exec>
</target>
<target name="deployMapFiles">
<copy todir="${tomcat.deploy.dir}/map_images">
<fileset dir="map_images" />
</copy>
</target>
<target name="svnversion">
<exec executable="svnversion" outputproperty="svnversion" />
<tstamp>
<format property="build.time" pattern="dd/MM/yyyy HH:mm"
unit="hour"/>
</tstamp>
<echo >SVN Version: ${svnversion}
Build timestamp: ${build.time}</echo>
<echo file="web/src/main/webapp/svnversion.txt">${svnversion}
${build.time}</echo>
</target>
<target name="debian-pkg" depends="maven-build">
<exec executable="debian/create-debian-pkg.sh"/>
</target>
</project>