beehive/netui/ant/webappTemplate.xml

171 lines
6.5 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:$
-->
<project name="Beehive/NetUI/WebappTemplates" default="all.templates" basedir=".">
<import file="../netui-imports.xml"/>
<property name="resource.dir.name" value="resources/beehive/version1"/>
<property name="template.root.dir" location="${src.dir}/webapp-template/"/>
<property name="webapp.dist.dir" location="${beehive.home}/netui/build/dist/webapp"/>
<property name="compiler.dist.dir" location="${beehive.home}/netui/build/dist/compiler"/>
<property name="tld.dist.dir" location="${beehive.home}/netui/build/dist/tld"/>
<target name="deploy.compiler">
<copy todir="${compiler.dist.dir}" file="${jars.dir}/beehive-netui-compiler.jar"/>
</target>
<target name="deploy.tld">
<copy todir="${tld.dist.dir}">
<fileset dir="${jars.dir}" includes="beehive-netui-*.tld"/>
</copy>
</target>
<target name="create.netui.webapp" description="Create a NetUI webapp">
<echo>Create NetUI Webapp in: ${webapp.dir}</echo>
<property name="web.dir" location="${webapp.dir}/web"/>
<property name="webinf.dir" location="${web.dir}/WEB-INF"/>
<property name="webinf.lib" location="${webinf.dir}/lib"/>
<property name="javascript.dir" location="${web.dir}/${resource.dir.name}/javascript"/>
<mkdir dir="${webapp.dir}"/>
<mkdir dir="${web.dir}"/>
<mkdir dir="${webinf.dir}"/>
<mkdir dir="${webinf.lib}"/>
<mkdir dir="${webinf.dir}/classes"/>
<mkdir dir="${javascript.dir}"/>
<!-- need to reset the webapp.dir property for these targets -->
<antcall target="deploy.struts">
<param name="webapp.dir" value="${web.dir}"/>
</antcall>
<antcall target="deploy.netui">
<param name="webapp.dir" value="${web.dir}"/>
</antcall>
<copy todir="${webinf.lib}">
<fileset refid="jstl.fileset"/>
<fileset refid="commons-el.fileset"/>
<fileset refid="commons-codec.fileset"/>
<fileset refid="commons-discovery.fileset"/>
<fileset refid="controls.fileset"/>
<fileset refid="log4j.fileset"/>
</copy>
<!-- copy JavaScript and resources -->
<copy file="${src.dir}/javascript/tagshtml/netui-tree.js" todir="${javascript.dir}"/>
<copy file="${src.dir}/javascript/tags-datagrid/netui-datagrid.js" todir="${javascript.dir}"/>
<copy todir="${webapp.dir}">
<fileset dir="${template.root.dir}/default">
<include name="**/*"/>
<exclude name="src/global/Global.app"/>
<exclude name="web/WEB-INF/beehive-netui-config.xml"/>
</fileset>
</copy>
</target>
<target name="deploy.netui.runtime" description="Deploy the NetUI server runtime to a webapp root directory.">
<available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
<fail unless="webapp.dir.available" message="Can't deploy the NetUI runtime to a ${webapp.dir} that does not exist."/>
<!-- just in case the directories don't exist, attempt to create them -->
<mkdir dir="${webapp.dir}/WEB-INF"/>
<mkdir dir="${webapp.dir}/WEB-INF/lib"/>
<mkdir dir="${webapp.dir}/WEB-INF/src"/>
<mkdir dir="${webapp.dir}/${resource.dir.name}"/>
<echo>Deploy the NetUI runtime to webapp rooted at: ${webapp.dir}</echo>
<antcall target="deploy.struts"/>
<antcall target="deploy.netui"/>
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${webapp.dist.dir}/web/WEB-INF/lib">
<patternset refid="beehive.jars"/>
</fileset>
</copy>
<!-- Beehive/NetUI assumes ownership of the resources/beehive/version1 directory -->
<copy todir="${webapp.dir}/${resource.dir.name}" overwrite="true">
<fileset dir="${webapp.dist.dir}/web/${resource.dir.name}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="deploy.netui">
<copy todir="${webapp.dir}/WEB-INF">
<fileset dir="${jars.dir}">
<patternset refid="netui.webinf"/>
</fileset>
<fileset dir="${template.root.dir}/default/web/WEB-INF">
<patternset refid="netui.webinf"/>
</fileset>
</copy>
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${jars.dir}">
<patternset refid="netui.jars"/>
</fileset>
</copy>
</target>
<target name="deploy.struts">
<echo>Deploy Struts 1.2</echo>
<copy todir="${webapp.dir}/WEB-INF/lib">
<fileset dir="${struts.dir}">
<patternset refid="struts12.jars"/>
</fileset>
</copy>
<copy todir="${webapp.dir}/WEB-INF">
<fileset dir="${struts.dir}">
<patternset refid="struts12.webinf"/>
</fileset>
</copy>
</target>
<patternset id="netui.jars">
<include name="beehive-netui-tags.jar"/>
<include name="beehive-netui-core.jar"/>
</patternset>
<patternset id="netui.webinf">
<include name="beehive-netui-validator-rules.xml"/>
</patternset>
<patternset id="beehive.jars">
<include name="commons-el.jar"/>
<include name="commons-codec-1.3.jar"/>
<include name="commons-discovery-0.2.jar"/>
<include name="jstl.jar"/>
<include name="standard.jar"/>
<include name="log4j-1.2.8.jar"/>
<include name="beehive-controls.jar"/>
</patternset>
<patternset id="struts12.webinf">
<include name="validator-rules.xml"/>
</patternset>
</project>