blob: a46fec89422fc56b2724ddfa43ede28bc79824b1 [file] [log] [blame]
<?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:./buildJava2DB.properties">
]>
<project name="standalone-persistence" default="usage" basedir=".">
&commonSetup;
&commonBuild;
&testproperties;
<target name="all" depends="build,setup,deploy,run,undeploy,unsetup"/>
<target name="run-test" depends="build,setup,deploy,run,undeploy,unsetup"/>
<target name="clean" depends="init-common">
<delete dir="${build.classes.dir}"/>
<delete dir="${assemble.dir}"/>
</target>
<target name="setup" depends="init-common">
<antcall target="create-jdbc-connpool-common"/>
<antcall target="create-jdbc-resource-common"/>
<antcall target="create-resource-ref"/>
</target>
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
</target>
<target name="build-entity" depends="init-common">
<property name="ejbjar.classes" value="**/*Entity*.class"/>
<property name="ejbjar.files" value="${build.classes.dir}"/>
<property name="ejb.jar" value="${assemble.dir}/${appname}-persistence.par"/>
<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<mkdir dir="${assemble.dir}"/>
<delete file="${ejb.jar}" failonerror="false"/>
<echo message="sqe-common.xml: Generating ejb-jar inside build directory"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<!-- optional files -->
<copy file="${persistence.xml}"
tofile="${build.classes.dir}/META-INF/persistence.xml"
failonerror="false"/>
<!-- make a jar -->
<jar jarfile="${ejb.jar}" basedir="${ejbjar.files}" update="true"
includes ="${ejbjar.classes}">
<metainf dir="${build.classes.dir}/META-INF">
<include name="**/*.xml"/>
<include name="**/*.wsdl"/>
</metainf>
</jar>
<delete dir="${build.classes.dir}/META-INF" failonerror="false"/>
</target>
<target name="build" depends="init-common,clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
</antcall>
<antcall target="compile-common">
<param name="src" value="client"/>
</antcall>
<!--<antcall target="build-entity"/>-->
<antcall target="build-ear-common"/>
</target>
<target name="run" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.application.args" value="${testsuite.id} "/>
</antcall>
</target>
<target name="unsetup" depends="init-common">
<antcall target="delete-jdbc-resource-common"/>
<antcall target="delete-jdbc-connpool-common"/>
</target>
<target name="create-resource-ref" depends="init-common">
<echo message="Creating resource reference ${jdbc.resource.name} "/>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="create-resource-ref"/>
<arg line="${as.props}"/>
<arg line="${jdbc.resource.name}"/>
</exec>
</target>
</project>