blob: 4d3779c10991d77a13c56486fb7f8b32d0a5e094 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!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">
]>
<!--
All appclient devtests can use the ant import task to include this file.
It defines several useful tasks:
all - clean, build, deploy, run, undeploy
clean
compile
build
deploy
undeploy
test
This project assumes that all tests include both a stand-alone client jar
and an embedded one. If a particular test does not include one or the other
of these, that test's build.xml can override any of the following targets
to make them no-ops:
build.ear
build.client
deploy.ear
deploy.client
undeploy.ear
undeploy.client
test.standalone.client
test.embedded.client
-->
<project name="importedAppclient" default=".">
<target name="all" depends="clean,build,deploy,run,undeploy"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
<!-- In this example there are only .java files for the client -->
<target name="compile" depends="init-common">
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>
</target>
<target name="build" depends="init-common">
<antcall target="build.client"/>
<antcall target="build.ear"/>
<!--
<antcall target="build.ejb"/>
-->
</target>
<target name="build.ear">
<antcall target="ear-common"/>
</target>
<!--
<target name="build.ejb">
<antcall target="ejb-common"/>
</target>
-->
<!--
The following implementation borrows heavily from the same target in
common.xml, but includes reporter.jar in the client jar so the client can report its
results.
-->
<target name="build.client" depends="compile">
<delete file="${appclient.jar}"/>
<mkdir dir="${assemble.dir}"/>
<property name="appclientjar.files" value="${build.classes.dir}"/>
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="manifest.file" value="./client/MANIFEST.MF"/>
<echo message="common.xml: Generating appclient-jar inside build directory"
level="verbose"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy file="${application-client.xml}"
tofile="${build.classes.dir}/META-INF/application-client.xml"
failonerror="false"
overwrite="true"/>
<copy file="${sun-application-client.xml}" tofile="${build.classes.dir}/META-INF/sun-application-client.xml"
failonerror="false"
overwrite="true"/>
<jar jarfile="${appclient.jar}" basedir="${appclientjar.files}"
update="true" includes ="${appclientjar.classes}"
manifest="${manifest.file}">
<metainf dir="${build.classes.dir}/META-INF">
<include name="application-client.xml"/>
<include name="sun-application-client.xml"/>
</metainf>
<fileset dir="${env.APS_HOME}/lib" includes="reporter.jar"/>
</jar>
</target>
<target name="deploy"
depends="init-common">
<antcall target="deploy.ear"/>
<antcall target="deploy.client"/>
</target>
<target name="deploy.ear" depends="build.ear">
<antcall target="deploy-common"/>
</target>
<target name="deploy.client" depends="build.client">
<antcall target="deploy-common">
<param name="deployed.app" value="${assemble.dir}/${appname}-client.jar"/>
</antcall>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy.ear"/>
<antcall target="undeploy.client"/>
</target>
<target name="undeploy.ear" depends="init-common">
<antcall target="undeploy-common"/>
</target>
<target name="undeploy.client" depends="init-common">
<antcall target="undeploy-client-common"/>
</target>
<target name="run">
<antcall target="test.standalone.client"/>
<antcall target="test.embedded.client"/>
</target>
<target name="test.standalone.client" depends="init-common">
<antcall target="test.client">
<param name="urlpath" value="/${clientname}"/>
</antcall>
</target>
<target name="test.embedded.client" depends="init-common">
<antcall target="test.client">
<param name="generated.appclient.jar" value="${assemble.dir}/${appname}AppClient.jar"/>
<param name="urlpath" value="/${appname}App/${clientname}"/>
</antcall>
</target>
<target name="test.undeployed.client" depends="init-common">
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="generated.appclient.jar" value="${appclient.jar}"/>
<antcall target="test.client"/>
</target>
<target name="test.client">
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="generated.appclient.jar" value="${assemble.dir}/${appname}-clientClient.jar"/>
<echo>appclient -client ${generated.appclient.jar} ${appclient.application.args}</echo>
<exec executable="${APPCLIENT}" failonerror="false" logError="true">
<arg line="-client ${generated.appclient.jar}"/>
<arg line="${appclient.application.args}"/>
</exec>
</target>
</project>