GitLab will be upgraded on 30 Jan 2023 from 2.00 pm (AEDT) to 3.00 pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

build.xml 12 KB
Newer Older
1
2
<project name="daytrader" default="all" basedir="../..">
    <description>daytrader application, required by tradebeans and tradesoap</description>
3
4
5
    <property file="ant/dacapo.properties"/>
    
    <property name="lib-name" value="daytrader"/>
6

7
8
9
10
    <property name="lib-svn-url" value="http://svn.apache.org/repos/asf/geronimo/daytrader/trunk"/>
    <property name="lib-svn-revision" value="767347"/>
    <property name="lib-version" value="svn-${lib-svn-revision}"/>
    <property name="lib-src" value="daytrader-${lib-version}-src.tar.gz"/>
11
12

    <property name="ger-version" value="2.1.4"/>
13
    <property name="ger-name" value="geronimo-jetty6-minimal"/>
14
    <property name="ger-url" value="${apache.dl.url}/geronimo/${ger-version}"/>
15
    <property name="ger-bin" value="${ger-name}-${ger-version}-bin.tar.gz"/>
16

17
18
19
20
21
22
    <property name="ger-plugins-url" value="http://svn.apache.org/repos/asf/geronimo/server/tags/${ger-version}/plugins"/>
    <property name="ger-plugins-revision" value="794961"/>
    <property name="ger-plugins-bin" value="${ger-name}-${ger-version}-plugins.tar.gz"/>

    <property name="ger-svn-repo-url" value="http://svn.apache.org/repos/asf/geronimo/server/branches/2.1/repository"/>
    
23
24
25
    <property name="amq-version" value="4.1.2-G20090207"/>
    <property name="amq-name" value="activemq-core"/>
    <property name="amq-url" value="${ger-svn-repo-url}/org/apache/activemq/activemq-core/4.1.2-G20090207/"/>
26
27
    <property name="amq-jar" value="${amq-name}-${amq-version}.jar"/>
    
28
29
30
31
    <property name="tomcat-version" value="6.0.18-G678601"/>
    <property name="tomcat-name" value="tomcat"/>
    <property name="tomcat-version-name" value="catalina"/>
    <property name="tomcat-url" value="${ger-svn-repo-url}/org/apache/${tomcat-name}/${tomcat-version-name}/${tomcat-version}/"/>
32
33
    <property name="tomcat-jar" value="${tomcat-version-name}-${tomcat-version}.jar"/>
    
34
35
36
    <property name="jasper-version" value="6.0.18-G678601"/>
    <property name="jasper-name" value="jasper"/>
    <property name="jasper-url" value="${ger-svn-repo-url}/org/apache/tomcat/${jasper-name}/${jasper-version}/"/>
37
38
    <property name="jasper-jar" value="${jasper-name}-${jasper-version}.jar"/>
    
39
40
41
    <property name="jasper-el-version" value="6.0.18-G678601"/>
    <property name="jasper-el-name" value="jasper-el"/>
    <property name="jasper-el-url" value="${ger-svn-repo-url}/org/apache/tomcat/${jasper-el-name}/${jasper-el-version}/"/>
42
43
44
    <property name="jasper-el-jar" value="${jasper-el-name}-${jasper-el-version}.jar"/>
    
    <import file="../common.xml"/>
45

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    <property name="dt-build" location="${lib-build-dir}/daytrader"/>
    <property name="launcher-build" location="${lib-build-dir}/launcher"/>
    <property name="ger-home" location="${lib-build-dir}/${ger-name}-${ger-version}"/>
    <property name="ger-cli-jar" value="${ger-home}/lib/geronimo-cli-${ger-version}.jar"/>
    <property name="ger-kernel-jar" value="${ger-home}/lib/geronimo-kernel-${ger-version}.jar"/>
    
    <condition property="shell-exe" value="cmd.exe">
        <os family="windows"/>
    </condition>
    <property name="shell-exe" value="sh"/>
    <condition property="gsh-exe" value="gsh.bat">
        <os family="windows"/>
    </condition>
    <property name="gsh-exe" value="gsh"/>
    <condition property="mvn-exe" value="mvn.bat">
        <os family="windows"/>
    </condition>
    <property name="mvn-exe" value="mvn"/>
    
65
    <target name="url-source" if="ger-url">
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
        <antcall target="check-source">
            <param name="target-dir" value="${lib-downloads}"/>
            <param name="target-url" value="${ger-url}"/>
            <param name="target-file" value="${ger-bin}"/>
        </antcall>
        <antcall target="check-svn-source">
            <param name="svn-url" value="${ger-plugins-url}"/>
            <param name="svn-revision" value="${ger-plugins-revision}"/>
            <param name="target-file" value="${ger-plugins-bin}"/>
            <param name="target-dir" value="${lib-downloads}"/>
        </antcall>
        <antcall target="check-source">
            <param name="target-dir" value="${lib-downloads}"/>
            <param name="target-url" value="${amq-url}"/>
            <param name="target-file" value="${amq-jar}"/>
        </antcall>
82
    </target>
83
84
85
86
87
88
89
    
    <target name="unpack">
        <untar src="${lib-downloads}/${ger-bin}" dest="${lib-build-dir}" compression="gzip"/>
        <untar src="${lib-downloads}/${ger-plugins-bin}" dest="${lib-build-dir}/plugins" compression="gzip"/>
        <patch patchfile="libs/${lib-name}/geronimo-quiet-log.patch" dir="${lib-build-dir}" strip="0" ignorewhitespace="yes"/>
        <chmod dir="${ger-home}/bin" includes="**" perm="u+x"/>
        <mkdir dir="${dt-build}"/>
90
        <untar src="${lib-downloads}/${lib-src}" dest="${dt-build}/" compression="gzip"/>
91
92
93
94
95
96
97
98
        <copy file="${lib-data}/stocks.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
        <copy file="${lib-data}/users.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
        <copy file="${lib-data}/workload.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
        <patch patchfile="libs/${lib-name}/${lib-name}.patch" dir="${dt-build}" strip="0" ignorewhitespace="yes"/>
    </target>
    
    <target name="jar" depends="build">
        <jar destfile="${lib-jars}/${lib-name}.jar">
99
            <fileset dir="${launcher-build}">
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
                <include name="**/*.class"/>
            </fileset>
        </jar>
    </target>
    
    <target name="build" depends="build.init,data"> 
        <mkdir dir="${launcher-build}/"/>
        <javac srcdir="${lib-src-dir}" destdir="${launcher-build}" classpath="${ger-cli-jar}:${ger-kernel-jar}" debug="true" debuglevel="lines,vars,source"/>
    </target>
    
    <target name="build.init">
        <property name="mvn-home" location="${toolsdir}/apache-maven-${mvn.version}/bin"/>
        <property name="mvn" location="${mvn-home}/${mvn-exe}"/>
    </target>
   
    <target name="data" depends="build.init">
        <!-- build required plugins -->
        <exec executable="${mvn}" dir="${lib-build-dir}/plugins/j2ee" failonerror="yes" failifexecutionfails="yes"/>
        <exec executable="${mvn}" dir="${lib-build-dir}/plugins/client" failonerror="yes" failifexecutionfails="yes"/>
        <exec executable="${mvn}" dir="${lib-build-dir}/plugins/cxf" failonerror="yes" failifexecutionfails="yes"/>
        <exec executable="${mvn}" dir="${lib-build-dir}/plugins/axis" failonerror="yes" failifexecutionfails="yes"/>

        <!-- install activemq -->
123
        <property name="amq-jar-loc" location="${lib-downloads}/${amq-jar}"/>
124
        <exec executable="${mvn}" dir="${dt-build}" failonerror="yes" failifexecutionfails="yes">
125
126
127
128
129
            <arg value="install:install-file"/>
            <arg value="-DgroupId=org.apache.activemq"/>
            <arg value="-DartifactId=activemq-core"/>
            <arg value="-Dversion=${amq-version}"/>
            <arg value="-Dpackaging=jar"/>
130
            <arg value="-Dfile=${amq-jar-loc}"/>
131
132
         </exec>

133
134
135
136
137
138
139
        <!-- build daytrader -->
        <exec executable="${mvn}" dir="${dt-build}">
            <env key="GERONIMO_HOME" value="${ger-home}"/>
            <!-- <env key="PATH" path="${env.PATH}:${mvn-home}"/> -->
            <env key="JAVA_HOME" path="${java.home}"/>
            <env key="MAVEN_OPTS" value="-Xms256m -Xmx512m"/>
            <arg value="clean"/>
140
            <arg value="install"/>
141
        </exec>
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
202
203
204
205
206
        
        <!-- deploy daytrader to geronimo -->
        <antcall target="start-geronimo"/>
        
        <antcall target="undeploy">
            <param name="deploy-subject" value="unavailable-client-deployer"/>
        </antcall>
        <antcall target="undeploy">
            <param name="deploy-subject" value="unavailable-ejb-deployer"/>
        </antcall>
        <antcall target="undeploy">
            <param name="deploy-subject" value="unavailable-webservices-deployer"/>
        </antcall>

        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/client/client/target/client-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/client/client-deployer/target/client-deployer-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/client/client-security/target/client-security-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/cxf/cxf/target/cxf-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/cxf/cxf-deployer/target/cxf-deployer-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/cxf/cxf-ejb/target/cxf-ejb-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/cxf/cxf-ejb-deployer/target/cxf-ejb-deployer-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/axis/axis/target/axis-${ger-version}.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${lib-build-dir}/plugins/j2ee/jsr88-jar-configurer/target/jsr88-jar-configurer-${ger-version}.car"/>
        </antcall>

        <!-- daytrader -->
        <antcall target="deploy">
            <param name="deploy-subject" value="${dt-build}/daytrader-derby-datasource/target/daytrader-derby-datasource-2.2-SNAPSHOT.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${dt-build}/daytrader-jetty/target/daytrader-jetty-2.2-SNAPSHOT.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${dt-build}/daytrader-jetty/target/daytrader-dacapo-2.2-SNAPSHOT.car"/>
        </antcall>
        <antcall target="deploy">
            <param name="deploy-subject" value="${dt-build}/daytrader-jetty/target/daytrader-ws-client-2.2-SNAPSHOT.car"/>
        </antcall>
        <antcall target="stop-geronimo"/>
        
        <!-- package the resulting geronimo install as a zip -->
        <zip destfile="${lib-dat}/${lib-name}.zip">
            <fileset dir="${lib-build-dir}" includes="${ger-name}-${ger-version}/**"/>
        </zip>
    </target>
    
    <target name="start-geronimo">
        <echo message="${ger-home}/bin/${gsh-exe}"/>
207
        <exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="true">
208
209
210
            <env key="GERONIMO_HOME" path="${ger-home}"/>
               <arg value="-c"/>
               <arg value="geronimo/start-server"/>
211
        </exec>
212
213
214
215
216
217
218
219
        <echo message="Waiting for geronimo startup..."/>
        <waitfor maxwait="2" maxwaitunit="minute" checkevery="1000">
                <http url="http://localhost:8080/console/login.jsp"/>
        </waitfor>
        <echo message="Established connection..."/>
        <sleep seconds="1"/>
    </target>
    <target name="stop-geronimo">
220
        <exec executable="${ger-home}/bin/${gsh-exe}" dir="${ger-home}" spawn="false">
221
222
223
            <env key="GERONIMO_HOME" path="${ger-home}"/>
               <arg value="-c"/>
               <arg value="geronimo/stop-server -u system -w manager"/>
224
        </exec>
225
226
    </target>
    <target name="deploy">
227
        <exec executable="${ger-home}/bin/${gsh-exe}">
228
229
230
             <env key="GERONIMO_HOME" path="${ger-home}"/>
               <arg value="-c"/>
               <arg value="deploy/install-plugin -u system -w manager ${deploy-subject}"/>
231
        </exec>
232
233
234
235
236
237
238
239
    </target>
    <target name="undeploy">
        <exec executable="${ger-home}/bin/${gsh-exe}">
             <env key="GERONIMO_HOME" path="${ger-home}"/>
               <arg value="-c"/>
               <arg value="deploy/undeploy -u system -w manager ${deploy-subject}"/>
        </exec>
    </target>
240
</project>