JdbcMapper/netui/build.xml

285 lines
13 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:$
-->
<!--
Build file for the Beehive/NetUI project.
-->
<project name="Beehive/NetUI Framework Build" default="build" basedir=".">
<import file="../beehive-imports.xml"/>
<import file="netui-imports.xml"/>
<!-- ============================================================= -->
<!-- -->
<!-- Build / clean targets -->
<!-- -->
<!-- ============================================================= -->
<target name="build" description="Compiles and build NetUI">
<echo message="--------------------------------------------------"/>
<echo message="| NetUI build starting |"/>
<echo message="--------------------------------------------------"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${jars.dir}"/>
<mkdir dir="${classes.dir}"/>
<antcall target="do.subant">
<param name="target.name" value="build"/>
</antcall>
<echo message="--------------------------------------------------"/>
<echo message="| NetUI build ending |"/>
<echo message="--------------------------------------------------"/>
</target>
<target name="clean" description="Cleans all NetUI build products.">
<antcall target="clean.runtime"/>
<ant dir="${beehive.home}/netui/test/webapps/drt" antfile="build.xml" target="clean" inheritAll="false"/>
</target>
<target name="clean.runtime" description="Clean the NetUI runtime">
<delete dir="build"/>
</target>
<target name="deploy" description="Builds and deploys NetUI.">
<antcall target="build"/>
<antcall target="deploy.only"/>
</target>
<target name="deploy.only">
<echo message="--------------------------------------------------"/>
<echo message="| NetUI deploy starting |"/>
<echo message="--------------------------------------------------"/>
<ant dir="ant" antfile="webappTemplate.xml" target="create.netui.webapp" inheritAll="false">
<property name="webapp.dir" location="${webapp.dist.dir}"/>
</ant>
<ant dir="ant" antfile="webappTemplate.xml" target="deploy.compiler" inheritAll="false"/>
<ant dir="ant" antfile="webappTemplate.xml" target="deploy.tld" inheritAll="false"/>
<echo message="--------------------------------------------------"/>
<echo message="| NetUI deploy ending |"/>
<echo message="--------------------------------------------------"/>
</target>
<!-- ============================================================= -->
<!-- -->
<!-- Documentation targets -->
<!-- -->
<!-- ============================================================= -->
<target name="docs" description="Generate NetUI Javadoc and JSP tag doc.">
<ant dir="ant" target="build" antfile="javadoc.xml" inheritAll="false"/>
</target>
<!-- ============================================================= -->
<!-- -->
<!-- Test targets -->
<!-- -->
<!-- ============================================================= -->
<target name="drt.junit" description="Run the JUnit DRTs">
<ant dir="${basedir}/test/ant/" target="drt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
</target>
<target name="bvt.junit" description="Run the JUnit BVTs">
<ant dir="${basedir}/test/ant/" target="bvt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
</target>
<target name="drt.server" description="Run the NetUI server tests">
<ant dir="${beehive.home}/netui/test/webapps/drt" antfile="build.xml" target="drt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
</target>
<target name="bvt.server" description="Run the NetUI server tests">
<ant dir="${beehive.home}/netui/test/webapps/drt" antfile="build.xml" target="bvt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
</target>
<target name="test.server" description="Run all of the server tests">
<antcall target="bvt.server"/>
<ant dir="${beehive.home}/netui/test/webapps/jsf" antfile="build.xml" target="bvt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
<ant dir="${beehive.home}/netui/test/webapps/urlTemplates" antfile="build.xml" target="bvt" inheritAll="false">
<property name="drt.cc.mode" value="true"/>
</ant>
</target>
<target name="drt" description="Runs the NetUI DRTs">
<echo message="--------------------------------------------------"/>
<echo message="| NetUI DRT starting |"/>
<echo message="--------------------------------------------------"/>
<antcall target="drt.junit"/>
<antcall target="drt.server"/>
<echo message="--------------------------------------------------"/>
<echo message="| NetUI DRT ending |"/>
<echo message="--------------------------------------------------"/>
</target>
<target name="bvt" description="Runs the NetUI BVTs">
<echo message="--------------------------------------------------"/>
<echo message="| NetUI BVT starting |"/>
<echo message="--------------------------------------------------"/>
<antcall target="bvt.junit"/>
<antcall target="bvt.server"/>
<echo message="--------------------------------------------------"/>
<echo message="| NetUI BVT ending |"/>
<echo message="--------------------------------------------------"/>
</target>
<!-- ============================================================= -->
<!-- -->
<!-- Utility targets -->
<!-- -->
<!-- ============================================================= -->
<target name="deploy.netui" description="Deploy the NetUI runtime to a fully-quaflified webapp directory specified with the property 'webapp.dir'">
<available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
<fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
<echo>Deploy NetUI to webapp rooted at: ${webapp.dir}</echo>
<ant dir="${beehive.home}/netui/ant"
antfile="${beehive.home}/netui/ant/webappTemplate.xml"
target="deploy.netui.runtime"
inheritAll="false">
<property name="webapp.dir" value="${webapp.dir}"/>
</ant>
</target>
<target name="create.netui.webapp" description="Utility target that will create a Beehive enabled webapp using the properties webapp.dir">
<fail unless="webapp.dir" message="The ${webapp.dir} property is unset"/>
<mkdir dir="${webapp.dir}"/>
<copy todir="${webapp.dir}" overwrite="true">
<fileset dir="${beehive.home}/netui/build/dist/webapp"/>
</copy>
</target>
<target name="do.subant">
<subant target="${target.name}">
<filelist dir="${src.dir}">
<file name="bootstrap"/>
<file name="compiler-core"/>
<file name="compiler-apt"/>
<file name="tomcat-common"/>
<file name="tomcat-server"/>
<file name="util"/>
<file name="scoping"/>
<file name="core"/>
<file name="pageflow"/>
<file name="tomcat-webapp"/>
<file name="tags-html"/>
<file name="tags-databinding"/>
<file name="tags-template"/>
<file name="jar-assembly"/>
<file name="testRecorder"/>
</filelist>
</subant>
</target>
<target name="build.struts11" description="Build Struts-dependent modules against Struts 1.1">
<subant target="build">
<property name="struts.dependency.path.ref" value="struts11.dependency.path"/>
<filelist dir="${src.dir}">
<file name="bootstrap"/>
<file name="tomcat-common"/>
<file name="tomcat-server"/>
<file name="util"/>
<file name="scoping"/>
<file name="core"/>
<file name="pageflow"/>
<file name="tomcat-webapp"/>
<file name="simple-tags"/>
<file name="tags-html"/>
<file name="tags-databinding"/>
<file name="tags-template"/>
<file name="jar-assembly"/>
</filelist>
</subant>
</target>
<target name="deploy.m2">
<!-- beehive-netui-compiler -->
<copy todir="${build.m2.dir}/beehive-netui-compiler/${beehive.version}">
<mapper type="glob" from="*.jar" to="*-${beehive.version}.jar"/>
<fileset dir="build/jars">
<include name="beehive-netui-compiler.jar"/>
</fileset>
</copy>
<filter token="beehive.version" value="${beehive.version}"/>
<copy todir="${build.m2.dir}/beehive-netui-compiler/${beehive.version}" filtering="true">
<mapper type="glob" from="*.pom" to="*-${beehive.version}.pom"/>
<fileset dir="src/compiler-apt" includes="beehive-netui-compiler.pom"/>
</copy>
<jar destfile="${build.m2.dir}/beehive-netui-compiler/${beehive.version}/beehive-netui-compiler-${beehive.version}-sources.jar">
<fileset dir="src/compiler-apt"/>
<fileset dir="src/compiler-core"/>
</jar>
<!-- beehive-netui-core -->
<copy todir="${build.m2.dir}/beehive-netui-core/${beehive.version}">
<mapper type="glob" from="*.jar" to="*-${beehive.version}.jar"/>
<fileset dir="build/jars">
<include name="beehive-netui-core.jar"/>
</fileset>
</copy>
<filter token="beehive.version" value="${beehive.version}"/>
<copy todir="${build.m2.dir}/beehive-netui-core/${beehive.version}" filtering="true">
<mapper type="glob" from="*.pom" to="*-${beehive.version}.pom"/>
<fileset dir="src/pageflow" includes="beehive-netui-core.pom"/>
</copy>
<jar destfile="${build.m2.dir}/beehive-netui-core/${beehive.version}/beehive-netui-core-${beehive.version}-sources.jar">
<fileset dir="src/util"/>
<fileset dir="src/core"/>
<fileset dir="src/pageflow"/>
<fileset dir="src/scoping"/>
</jar>
<!-- beehive-netui-core -->
<copy todir="${build.m2.dir}/beehive-netui-tags/${beehive.version}">
<mapper type="glob" from="*.jar" to="*-${beehive.version}.jar"/>
<fileset dir="build/jars">
<include name="beehive-netui-tags.jar"/>
</fileset>
</copy>
<filter token="beehive.version" value="${beehive.version}"/>
<copy todir="${build.m2.dir}/beehive-netui-tags/${beehive.version}" filtering="true">
<mapper type="glob" from="*.pom" to="*-${beehive.version}.pom"/>
<fileset dir="src/tags-html" includes="beehive-netui-tags.pom"/>
</copy>
<jar destfile="${build.m2.dir}/beehive-netui-tags/${beehive.version}/beehive-netui-tags-${beehive.version}-sources.jar">
<fileset dir="src/tags-html"/>
<fileset dir="src/tags-databinding"/>
<fileset dir="src/tags-template"/>
</jar>
</target>
</project>