JdbcMapper/samples/system-controls-jdbc/build.xml

147 lines
5.6 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
$Header:$
-->
<!--
An Ant build file for compiling a Beehive page flow web application.
-->
<project name="Beehive/Samples/jdbcControlSample" default="usage" basedir=".">
<property environment="os"/>
<property file="${basedir}/build.properties"/>
<import file="${beehive.home}/beehive-imports.xml"/>
<import file="${beehive.home}/ant/beehive-tools.xml"/>
<property name="webapp.dir" location="${basedir}"/>
<property name="build.dir" location="build"/>
<property name="web.dir" location="web"/>
<property name="src.dir" location="src"/>
<property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
<!-- Define the classpath used to build the webapp -->
<path id="webapp.classpath">
<pathelement location="${servlet-api.jar}"/>
<pathelement location="${jsp-api.jar}"/>
<pathelement location="${build.dir}/WEB-INF/classes"/>
<fileset dir="${build.dir}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="webapp.sourcepath">
<pathelement location="${web.dir}"/>
<pathelement location="${src.dir}"/>
</path>
<target name="deploy-beehive" description="Copy the Beehive Page Flow rutime into the target webapp">
<mkdir dir="${build.dir}"/>
<deploy-netui webappDir="${build.dir}"/>
<!-- Needs the beehive-jdbc-controls.jar to work. -->
<copy todir="${build.dir}/WEB-INF/lib" file="${beehive.home}/lib/controls/beehive-jdbc-control.jar"></copy>
</target>
<target name="build" depends="deploy-beehive" description="Build the webapp">
<available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
<fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
<copy todir="${build.dir}/">
<fileset dir="${web.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy todir="${build.dir}/WEB-INF/classes">
<fileset dir="${src.dir}/">
<include name="sql/**"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
<!-- compile controls -->
<echo>Building Controls</echo>
<build-controls srcdir="${basedir}/src"
destdir="${build.dir}/WEB-INF/classes"
tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
classpathRef="webapp.classpath"/>
<!-- compile JPFs -->
<echo>Building Page Flows</echo>
<build-pageflows srcdir="${basedir}"
webcontentdir="${web.dir}"
destdir="${build.dir}/WEB-INF/classes"
tempdir="${build.dir}/WEB-INF/${tmp.sourcegen.dir}"
sourcepathref="webapp.sourcepath"
classpathref="webapp.classpath"/>
<!-- copy resources -->
<echo>Copy all .properties and .xml files</echo>
<copy todir="${build.dir}/WEB-INF/classes">
<fileset dir="${src.dir}" includes="**/*.properties"/>
<fileset dir="${src.dir}" includes="**/*.xml"/>
</copy>
</target>
<target name="copy.jsps"
description="When deploying an exploded webapp, this target copies changed JSPs into the deployed directory">
<copy todir="${build.dir}/">
<fileset dir="${web.dir}">
<exclude name="**/*.java"/>
<exclude name="WEB-INF/**"/>
</fileset>
</copy>
</target>
<target name="clean" description="Clean the webapp">
<delete dir="${build.dir}" includeEmptyDirs="true"/>
<delete file="${basedir}/${context.path}.war" />
</target>
<target name="war" description="Build a compressed WAR file that can be deployed to an application container">
<property name="archive.dir" value="${basedir}"/>
<!-- this does *not* exclude source from the archive -->
<war destfile="${archive.dir}/${context.path}.war" webxml="${build.dir}/WEB-INF/web.xml">
<fileset dir="${build.dir}">
<exclude name="WEB-INF/web.xml"/>
</fileset>
<!--<metainf dir="${basedir}/META-INF">
</metainf>-->
</war>
</target>
<target name="usage" description="Print usage information for this build file">
<echo>
To run the webapp, two steps need to occur:
- copy the Beehive runtime to the webapp
- build the webapp
Once the webapp is built, it's ready to deploy onto your application container.
</echo>
<java fork="no" classname="org.apache.tools.ant.Main">
<arg line="-f ${ant.file} -projecthelp"/>
</java>
</target>
</project>