blob: 1bfae1b8703328279dd5416961f9af3ea990da76 [file] [log] [blame]
<?xml version="1.0"?>
<!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 "./build.properties">
]>
<project name="daomanager" basedir="." default="usage">
&commonSetup;
&commonBuild;
&testProperties;
<target name="all" depends="build,deploy,run,undeploy"/>
<target name="run-test" depends="build,deploy,run,undeploy"/>
<target name="clean" depends="init-common">
<delete dir="${build.classes.dir}"/>
<delete dir="${assemble.dir}"/>
</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" depends="compile">
<!-- <property name="ejbjar.classes" value="**/*Home*.class,**/*Bean*.class,**/*Data*.class,*.dbschema"/>
-->
<antcall target="build-ear"/>
</target>
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
<!-- As this app contain common ejbs to be shared by other apps, copying the client.jar to instance lib directory and restart the instance-->
<!--
commented as other dependent apps are not putting under this workspace directory
<copy file="${assemble.dir}/${appname}AppClient.jar" tofile="${env.S1AS_HOME}/domains/domain1/${appserver.instance.name}/lib/${appname}AppClient.jar"/>
<ant antfile="build.xml" dir="../" target="restart-server"/>
-->
</target>
<!-- On windows more than 8 options can't supply. So only required options passed. -->
<target name="run" depends="init-common">
<exec executable="${APPCLIENT}">
<arg value="-client" />
<arg value="${assemble.dir}/${appname}AppClient.jar"/>
<arg value="-xml"/>
<arg value="${admin.domain.dir}/${admin.domain}/config/glassfish-acc.xml"/>
<arg value="-textauth"/>
<arg value="-user"/>
<arg value="scott"/>
<arg value="-password"/>
<arg value="j2ee"/>
</exec>
</target>
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
<!--
<antcall target="undeploy-jdbc-common"/>
<antcall target="delete-persistence-resource-common"/>
-->
</target>
<target name="usage">
<antcall target="usage-common"/>
</target>
<!-- Additional local targets -->
<target name="package-ejbjar">
<delete file="${ejb.jar}"/>
<echo message="sqe-common.xml: Generating ejb-jar inside build directory"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy file="${ejb-jar.xml}"
tofile="${build.classes.dir}/META-INF/ejb-jar.xml"/>
<copy file="${sun-ejb-jar.xml}"
tofile="${build.classes.dir}/META-INF/sun-ejb-jar.xml"/>
<copy file="${sun-cmp-mappings.xml}"
tofile="${build.classes.dir}/META-INF/sun-cmp-mappings.xml"/>
<copy file="${sun-cmp-dbschema}"
todir="${build.classes.dir}/"/>
<jar jarfile="${ejb.jar}" update="true" manifest="./ejb/MANIFEST.MF">
<fileset dir="${ejbjar.files}">
<include name="**/*Local*.class"/>
<include name="**/*Remote*.class"/>
<include name="**/*Bean*.class"/>
<include name="**/*Data*.class"/>
<include name="*.dbschema"/>
</fileset>
<metainf dir="${build.classes.dir}/META-INF">
<include name="ejb-jar.xml"/>
<include name="sun-ejb-jar.xml"/>
<include name="sun-cmp-mappings.xml"/>
</metainf>
</jar>
</target>
<target name="ejb-jar" depends="init-common">
<mkdir dir="${assemble.dir}"/>
<antcall target="package-ejbjar">
<param name="ejbjar.files" value="${build.classes.dir}"/>
<param name="ejb.jar" value="${assemble.dir}/${appname}-ejb.jar"/>
</antcall>
</target>
<target name="build-ear" depends="ejb-jar,appclient-jar">
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${assemble.dir}/META-INF"/>
<mkdir dir="${assemble.dir}/lib"/>
<copy file="${sun-application.xml}"
tofile="${assemble.dir}/META-INF/sun-application.xml"
failonerror="false"/>
<copy file="${env.APS_HOME}/lib/reporter.jar"
tofile="${assemble.dir}/lib/reporter.jar"
failonerror="false"/>
<ear earfile="${assemble.dir}/${appname}App.ear" appxml="${application.xml}">
<fileset dir="${assemble.dir}" includes="*.jar,META-INF/sun-application.xml,lib/reporter.jar"/>
</ear>
</target>
<!-- ================================================================ -->
<!-- Target to create the appclient jar file with custom classes-->
<!-- ================================================================ -->
<target name="appclient-jar" depends="init-common">
<property name="appclientjar.classes" value="**/*Local*.class,**/*Remote*.class,**/*Home*.class,**/*Client*.class,**/*Data*.class"/>
<antcall target="package-appclientjar-common">
<param name="appclientjar.files"
value="${build.classes.dir}"/>
<param name="appclient.jar"
value="${assemble.dir}/${appname}-client.jar"/>
</antcall>
</target>
</project>