blob: 6917e5b6862296db2cc11e7a107c6e1febfe3d56 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
-->
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- dist
- execution
- debugging
- cleanup
-->
<project name="EntApp-impl" default="build" basedir=".." xmlns:ear2="http://www.netbeans.org/ns/j2ee-earproject/2">
<import file="ant-deploy.xml"/>
<target name="default" depends="dist" description="Build whole project."/>
<!--
INITIALIZATION SECTION
-->
<target name="pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="init-private" depends="pre-init">
<property file="nbproject/private/private.properties"/>
</target>
<target name="init-userdir" depends="pre-init,init-private">
<property name="user.properties.file" location="${netbeans.user}/build.properties"/>
</target>
<target name="init-user" depends="pre-init,init-private,init-userdir">
<property file="${user.properties.file}"/>
</target>
<target name="init-project" depends="pre-init,init-private,init-userdir,init-user">
<property file="nbproject/project.properties"/>
</target>
<target name="do-init" depends="pre-init,init-private,init-userdir,init-user,init-project">
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
<condition property="do.compile.jsps">
<istrue value="${compile.jsps}"/>
</condition>
<condition property="do.display.browser">
<and>
<istrue value="${display.browser}"/>
<contains string="${client.module.uri}" substring=".war"/>
</and>
</condition>
<available property="has.custom.manifest" file="${meta.inf}/MANIFEST.MF"/>
<condition property="j2ee.appclient.mainclass.tool.param" value="-mainclass ${main.class}" else="">
<and>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="j2ee.appclient.jvmoptions.param" value="${j2ee.appclient.jvmoptions}" else="">
<and>
<isset property="j2ee.appclient.jvmoptions"/>
<not>
<equals arg1="${j2ee.appclient.jvmoptions}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="application.args.param" value="${application.args}" else="">
<and>
<isset property="application.args"/>
<not>
<equals arg1="${application.args}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="can.debug.appclient">
<and>
<isset property="netbeans.home"/>
<isset property="app.client"/>
</and>
</condition>
</target>
<target name="post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="init-check" depends="pre-init,init-private,init-userdir,init-user,init-project,do-init">
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="build.generated.dir">Must set build.generated.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="init" depends="pre-init,init-private,init-userdir,init-user,init-project,do-init,post-init,init-check"/>
<!--
COMPILATION SECTION
-->
<target name="deps-jar" depends="init" unless="no.deps"/>
<target name="deps-j2ee-archive" depends="init" unless="no.deps">
<ant target="dist-ear" inheritall="false" antfile="${project.EntApp-ejb}/build.xml">
<property name="dist.ear.dir" location="${build.dir}"/>
</ant>
<ant target="dist-ear" inheritall="false" antfile="${project.EntApp-war}/build.xml">
<property name="dist.ear.dir" location="${build.dir}"/>
</ant>
</target>
<target name="pre-pre-compile" depends="init,deps-jar,deps-j2ee-archive"/>
<target name="pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="do-compile" depends="init,deps-jar,pre-pre-compile,pre-compile">
<copy todir="${build.dir}/META-INF">
<fileset dir="${meta.inf}"/>
</copy>
<copy file="${reference.EntApp-ejb.dist-ear}" todir="${build.dir}//"/>
<copy file="${reference.EntApp-war.dist-ear}" todir="${build.dir}//"/>
</target>
<target name="post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile" depends="init,deps-jar,pre-pre-compile,pre-compile,do-compile,post-compile" description="Compile project."/>
<!--
DIST BUILDING SECTION
-->
<target name="pre-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="do-dist-without-manifest" depends="init,compile,pre-dist" unless="has.custom.manifest">
<dirname property="dist.jar.dir" file="${dist.jar}"/>
<mkdir dir="${dist.jar.dir}"/>
<jar jarfile="${dist.jar}" compress="${jar.compress}">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target name="do-dist-with-manifest" depends="init,compile,pre-dist" if="has.custom.manifest">
<dirname property="dist.jar.dir" file="${dist.jar}"/>
<mkdir dir="${dist.jar.dir}"/>
<jar jarfile="${dist.jar}" compress="${jar.compress}" manifest="${meta.inf}/MANIFEST.MF">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target name="post-dist">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="dist" depends="init,compile,pre-dist,do-dist-without-manifest,do-dist-with-manifest,post-dist" description="Build distribution (JAR)."/>
<!--
EXECUTION SECTION
-->
<target name="run" depends="run-deploy,run-display-browser,run-ac" description="Deploy to server."/>
<target name="pre-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="post-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-pre-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
</target>
<target name="-post-nbmodule-run-deploy">
<!-- Empty placeholder for easier customization. -->
<!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
</target>
<target name="-run-deploy-am" unless="no.deps">
<!-- Task to deploy to the Access Manager runtime. -->
<ant target="-run-deploy-am" inheritall="false" antfile="${project.EntApp-ejb}/build.xml"/>
<ant target="-run-deploy-am" inheritall="false" antfile="${project.EntApp-war}/build.xml"/>
</target>
<target name="run-deploy" depends="dist,pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,post-run-deploy"/>
<target name="-run-deploy-nb" if="netbeans.home">
<nbdeploy debugmode="false" forceRedeploy="${forceRedeploy}" clientUrlPart="${client.urlPart}" clientModuleUri="${client.module.uri}"/>
</target>
<target name="-init-deploy-ant" unless="netbeans.home">
<property name="deploy.ant.archive" value="${dist.jar}"/>
<property name="deploy.ant.resource.dir" value="${resource.dir}"/>
<property name="deploy.ant.enabled" value="true"/>
</target>
<target name="run-undeploy" depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant"/>
<target name="-run-undeploy-nb" if="netbeans.home">
<fail message="Undeploy is not supported from within the IDE"/>
</target>
<target name="verify" depends="dist">
<nbverify file="${dist.jar}"/>
</target>
<target name="run-display-browser" depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl"/>
<target name="-init-display-browser" if="do.display.browser">
<condition property="do.display.browser.nb">
<isset property="netbeans.home"/>
</condition>
<condition property="do.display.browser.cl">
<and>
<isset property="deploy.ant.enabled"/>
<isset property="deploy.ant.client.url"/>
</and>
</condition>
</target>
<target name="-display-browser-nb" if="do.display.browser.nb">
<nbbrowse url="${client.url}"/>
</target>
<target name="-get-browser" if="do.display.browser.cl" unless="browser">
<condition property="browser" value="rundll32">
<os family="windows"/>
</condition>
<condition property="browser.args" value="url.dll,FileProtocolHandler" else="">
<os family="windows"/>
</condition>
<condition property="browser" value="/usr/bin/open">
<os family="mac"/>
</condition>
<property environment="env"/>
<condition property="browser" value="${env.BROWSER}">
<isset property="env.BROWSER"/>
</condition>
<condition property="browser" value="/usr/bin/firefox">
<available file="/usr/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/local/firefox/firefox">
<available file="/usr/local/firefox/firefox"/>
</condition>
<condition property="browser" value="/usr/bin/mozilla">
<available file="/usr/bin/mozilla"/>
</condition>
<condition property="browser" value="/usr/local/mozilla/mozilla">
<available file="/usr/local/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/firefox/firefox">
<available file="/usr/sfw/lib/firefox/firefox"/>
</condition>
<condition property="browser" value="/opt/csw/bin/firefox">
<available file="/opt/csw/bin/firefox"/>
</condition>
<condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
<available file="/usr/sfw/lib/mozilla/mozilla"/>
</condition>
<condition property="browser" value="/opt/csw/bin/mozilla">
<available file="/opt/csw/bin/mozilla"/>
</condition>
</target>
<target name="-display-browser-cl" depends="-get-browser" if="do.display.browser.cl">
<fail unless="browser">
Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
</fail>
<property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
<echo>Launching ${browse.url}</echo>
<exec executable="${browser}" spawn="true">
<arg line="${browser.args} ${browse.url}"/>
</exec>
</target>
<target name="run-ac" depends="init" if="app.client">
<antcall target="run-${app.client}"/>
</target>
<target name="-as-retrieve-option-workaround" if="j2ee.appclient.mainclass.args" unless="j2ee.clientName">
<property name="client.jar" value="${dist.dir}/EntAppClient.jar"/>
<sleep seconds="3"/>
<copy file="${wa.copy.client.jar.from}/EntApp/EntAppClient.jar" todir="${dist.dir}"/>
</target>
<!--
DEBUGGING SECTION
-->
<target name="debug" depends="run-debug,run-display-browser,run-debug-appclient" description="Deploy to server."/>
<target name="run-debug" description="Debug project in IDE." depends="dist" if="netbeans.home" unless="app.client">
<nbdeploy debugmode="true" clientUrlPart="${client.urlPart}" clientModuleUri="${client.module.uri}"/>
<antcall target="connect-debugger"/>
</target>
<target name="connect-debugger" unless="is.debugged">
<nbjpdaconnect name="${name}" host="${jpda.host}" address="${jpda.address}" transport="${jpda.transport}">
<classpath>
<path path="${debug.classpath}"/>
</classpath>
<sourcepath>
<path path="${ear.docbase.dirs}"/>
</sourcepath>
</nbjpdaconnect>
</target>
<target name="-init-debug-args">
<property name="version-output" value="java version &quot;${ant.java.version}"/>
<condition property="have-jdk-older-than-1.4">
<or>
<contains string="${version-output}" substring="java version &quot;1.0"/>
<contains string="${version-output}" substring="java version &quot;1.1"/>
<contains string="${version-output}" substring="java version &quot;1.2"/>
<contains string="${version-output}" substring="java version &quot;1.3"/>
</or>
</condition>
<condition property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none" else="-Xdebug">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
</target>
<target name="run-debug-appclient" depends="init,-init-debug-args" if="can.debug.appclient">
<macrodef name="debug-appclient" uri="http://www.netbeans.org/ns/j2ee-earproject/2">
<attribute name="mainclass"/>
<attribute name="classpath" default="${debug.classpath}"/>
<element name="customize" optional="true"/>
<attribute name="args" default="${application.args.param}"/>
<sequential>
<parallel>
<java fork="true" classname="@{mainclass}">
<jvmarg line="${j2ee.appclient.tool.jvmoptions}"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${jpda.transport},server=y,address=${jpda.address},suspend=y"/>
<jvmarg line="${j2ee.appclient.jvmoptions.param}"/>
<arg line="@{args}"/>
<classpath>
<path path="${j2ee.platform.classpath}:${j2ee.appclient.tool.runtime}"/>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
<nbjpdaconnect name="${name}" host="${jpda.host}" address="${jpda.address}" transport="${jpda.transport}">
<classpath>
<path path="${j2ee.platform.classpath}:${j2ee.appclient.tool.runtime}"/>
<path path="@{classpath}"/>
</classpath>
<sourcepath>
<path path="${src.dir}"/>
</sourcepath>
</nbjpdaconnect>
</parallel>
</sequential>
</macrodef>
<nbdeploy debugmode="false" clientUrlPart="${client.urlPart}" clientModuleUri="${client.module.uri}"/>
<antcall target="debug-${app.client}"/>
</target>
<!--
CLEANUP SECTION
-->
<target name="deps-clean" depends="init" unless="no.deps">
<ant target="clean-ear" inheritall="false" antfile="${project.EntApp-ejb}/build.xml">
<property name="dist.ear.dir" location="${build.dir}"/>
</ant>
<ant target="clean-ear" inheritall="false" antfile="${project.EntApp-war}/build.xml">
<property name="dist.ear.dir" location="${build.dir}"/>
</ant>
</target>
<target name="do-clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="clean" depends="init,deps-clean,do-clean,post-clean" description="Clean build products."/>
</project>