JdbcMapper/samples/netui-samples/build.xml

115 lines
4.1 KiB
XML

<?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 the Beehive netui-samples web application.
-->
<project name="Beehive/Samples/NetUI-Samples" default="usage" basedir=".">
<property environment="os"/>
<property file="build.properties"/>
<import file="${beehive.home}/beehive-imports.xml"/>
<property name="build.dir" location="build"/>
<property name="web.dir" location="web"/>
<property name="src.dir" location="src"/>
<!-- Define the classpath used to build the webapp -->
<path id="webapp.classpath">
<path refid="velocity.dependency.path"/>
<path refid="netui-compiler.dependency.path"/>
<pathelement location="${servlet-api.jar}"/>
<pathelement location="${jsp-api.jar}"/>
<pathelement location="${build.dir}/WEB-INF/classes"/>
<fileset dir="${build.dir}/WEB-INF/lib" includes="*.jar"/>
</path>
<target name="build" description="Build the webapp">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/WEB-INF/classes"/>
<deploy-netui webappDir="${build.dir}"/>
<copy todir="${build.dir}/" includeEmptyDirs="false">
<fileset dir="${web.dir}"/>
</copy>
<copy todir="${build.dir}/WEB-INF/classes">
<fileset dir="${src.dir}/">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</copy>
<taskdef name="apt"
classname="org.apache.beehive.controls.runtime.generator.AptTask"
classpathref="webapp.classpath"
onerror="fail"/>
<apt srcdir="${src.dir}"
destdir="${build.dir}/WEB-INF/classes"
gendir="${build.dir}/WEB-INF/.tmpbeansrc"
classpathref="webapp.classpath"
srcExtensions="*.java"
debug="true"
processorOptions="web.content.root=${web.dir}"
nocompile="false"/>
</target>
<target name="clean" description="Clean the netui-samples webapp">
<delete dir="${build.dir}"/>
</target>
<target name="war" depends="build" description="Build a compressed WAR file that can be deployed to an application container">
<property name="archive.dir" value="${build.dir}/.."/>
<!-- 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>
</war>
</target>
<target name="copy.web"
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="usage" description="Print usage information for this build file">
<echo>
Welcome to the Beehive netui-samples webapp!
To build the webapp, run:
ant clean -- cleans the netui-samples webapp
ant build -- builds the netui-samples webapp
ant war -- creates a .war archive to deploy
</echo>
</target>
</project>