| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <!DOCTYPE project [ | |
| <!-- | |
| Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. | |
| This program and the accompanying materials are made available under the | |
| terms of the Eclipse Public License v. 2.0, which is available at | |
| http://www.eclipse.org/legal/epl-2.0. | |
| This Source Code may also be made available under the following Secondary | |
| Licenses when the conditions for such availability set forth in the | |
| Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | |
| version 2 with the GNU Classpath Exception, which is available at | |
| https://www.gnu.org/software/classpath/license.html. | |
| SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | |
| --> | |
| <!ENTITY commonSetup SYSTEM "file:./../../../../config/properties.xml"> | |
| <!ENTITY commonBuild SYSTEM "file:./../../../../config/common.xml"> | |
| <!ENTITY testproperties SYSTEM "file:./build.properties"> | |
| <!ENTITY run SYSTEM "file:./../../../../config/run.xml"> | |
| ]> | |
| <project name="enroller" default="usage" basedir="."> | |
| &commonSetup; | |
| &commonBuild; | |
| &testproperties; | |
| &run; | |
| <target name="all"> | |
| <antcall target="setup"/> | |
| <antcall target="build-single-appclientjar"/> | |
| <antcall target="deploy"/> | |
| <antcall target="run-single-appclient-jar"/> | |
| <antcall target="undeploy"/> | |
| <antcall target="unsetup"/> | |
| <antcall target="setup"/> | |
| <antcall target="build-multi-appclientjar"/> | |
| <antcall target="deploy"/> | |
| <antcall target="run-multi-appclient-jar1"/> | |
| <antcall target="run-multi-appclient-jar2"/> | |
| <antcall target="undeploy"/> | |
| <antcall target="unsetup"/> | |
| </target> | |
| <target name="clean" depends="init-common"> | |
| <antcall target="clean-common"/> | |
| </target> | |
| <target name="compile" depends="clean"> | |
| <antcall target="compile-common"> | |
| <param name="src" value="ejb"/> | |
| </antcall> | |
| <antcall target="compile-common"> | |
| <param name="src" value="client"/> | |
| </antcall> | |
| </target> | |
| <target name="build-single-appclientjar" depends="compile"> | |
| <antcall target="build-ear-common"> | |
| <param name="ejbjar.classes" | |
| value="**/*Student*.class,**/*Enroller*.class,**/*Course*.class" /> | |
| <param name="appclientjar.classes" | |
| value="**/Course.class,**/Enroller.class,**/Student.class,**/*Home*.class,**/*Client*.class" /> | |
| </antcall> | |
| </target> | |
| <target name="build-multi-appclientjar" depends="compile"> | |
| <antcall target="package-appclientjar"> | |
| <param name="appclientjar.files" | |
| value="${build.classes.dir}"/> | |
| <param name="appclient.jar" | |
| value="${assemble.dir}/${appname}-client1.jar"/> | |
| </antcall> | |
| <antcall target="build-ear-common"> | |
| <param name="ejbjar.classes" | |
| value="**/*Student*.class,**/*Enroller*.class,**/*Course*.class" /> | |
| <param name="appclientjar.classes" | |
| value="**/Course.class,**/Enroller.class,**/Student.class,**/*Home*.class,**/*Client*.class" /> | |
| <param name="application.xml" | |
| value="./application.xml"/> | |
| </antcall> | |
| </target> | |
| <target name="package-appclientjar" depends="init-common"> | |
| <delete file="${appclient.jar}"/> | |
| <echo message="common.xml: Generating appclient-jar inside build directory" | |
| level="verbose"/> | |
| <mkdir dir="${assemble.dir}"/> | |
| <mkdir dir="${build.classes.dir}/META-INF"/> | |
| <copy file="${application-client.xml}" tofile="${build.classes.dir}/META-INF/application-client.xml"/> | |
| <copy file="${sun-application-client.xml}" tofile="${build.classes.dir}/META-INF/sun-application-client.xml"/> | |
| <jar jarfile="${appclient.jar}" basedir="${appclientjar.files}" | |
| update="true" includes ="${appclientjar.classes}" | |
| manifest="./MANIFEST.MF"> | |
| <metainf dir="${build.classes.dir}/META-INF"> | |
| <include name="application-client.xml"/> | |
| <include name="sun-application-client.xml"/> | |
| </metainf> | |
| </jar> | |
| </target> | |
| <target name="setup" depends="init-common"> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/create_pointbase.sql"/> | |
| </antcall> | |
| <antcall target="deploy-jdbc-common"> | |
| <param name="jdbc.conpool.name" value="bmpEnrollerPool"/> | |
| <param name="jdbc.resource.name" value="jdbc/bmp-enrollerDB"/> | |
| </antcall> | |
| <antcall target="reconfig-common"/> | |
| </target> | |
| <target name="deploy" depends="init-common"> | |
| <echo message="Deploying via asadmin..."/> | |
| <antcall target="deploy-common"/> | |
| </target> | |
| <target name="run-single-appclient-jar" depends="init-common"> | |
| <echo message="Running app client with no -mainclass option for app with single app client jar"/> | |
| <exec executable="${APPCLIENT}" failonerror="true"> | |
| <arg line="-client ${assemble.dir}/${appname}AppClient.jar"/> | |
| <arg line="-textauth"/> | |
| <arg line="-user j2ee"/> | |
| <arg line="-password j2ee"/> | |
| <arg line="${appclient.application.args}"/> | |
| </exec> | |
| <!-- | |
| Clean the database after the run since it prohibits re-running | |
| --> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/drop_pointbase.sql"/> | |
| </antcall> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/create_pointbase.sql"/> | |
| </antcall> | |
| </target> | |
| <target name="run-multi-appclient-jar2" depends="init-common"> | |
| <echo message="Running app client with no -mainclass option for app with multiple app client jars"/> | |
| <exec executable="${APPCLIENT}" failonerror="true"> | |
| <arg line="-client ${assemble.dir}/${appname}AppClient.jar"/> | |
| <arg line="-textauth"/> | |
| <arg line="-user j2ee"/> | |
| <arg line="-password j2ee"/> | |
| <arg line="${appclient.application.args}"/> | |
| </exec> | |
| <!-- | |
| Clean the database after the run since it prohibits re-running | |
| --> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/drop_pointbase.sql"/> | |
| </antcall> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/create_pointbase.sql"/> | |
| </antcall> | |
| </target> | |
| <target name="run-multi-appclient-jar1" depends="init-common"> | |
| <echo message="Running app client with -mainclass option for app with 2 app client jars"/> | |
| <exec executable="${APPCLIENT}" failonerror="true"> | |
| <arg line="-client ${assemble.dir}/${appname}AppClient.jar"/> | |
| <arg line="-mainclass com.sun.s1peqe.ejb.bmp.enroller.client.EnrollerClient"/> | |
| <!--arg line="-name ${appname}Client"/--> | |
| <arg line="-textauth"/> | |
| <arg line="-user j2ee"/> | |
| <arg line="-password j2ee"/> | |
| <arg line="${appclient.application.args}"/> | |
| </exec> | |
| <!-- | |
| Clean the database after the run since it prohibits re-running | |
| --> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/drop_pointbase.sql"/> | |
| </antcall> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/create_pointbase.sql"/> | |
| </antcall> | |
| </target> | |
| <target name="undeploy" depends="init-common"> | |
| <antcall target="undeploy-common"/> | |
| <!-- <echo message="SHEETAL : bug during undeployment. The generated dir does not get deleted. Hence forcing deletion as a temporary solution."/> | |
| <delete dir="${deployed-apps}/${appname}App_1"/> --> | |
| </target> | |
| <target name="unsetup" depends="init-common"> | |
| <antcall target="execute-sql-common"> | |
| <param name="sql.file" value="sql/drop_pointbase.sql"/> | |
| </antcall> | |
| <antcall target="undeploy-jdbc-common"> | |
| <param name="jdbc.conpool.name" value="bmpEnrollerPool"/> | |
| <param name="jdbc.resource.name" value="jdbc/bmp-enrollerDB"/> | |
| </antcall> | |
| </target> | |
| <target name="usage"> | |
| <antcall target="usage-common"/> | |
| </target> | |
| <target name="retrieve-client-jar" depends="init-common"> | |
| <copy todir="${assemble.dir}"> | |
| <fileset dir="${deployed-apps}/${appname}App_1/"> | |
| <include name="${appname}AppClient.jar"/> | |
| </fileset> | |
| </copy> | |
| </target> | |
| <target name="autodeploy-ear" depends="init-common"> | |
| <echo message="Dropping the app under the autodeploy dir..."/> | |
| <delete file="${autodeploy.dir}/${appname}App.ear_deployed" failonerror="false"/> | |
| <copy file="${assemble.dir}/${appname}App.ear" | |
| todir="${autodeploy.dir}"/> | |
| </target> | |
| <target name="autodeploy" depends="autodeploy-ear, sleep-till-autodeploy, retrieve-client-jar"/> | |
| <target name="sleep-till-autodeploy"> | |
| <echo message="Waiting for autodeploy of app to complete..."/> | |
| <sleep minutes="2"/> | |
| </target> | |
| <target name="restart"> | |
| <antcall target="restart-server-instance-common"/> | |
| </target> | |
| </project> |