blob: cac7f475b17a35f2f21f510b3c0b7a9173c85874 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE project [
<!--
Copyright (c) 2017, 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 "../../../../../config/properties.xml">
<!ENTITY commonBuild SYSTEM "../../../../../config/common.xml">
<!ENTITY embeddedCommon SYSTEM "../embedded.xml">
<!ENTITY testproperties SYSTEM "build.properties">
]>
<project name="ejb-ejb31-embedded-ejbandwar-App" default="usage" basedir=".">
&embeddedCommon;
&commonSetup;
&commonBuild;
&testproperties;
<target name="all" depends="start-database,build,run,stop-database"/>
<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>
<antcall target="compile-common">
<param name="src" value="servlet"/>
</antcall>
</target>
<target name="build" depends="compile">
<mkdir dir="${assemble.dir}"/>
<jar jarfile="${assemble.dir}/${appname}-other.jar"
basedir="${build.classes.dir}"
update="true"
includes ="**/Other*.class">
</jar>
<delete>
<fileset dir="${build.classes.dir}" includes="**/Other*.class"/>
</delete>
<!-- package war ourselves to include persistence.xml -->
<mkdir dir="${build.classes.dir}/tmp"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF/classes"/>
<mkdir dir="${build.classes.dir}/tmp/WEB-INF/classes/META-INF"/>
<copy todir="${build.classes.dir}/tmp/WEB-INF/classes">
<fileset dir="${build.classes.dir}">
<exclude name="**/Client.class"/>
<exclude name="**/Other*.class"/>
</fileset>
</copy>
<copy file="${persistence.xml}"
tofile="${build.classes.dir}/tmp/WEB-INF/classes/META-INF/persistence.xml" failonerror="false"/>
<copy file="${web.xml}"
tofile="${build.classes.dir}/tmp/WEB-INF/web.xml" failonerror="false"/>
<jar jarfile="${assemble.dir}/${appname}-web.war" update="true">
<fileset dir="${build.classes.dir}/tmp" casesensitive="yes"/>
</jar>
<delete>
<fileset dir="${build.classes.dir}/org" excludes="**/*Simple.class"/>
</delete>
<move file="${build.classes.dir}/tmp" tofile="${assemble.dir}/tmp"/>
</target>
<target name="run" depends="init-common">
<antcall target="run_war"/>
<antcall target="run_dir"/>
</target>
<target name="run_war" depends="init-common">
<java fork="on"
failonerror="true"
classpath="${assemble.dir}/${appname}-other.jar:${assemble.dir}/${appname}-web.war:${assemble.dir}/${appname}-pu.jar:${embedded.classpath}:${build.classes.dir}:${env.APS_HOME}/lib/reporter.jar"
classname="${se.client}">
<jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED" />
<arg line="${jndiroot}"/>
</java>
</target>
<target name="run_dir" depends="init-common">
<mkdir dir="${assemble.dir}/other"/>
<unzip src="${assemble.dir}/${appname}-other.jar" dest="${assemble.dir}/other"/>
<java fork="on"
failonerror="true"
classpath="${assemble.dir}/tmp:${assemble.dir}/other:${embedded.classpath}:${build.classes.dir}:${env.APS_HOME}/lib/reporter.jar"
classname="${se.client}">
<jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED" />
<jvmarg value="--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED" />
<!--
<jvmarg value="-Dorg.glassfish.ejb.embedded.keep-temporary-files=true"/>
-->
<arg line="${jndiroot}"/>
</java>
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
</project>