forked from s7nio/bimp-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
168 lines (141 loc) · 5.46 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
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
<?xml version="1.0"?>
<project name="plugins" basedir="." default="all">
<property name="project.dir" value="." />
<property file="build.properties" />
<path id="compile.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<path id="selenium.classpath">
<fileset dir="${test.lib.dir}">
<include name="*.jar" />
</fileset>
<path refid="compile.classpath" />
<pathelement location="${test.classes.dir}" />
</path>
<path id="test.classpath">
<pathelement location="${test.classes.dir}" />
<pathelement location="${test.dir}" />
<path refid="compile.classpath" />
</path>
<path id="tomcat.class.path">
<pathelement location="${tomcat.home}/bin/bootstrap.jar" />
<pathelement location="${tomcat.home}/bin/tomcat-juli.jar" />
</path>
<target name="build" description="Build the system" depends="copy-libs">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${war.classes.dir}" />
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="true" debuglevel="lines,vars,source" encoding="utf-8" compiler="modern" target="1.6" source="1.6">
<classpath refid="compile.classpath" />
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:deprecation" />
</javac>
<copy todir="${war.classes.dir}">
<fileset dir="${build.classes.dir}">
</fileset>
</copy>
<copy file="${src.dir}/log4j.xml" todir="${build.classes.dir}" />
</target>
<target name="war" depends="build">
<mkdir dir="${dist.dir}" />
<zip destfile="${dist.dir}/${app.name}.war" basedir="${war.dir}" update="true" />
<!--<war destfile="${app.name}-${app.version}.war">
<fileset dir="${src.dir}"/>
<fileset dir="${jsp.dir}" prefix="jsp"/>
<lib dir="${lib.dir}"/>
<classes dir="${build.classes.dir}"/>
<zipfileset dir="${gfx.dir}"
prefix="gfx"/>
</war>-->
</target>
<target name="copy-confs">
<copy file="${conf.dir}/server.xml" todir="${app.server.dir}/conf" overwrite="true">
<filterset>
<filter token="WARDIR" value="${war.dir}" />
<filter token="PORT" value="${tomcat.connector.port}" />
</filterset>
</copy>
</target>
<target name="all" depends="stop-tomcat,unzip-tomcat,build,start-tomcat">
</target>
<target name="clean" description="Clean up build system results">
<delete dir="${build.dir}" />
<delete dir="${war.classes.dir}" />
<delete dir="${lib.war.dir}" />
</target>
<target name="copy-libs">
<mkdir dir="${lib.war.dir}"/>
<copy todir="${lib.war.dir}">
<fileset dir="${lib.dir}">
<exclude name="servlet-api.jar"/>
</fileset>
</copy>
</target>
<target name="start-tomcat" depends="copy-confs">
<java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true" classpathref="tomcat.class.path">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<jvmarg value="-Dcatalina.base=${tomcat.home}" />
<jvmarg value="-Djava.endorsed.dirs=${tomcat.home}/endorsed" />
<arg line="start" />
</java>
</target>
<target name="start-tomcat-jpda" depends="copy-confs">
<java classname="org.apache.catalina.startup.Bootstrap" fork="true" spawn="true" classpathref="tomcat.class.path">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<jvmarg value="-Dcatalina.base=${tomcat.home}" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
<arg line="start" />
</java>
</target>
<!-- ############### TESTS ###############-->
<target name="compile-test">
<mkdir dir="${test.dir}" />
<mkdir dir="${test.classes.dir}" />
<javac srcdir="${test.dir}" destdir="${test.classes.dir}" debug="true" debuglevel="lines,vars,source" encoding="utf-8" compiler="modern">
<classpath refid="test.classpath" />
</javac>
</target>
<target name="compile-selenium">
<mkdir dir="${test.dir}" />
<mkdir dir="${test.classes.dir}" />
<javac srcdir="${test.dir}" destdir="${test.classes.dir}" debug="true" debuglevel="lines,vars,source" encoding="utf-8" compiler="modern">
<classpath refid="selenium.classpath" />
</javac>
</target>
<target name="selenium" depends="compile-selenium">
<java classname="ee.ut.math.selenium.SeleniumMain" fork="true" spawn="false" classpathref="selenium.classpath">
</java>
</target>
<target name="test" depends="compile-test">
<junit>
<classpath refid="test.classpath" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.classes.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<!-- ############# END TESTS #############-->
<target name="stop-tomcat" depends="tomcat-check-status" if="tomcat.started">
<java classname="org.apache.catalina.startup.Bootstrap" fork="true" classpathref="tomcat.class.path">
<jvmarg value="-Dcatalina.home=${tomcat.home}" />
<arg line="stop" />
</java>
<sleep seconds="5" />
</target>
<target name="tomcat-check-status">
<condition property="tomcat.started">
<socket server="localhost" port="${tomcat.connector.port}" />
</condition>
</target>
<target name="restart-tomcat">
<antcall target="stop-tomcat" inheritall="false" />
<antcall target="start-tomcat" inheritall="false" />
</target>
<target name="unzip-tomcat">
<unzip src="${workspace.bimps.dir}/${tomcat.archive}" dest="${app.server.home.dir}" overwrite="false" />
</target>
</project>