This repository has been archived by the owner on Apr 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
134 lines (106 loc) · 4.24 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
<project name="ATPPortal" default="build">
<property file="build.properties" />
<property name="build.dir" value="build" />
<path id="classpath">
<pathelement location="${build.dir}/web/WEB-INF/classes" />
<pathelement location="${build.dir}/test" />
<fileset dir="${additional.classpath}">
<include name="*.jar" />
</fileset>
<fileset dir="lib/">
<include name="**.jar" />
</fileset>
<fileset dir="${build.dir}/web/WEB-INF/lib/">
<include name="**.jar" />
</fileset>
</path>
<target name="clean">
<delete dir="${build.dir}" failonerror="true" />
</target>
<target name="init">
<!-- temp folders for the several jars -->
<mkdir dir="${build.dir}/infra" />
<mkdir dir="${build.dir}/model" />
<mkdir dir="${build.dir}/test" />
<!-- the web folder contains the final web app -->
<mkdir dir="${build.dir}/web" />
<mkdir dir="${build.dir}/web/WEB-INF" />
<mkdir dir="${build.dir}/web/WEB-INF/classes" />
<mkdir dir="${build.dir}/web/WEB-INF/lib" />
<mkdir dir="${build.dir}/web/views" />
</target>
<target name="compile-infra" depends="init" description="Compiles the model">
<javac debug="${javac.debug}" target="${compile.target}"
classpathref="classpath" srcdir="src/infra/" destdir="${build.dir}/infra" />
<jar basedir="${build.dir}/infra" destfile="${build.dir}/web/WEB-INF/lib/${deploy.name}-infra.jar" />
</target>
<target name="compile-model" depends="init" description="Compiles the model">
<javac debug="${javac.debug}" target="${compile.target}"
classpathref="classpath" srcdir="src/model" destdir="${build.dir}/model" />
<copy todir="${build.dir}/model">
<fileset dir="src/model">
<include name="**.properties" />
</fileset>
</copy>
<copy todir="${build.dir}/model/META-INF">
<fileset dir="src/model/META-INF">
<include name="**" />
</fileset>
</copy>
<jar basedir="${build.dir}/model" destfile="${build.dir}/web/WEB-INF/lib/${deploy.name}-model.jar" />
</target>
<target name="compile" depends="init, compile-model" description="Compiles the infra, model and servlet srcdirs to the build dir">
<javac debug="${javac.debug}" target="${compile.target}" classpathref="classpath" srcdir="src/servlets" destdir="${build.dir}/web/WEB-INF/classes" />
<javac debug="${javac.debug}" target="${compile.target}" classpathref="classpath" srcdir="src/tags" destdir="${build.dir}/web/WEB-INF/classes" />
<copy todir="${build.dir}/web/WEB-INF/classes">
<fileset dir="src/views">
<include name="**.properties" />
</fileset>
</copy>
</target>
<target name="build" depends="compile" description="Copy all folders to the build folder and war it up">
<copy todir="${build.dir}/web/WEB-INF">
<fileset dir=".">
<include name="*.tld" />
</fileset>
</copy>
<copy todir="${build.dir}/web/">
<fileset dir="public_html/" />
</copy>
<copy todir="${build.dir}/web/WEB-INF/lib">
<fileset dir="lib" />
</copy>
<mkdir dir="${build.dir}/web/views" />
<copy todir="${build.dir}/web/views">
<fileset dir="src/views" />
</copy>
<war destfile="atpportal.war" webxml="web.xml" basedir="${build.dir}/web" />
</target>
<target name="test" depends="build" description="Run the tests in test/">
<javac debug="${javac.debug}" target="${compile.target}" destdir="${build.dir}/test" srcdir="src/test/" classpathref="classpath"/>
<copy todir="${build.dir}/test">
<fileset dir="src/test">
<include name="**.properties" />
</fileset>
</copy>
<junit haltonfailure="true">
<classpath>
<path refid="classpath" />
</classpath>
<!-- Send a brief output to the console and a xml dump to a textfile -->
<formatter type="plain" usefile="false" />
<formatter type="xml" usefile="true" />
<!--<batchtest fork="yes" todir=".">
<fileset dir="src/test">
<include name="**/*Test*.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>-->
<test name="org.tptp.AllTests" />
</junit>
</target>
<target name="deploy" depends="clean, build" description="Copies the war archive to a tomcat webapp folder">
<delete dir="${deploy.path}/${deploy.name}" />
<copy todir="${deploy.path}" file="atpportal.war" />
</target>
</project>