blob: d10644e9c18ab53bc58d71ddddfe76970c178094 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 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
-->
<project name="v3-targets" default="all" basedir=".">
<property name="db.root" value="${glassfish.home}/javadb"/>
<property name="db.classpath" value="${db.root}/lib"/>
<property name="war.file.ext" value="${war.file}.war"/>
<property name="deployed.app" value=""/>
<!--<property name="db.classpath" value="${db.root}/lib/derby.jar:${db.root}/lib/derbyclient.jar:${db.root}/lib/derbynet.jar"/>-->
<target name="setOSConditions">
<condition property="isUnix">
<os family="unix"/>
</condition>
<condition property="isWindows">
<os family="windows" />
</condition>
</target>
<target name="start-server" depends="setOSConditions">
<echo>+-----------------------------+</echo>
<echo>| |</echo>
<echo>| S T A R T I N G GLASSFISH |</echo>
<echo>| |</echo>
<echo>+-----------------------------+</echo>
<antcall target="start-server-unix"/>
<antcall target="start-server-windows"/>
</target>
<target name="start-server-unix" if="isUnix">
<exec executable="${glassfish.home}/bin/asadmin">
<arg value="start-domain"/>
</exec>
</target>
<target name="start-server-windows" if="isWindows">
<exec executable="cmd">
<arg value="/c"/>
<arg value="${glassfish.home}/bin/asadmin"/>
<arg value="start-domain"/>
</exec>
</target>
<target name="stop-server" depends="setOSConditions">
<antcall target="stop-server-unix"/>
<antcall target="stop-server-windows"/>
</target>
<target name="stop-server-unix" if="isUnix">
<echo message="stopping server on unix ..."/>
<exec executable="${glassfish.home}/bin/asadmin">
<arg value="stop-domain"/>
</exec>
</target>
<target name="stop-server-windows" if="isWindows">
<echo message="stopping server on windows ..."/>
<exec executable="cmd" >
<arg value="/c"/>
<arg value="${glassfish.home}/bin/asadmin"/>
<arg value="stop-domain"/>
</exec>
</target>
<target name="deploy-v3-impl" depends="setOSConditions">
<echo message="glassfish.home is ${glassfish.home}"/>
<echo message="deploying in v3 mode"/>
<echo message="./${war.file}"/>
<echo message="OS is ${os.name}"/>
<echo message="Please access URL http://${glassfish.http.host}:${glassfish.http.port}/${contextroot}"/>
<antcall target="deploy-v3-impl-unix"/>
<antcall target="deploy-v3-impl-windows"/>
</target>
<target name="deploy-v3-impl-windows" if="isWindows">
<exec executable="cmd">
<arg value="/c"/>
<arg value="${glassfish.home}/bin/asadmin.bat"/>
<arg value="deploy"/>
<arg value="--path"/>
<arg value="--upload=false"/>
<arg line="${deployed.app}"/>
</exec>
</target>
<target name="deploy-v3-impl-unix" if="isUnix">
<exec executable="${glassfish.home}/bin/asadmin">
<arg value="deploy"/>
<arg value="--path"/>
<arg line="${deployed.app}"/>
</exec>
</target>
<target name="undeploy-v3-impl" depends="setOSConditions">
<echo message="undeploying in v3 mode"/>
<echo message="./${war.file}"/>
<antcall target="undeploy-v3-impl-unix"/>
<antcall target="undeploy-v3-impl-windows"/>
</target>
<target name="undeploy-v3-impl-windows" if="isWindows">
<exec executable="cmd">
<arg value="/c"/>
<arg value="${glassfish.home}/bin/asadmin.bat"/>
<arg value="undeploy"/>
<arg value="${war.file}"/>
</exec>
</target>
<target name="undeploy-v3-impl-unix" if="isUnix">
<exec executable="${glassfish.home}/bin/asadmin">
<arg value="undeploy"/>
<arg value="${war.file}"/>
</exec>
</target>
</project>