-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
201 lines (156 loc) · 7.38 KB
/
build.xml
File metadata and controls
201 lines (156 loc) · 7.38 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0"?>
<project name="Oss" default="war" basedir=".">
<description>"Oss Webservice Infrastructure"</description>
<!-- The directories -->
<property name="root-dir" value="/home/cjm/eclipse-workspace/oss" />
<property name="class-dir" value="${root-dir}/WEB-INF/bin" />
<property name="lib-dir" value="${root-dir}/WEB-INF/lib" />
<property name="deploy-dir" value="/home/dev/bin/javalib"/>
<property name="third-party-lib-dir" value="/home/dev/bin/javalib_third_party" />
<property name="ngat-oss-client-root" value="/home/cjm/eclipse-workspace/oss_client" />
<!-- new directory, in order for ant build to access the servlet-api jar -->
<!-- Removed cjm 04/10/2017 as we don't have /usr/local/tomcat installed on ltobs9
<property name="catalina-home" value="/usr/local/tomcat/" />
-->
<!-- other definitions -->
<property name="war-name" value="ngat_new_oss"/>
<property name="jar-name" value="ngat_new_oss"/>
<!-- Cleanup -->
<target name="clean" description="Clean out dross">
<delete verbose="true">
<fileset dir="." includes="**/*~" defaultexcludes="false" />
</delete>
</target>
<!-- Prepare build directories -->
<target name="prepare" description="Prepare build directories">
<echo message="Building: Oss Webservice Infrastructure"/>
<tstamp>
<format property="BUILD" pattern="yyyyMMdd_HHmm" locale="en" />
</tstamp>
<echo message="Build date: ${BUILD}" />
<!-- build the sub project jars -->
<!-- build phase2 objects jar-->
<echo message="building sub project target ngat_new_phase2.jar"/>
<subant target="jar" buildpath="/home/cjm/eclipse-workspace/phase2/java/build.xml"/>
<!-- copy phase2 objects jar to lib dir of this application-->
<echo message="copying ${deploy-dir}/ngat_new_phase2.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_new_phase2.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy phase2 objects jar to lib dir of oss client application-->
<echo message="copying ${deploy-dir}/ngat_new_phase2.jar to ${ngat-oss-client-root}/lib"/>
<copy file="${deploy-dir}/ngat_new_phase2.jar" todir="${ngat-oss-client-root}/lib" overwrite="true"/>
<!-- build oss client jar-->
<echo message="building sub project target ngat_new_oss_client.jar"/>
<subant target="jar" buildpath="/home/cjm/eclipse-workspace/oss_client/build.xml"/>
<!-- copy oss client jar to lib dir of this application-->
<echo message="copying ${deploy-dir}/ngat_new_oss_client.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_new_oss_client.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy astrometry jar into lib directory of this application -->
<echo message="copying ${deploy-dir}/ngat_astrometry.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_astrometry.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy sms jar into lib directory of this application -->
<echo message="copying ${deploy-dir}/ngat_sms.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_sms.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy tcm jar into lib directory of this application (3/6/14) -->
<echo message="copying ${deploy-dir}/ngat_new_tcm.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_new_tcm.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy new icm jar into lib directory of this application -->
<echo message="copying ${deploy-dir}/ngat_new_icm.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_new_icm.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy third party jars into lib directory of this application -->
<echo message="copying ${third-party-lib-dir}/jibx/jibx libraries to ${lib-dir}"/>
<copy file="${third-party-lib-dir}/jibx/jibx-extras.jar" todir="${lib-dir}" overwrite="true"/>
<copy file="${third-party-lib-dir}/jibx/jibx-run.jar" todir="${lib-dir}" overwrite="true"/>
<copy file="${third-party-lib-dir}/jibx/xpp3.jar" todir="${lib-dir}" overwrite="true"/>
<echo message="copying ${deploy-dir}/jibx-soap.jar to ${lib-dir}"/>
<copy file="${third-party-lib-dir}/jibx_soap/jibx-soap.jar" todir="${lib-dir}" overwrite="true"/>
<echo message="copying ${deploy-dir}/log4j-1.2.13.jar to ${lib-dir}"/>
<copy file="${third-party-lib-dir}/log4j-1.2.13.jar" todir="${lib-dir}" overwrite="true"/>
<!-- copy in house jars into lib directory of this application -->
<echo message="copying ${deploy-dir}/ngat_util.jar to ${lib-dir}"/>
<copy file="${deploy-dir}/ngat_util.jar" todir="${lib-dir}" overwrite="true"/>
</target>
<!-- Compile all sources -->
<target name="javac" depends="prepare" description="Compile sources">
<!-- pre, 19/8/13 was this: -->
<!--
<javac srcdir="."
destdir="${class-dir}"
debug="on">
-->
<!---
//commented out on 14/5/14 - trying to use more recent java versions
<javac srcdir="."
destdir="${class-dir}"
debug="on"
source="1.5"
target="1.5"
includeantruntime="false"
bootclasspath="/usr/java/jdk1.5.0_15/jre/lib/rt.jar">
-->
<!-- rolling back to java 1.5
<javac srcdir="."
destdir="${class-dir}"
debug="on">
-->
<javac srcdir="."
destdir="${class-dir}"
debug="on"
source="1.5"
target="1.5">
<classpath>
<pathelement path="${classpath}" />
<fileset dir="${lib-dir}">
<include name="*.jar" />
<exclude name="${jar-name}.jar" />
</fileset>
<!--- added to path to allow build to compile against servlet-api (this is now used for some context watching) -->
<fileset dir="${third-party-lib-dir}/tomcat_lib">
<include name="servlet-api.jar" />
</fileset>
</classpath>
</javac>
</target>
<!-- Generate RMI stubs and skeletons -->
<target name="rmic" depends="javac" description="Generate RMI stubs">
<rmic debug="true" base="${class-dir}"
includes=
"ngat/oss/impl/mysql/model/AccessModel.class,
ngat/oss/impl/mysql/model/AccountModel.class,
ngat/oss/impl/mysql/model/HistoryModel.class,
ngat/oss/impl/mysql/model/LockingModel.class,
ngat/oss/impl/mysql/model/Phase2Model.class"
stubversion="1.2">
<classpath>
<pathelement path="${classpath}" />
<fileset dir="${lib-dir}">
<include name="*.jar" />
</fileset>
</classpath>
</rmic>
</target>
<!-- Deploy to JAR with Jibx bindings and rmi stubs included -->
<target name="jar" depends="rmic" description="Create JAR">
<delete file="${deploy-dir}/${jar-name}.jar" quiet="true"/>
<echo message="Build number: ${BUILD}" />
<echo message="Creating ${deploy-dir}/${jar-name}.jar" />
<!-- create jar file in javalib dir -->
<jar jarfile="${deploy-dir}/${jar-name}.jar" basedir="${class-dir}" update="false" />
<!-- deploy jar to sub-project ngat_oss_client lib dir -->
<copy file="${deploy-dir}/${jar-name}.jar" todir="${ngat-oss-client-root}/lib"/>
<!-- copy jar to local lib dir (so it's included in the .war) -->
<copy file="${deploy-dir}/${jar-name}.jar" todir="${lib-dir}"/>
</target>
<!-- Build the war file for distribution -->
<target name="war" depends="jar">
<!-- delete the old .war file -->
<delete file="${deploy-dir}/${war-name}.war" quiet="true"/>
<!-- create the .war file -->
<jar destfile="${deploy-dir}/${war-name}.war" basedir="${root-dir}" update="false">
<exclude name="*.nfs*" />
</jar>
<!-- deploy it to local webserver -->
<!-- Removed cjm 04/10/2017 as we don't have /usr/local/tomcat installed on ltobs9
<copy file="${deploy-dir}/${war-name}.war" todir="${catalina-home}/webapps/"/>
-->
</target>
</project>