-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
executable file
·193 lines (164 loc) · 7.68 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id: build.xml,v 1.3 2018/01/18 18:19:26 mem61 Exp $
-->
<project basedir="." default="all" name="Project Management Cell">
<property name="Project" value="edu.harvard.i2b2.pm" />
<property file="etc/spring/pm_application_directory.properties"/>
<!-- ========== Executable Targets ======================================== -->
<property name="Name" value="ProjectManagement" />
<import file="../edu.harvard.i2b2.server-common/common_build.xml" />
<!-- =================================================================== -->
<!-- INIT -->
<!-- =================================================================== -->
<target name="init" depends="common_init,common-classpath" description="Prepare for build">
<path id="classpath">
<path refid="common-classpath" />
<pathelement location="${classes}" />
<pathelement location="lib/jcifs-1.3.3.jar" />
<pathelement location="lib/servlet-api.jar" />
<pathelement location="../${i2b2CommonProject}/dist/i2b2Common-core.jar" />
<pathelement location="../${i2b2CommonProject}/lib/smbj-0.9.1.jar" />
</path>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath refid="classpath" />
</taskdef>
</target>
<!-- =================================================================== -->
<!-- CLEAN -->
<!-- =================================================================== -->
<target name="clean" depends="common_clean" description="Clean all build products" />
<!-- =================================================================== -->
<!-- COMMON JAXB GENERATION -->
<!-- =================================================================== -->
<target name="jaxb_gen" depends="init" description="Generate JAXB classes for i2b2 and Vocab Data messages">
<!-- <exec executable="xjc">
<arg value="-d"/>
<arg value="${gensrc}"/>
<arg value="../${i2b2xmlproject}/xsd/cell/pm_1.1/PM_USER.xsd"/>
<arg value="../${i2b2xmlproject}/xsd/hive/msg_1.1/i2b2_response.xsd"/>
<arg value="../${i2b2xmlproject}/xsd/cell/pm_1.1/i2b2_version_msg.xsd"/>
<arg value="-b"/>
<arg value="./etc/xsd_1.1/i2b2_pm_bindings.xjb"/>
<arg value="-b"/>
<arg value="./etc/xsd_1.1/i2b2_response_message_bindings.xjb"/>
<arg value="-b"/>
<arg value="./etc/xsd_1.1/i2b2_version_bindings.xjb"/>
</exec>
--> <xjc destdir="${gensrc}" removeOldOutput="no">
<schema dir="../${i2b2xmlproject}/xsd/cell/pm_1.1" includes="PM_USER.xsd" />
<schema dir="../${i2b2xmlproject}/xsd/hive/msg_1.1" includes="i2b2_response.xsd" />
<schema dir="../${i2b2xmlproject}/xsd/cell/pm_1.1" includes="i2b2_version_msg.xsd" />
<binding dir="." includes="etc/xsd_1.1/i2b2_pm_bindings.xjb" />
<binding dir="." includes="etc/xsd_1.1/i2b2_response_message_bindings.xjb" />
<binding dir="." includes="etc/xsd_1.1/i2b2_version_bindings.xjb" />
</xjc>
</target>
<!-- =================================================================== -->
<!-- COMPILE -->
<!-- =================================================================== -->
<target name="compile" depends="init,jaxb_gen" description="Compile files without cleaning">
<mkdir dir="${classes}" />
<javac destdir="${classes}" optimize="${javac.opt}" debug="true">
<src path="${src}" />
<src path="${gensrc}" />
<src path="test" />
<classpath refid="classpath" />
</javac>
</target>
<!-- =================================================================== -->
<!-- DIST -->
<!-- =================================================================== -->
<target name="dist" description="package application for distribution/deployment">
<echo message="${Name}: Creating the archive package!" />
<antcall target="axis2aar" />
<antcall target="jar_core" />
</target>
<!-- Axis2 archive file -->
<target name="axis2aar" depends="compile" description="Create Axis2 archive file">
<jar compress="true" jarfile="${dist}/${Name}.aar">
<fileset dir="${classes}">
<include name="**/**" />
<exclude name="**/datavo/**" />
</fileset>
<zipfileset dir="${etc}/axis2/" prefix="META-INF" includes="services.xml" />
<!-- <zipfileset dir="../${i2b2CommonProject}/dist/" prefix="lib" includes="*.jar"/> -->
</jar>
</target>
<!-- Jar core file -->
<target name="jar_core" depends="compile" description="Create Work core jar">
<jar compress="true" jarfile="${dist}/${Name}-core.jar">
<fileset dir="${classes}">
<include name="**/datavo/**" />
</fileset>
<!-- <zipfileset dir="${etc}/axis2/" prefix="META-INF" includes="services.xml" /> -->
</jar>
</target>
<!-- =================================================================== -->
<!-- SERVER DIST -->
<!-- =================================================================== -->
<target name="dist-server" description="package application for distribution/deployment">
<echo message="${Name}: Creating the server archive package!" />
<jar compress="true" jarfile="${dist}/${Name}-Server.jar">
</jar>
</target>
<!-- =================================================================== -->
<!-- ALL -->
<!-- =================================================================== -->
<target name="all" depends="dist">
</target>
<!-- =================================================================== -->
<!-- JBOSS DEPLOY -->
<!-- =================================================================== -->
<target name="deploy" description="Deployment step:copy distribution jar files to app server">
<echo message="${Name}: Copying archive package to app server ${jboss.home}" />
<copy todir="${jboss.home}/standalone/deployments/${axis2.war.name}/WEB-INF/lib">
<fileset dir="${dist}">
<exclude name="**/**.aar" />
<exclude name="**/*client.jar"/>
</fileset>
</copy>
<copy todir="${jboss.home}/standalone/deployments">
<fileset dir="${etc}/jboss">
<!-- <exclude name="**/jboss.xml" /> -->
</fileset>
</copy>
<copy todir="${jboss.home}/standalone/deployments/${axis2.war.name}/WEB-INF/services">
<fileset dir="${dist}">
<include name="**/**.aar" />
</fileset>
</copy>
</target>
<!-- =================================================================== -->
<!-- RUN JUNIT TESTS AND GENERATE REPORT -->
<!-- =================================================================== -->
<target name="test" depends="compile" description="Compile and run JUnit tests and testcases">
<echo message="${Name}: Running test cases!" />
<property name="reports.dir" value="${report}" />
<!-- run the unit tests -->
<junit fork="yes" haltonfailure="no" maxmemory="512M" printsummary="on" errorProperty="test.failed" failureProperty="test.failed" showoutput="false">
<formatter type="xml" />
<jvmarg value="-Dtestfiledir=${testfiledir}" />
<jvmarg value="-Djava.endorsed.dirs=endorsed_lib" />
<jvmarg value="-Dtesthost=${testhost}" />
<!--<test name="AllTests" todir="${report.dir}"/>-->
<batchtest fork="yes" todir="${reports.dir}">
<fileset dir="test">
<include name="**/PMServiceRESTTest.java" />
</fileset>
</batchtest>
<classpath>
<path refid="classpath" />
</classpath>
</junit>
<!-- create the junit test report -->
<echo message="${Name}: Generating reports!" />
<junitreport>
<fileset dir="${reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.dir}" />
</junitreport>
<fail message="Tests failed." if="test.failed" />
</target>
</project>