You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2004/10/12 17:52:48 UTC
svn commit: rev 54675 - in incubator/beehive/trunk: . netui test/ant
Author: ekoneil
Date: Tue Oct 12 08:52:48 2004
New Revision: 54675
Added:
incubator/beehive/trunk/test/ant/runTomcatCore.xml (contents, props changed)
Modified:
incubator/beehive/trunk/build.xml
incubator/beehive/trunk/netui/build.xml
incubator/beehive/trunk/test/ant/buildWebapp.xml
incubator/beehive/trunk/test/ant/runTomcat.xml
Log:
Build work in preparation for creating the build/dist directory.
- break runTomcat into two parts -- one that is Beehive specific and one that can be used in the distribution and contains the core tasks for starting / stopping and webapp deployment
- fixup spacing in /build.xml and add "build.dist" target (to be filled in shortly)
- fixup /build.xml to call the NetUI "docs" target as it is invoked in wsm and controls
BB: self
DRT: Beehive pass
BVT: NetUI pass
Modified: incubator/beehive/trunk/build.xml
==============================================================================
--- incubator/beehive/trunk/build.xml (original)
+++ incubator/beehive/trunk/build.xml Tue Oct 12 08:52:48 2004
@@ -1,196 +1,263 @@
<?xml version="1.0"?>
+
<!--
Beehive build file.
-->
<project name="Beehive Build" default="usage" basedir=".">
- <property environment="os"/>
- <property file="beehive.properties"/>
- <!-- Local properties used to specify the installers and the directories into which they should be installed -->
- <property name="tomcat.installer" location="${beehive.external.dir}/tomcat/jakarta-tomcat-5.0.25.zip"/>
- <property name="log4j.installer" location="${beehive.external.dir}/log4j/jakarta-log4j-1.2.8.zip"/>
- <property name="ant.installer" location="${beehive.external.dir}/ant/apache-ant-1.6.2-bin.zip"/>
- <property name="jsr173.installer" location="${beehive.external.dir}/xmlbeans/jsr173_api.jar"/>
- <target name="bootstrap" depends="ensure.proxysettings" description="Install external dependencies to the installed/ directory">
- <antcall target="install.deps"/>
- <ant dir="test/ant" antfile="runTomcat.xml" target="reset.config"/>
- <!--
+
+ <property environment="os"/>
+ <property file="beehive.properties"/>
+
+ <!-- Local properties used to specify the installers and the directories into which they should be installed -->
+ <property name="tomcat.installer" location="${beehive.external.dir}/tomcat/jakarta-tomcat-5.0.25.zip"/>
+ <property name="log4j.installer" location="${beehive.external.dir}/log4j/jakarta-log4j-1.2.8.zip"/>
+ <property name="ant.installer" location="${beehive.external.dir}/ant/apache-ant-1.6.2-bin.zip"/>
+ <property name="jsr173.installer" location="${beehive.external.dir}/xmlbeans/jsr173_api.jar"/>
+
+ <target name="bootstrap" depends="ensure.proxysettings" description="Install external dependencies to the installed/ directory">
+ <antcall target="install.deps"/>
+ <ant dir="test/ant" antfile="runTomcat.xml" target="reset.config"/>
+ <!--
in order to run JUnit tests that use the <junit> Ant task,
the junit.jar file needs to be available in $ANT_HOME/lib
-->
- <copy file="${junit.jar}" todir="${os.ANT_HOME}/lib"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Build targets -->
- <!-- -->
- <!-- ============================================= -->
- <target name="clean" description="Clean Beehive">
- <ant dir="controls" target="clean" inheritAll="false"/>
- <ant dir="netui" target="clean" inheritAll="false"/>
- <ant dir="wsm" target="clean" inheritAll="false"/>
- </target>
- <target name="deploy" description="Deploy Beehive">
- <ant dir="controls" target="build" inheritAll="false"/>
- <ant dir="netui" target="deploy" inheritAll="false"/>
- <ant dir="wsm" target="deploy" inheritAll="false"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Test targets -->
- <!-- -->
- <!-- ============================================= -->
- <target name="drt" description="Run the Beehive DRT suite">
- <antcall target="controls.drt"/>
- <antcall target="netui.drt"/>
- <antcall target="wsm.drt"/>
- </target>
- <target name="controls.drt" description="Run the Beehive/Controls DRT suite">
- <ant dir="controls" target="drt" inheritAll="false"/>
- </target>
- <target name="netui.drt" description="Run the Beehive/NetUI DRT suite">
- <ant dir="netui" antfile="build.xml" target="drt" inheritAll="false"/>
- </target>
- <target name="wsm.drt" description="Run the Beehive/WSM DRT suite">
- <ant dir="wsm" target="drt" inheritAll="false"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Installation targets. These are used to -->
- <!-- install external products that Beehive -->
- <!-- depends on to build or test. -->
- <!-- -->
- <!-- ============================================= -->
- <target name="install.deps" description="Ensure that the external dependencies (Tomcat, etc) have been installed locally">
- <antcall target="ensure.ant"/>
- <antcall target="ensure.tomcat"/>
- <antcall target="ensure.log4j"/>
- <antcall target="ensure.jsr173"/>
- </target>
- <target name="uninstall.deps" description="Uninstall the external dependencies">
- <delete dir="${beehive.installed.dir}"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Tomcat -->
- <!-- -->
- <!-- ============================================= -->
- <target name="ensure.tomcat">
- <echo>Ensuring Tomcat present in directory: ${beehive.installed.dir}</echo>
- <available file="${tomcat.dir}" type="dir" property="tomcat.present"/>
- <echo>tomcat.present: ${tomcat.present}</echo>
- <antcall target="unzip.tomcat"/>
- </target>
- <target name="unzip.tomcat" unless="tomcat.present">
- <echo>Unzipping Tomcat to directory: ${beehive.installed.dir} from installer ${tomcat.installer}</echo>
- <unzip src="${tomcat.installer}" dest="${beehive.installed.dir}"/>
- <chmod dir="${tomcat.dir}/bin" perm="755" includes="**/*.sh"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Log4J -->
- <!-- -->
- <!-- ============================================= -->
- <target name="ensure.log4j">
- <echo>Ensuring Log4J present in directory: ${beehive.installed.dir}</echo>
- <available file="${log4j.dir}" type="dir" property="log4j.present"/>
- <echo>log4j.present: ${log4j.present}</echo>
- <antcall target="unzip.log4j"/>
- </target>
- <target name="unzip.log4j" unless="log4j.present">
- <echo>Unzipping Log4J to directory: ${beehive.installed.dir} from installer ${log4j.installer}</echo>
- <unzip src="${log4j.installer}" dest="${beehive.installed.dir}"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Ant -->
- <!-- -->
- <!-- ============================================= -->
- <target name="ensure.ant">
- <echo>Ensuring Ant present in directory: ${beehive.installed.dir}</echo>
- <available file="${ant.dir}" type="dir" property="ant.present"/>
- <echo>ant.present: ${ant.present}</echo>
- <antcall target="unzip.ant"/>
- </target>
- <target name="unzip.ant" unless="ant.present">
- <echo>Unzipping Ant to directory: ${beehive.installed.dir} from installer ${ant.installer}</echo>
- <unzip src="${ant.installer}" dest="${beehive.installed.dir}"/>
- <chmod dir="${beehive.installed.dir}/apache-ant-1.6.2/bin" perm="755" includes="**/*.sh"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- JSR 173 == this is required by XMLBeans and -->
- <!-- needs to be downloaded from the net. -->
- <!-- -->
- <!-- ============================================= -->
- <target name="ensure.jsr173">
- <echo>Ensuring JSR 173 present in directory: ${beehive.installed.dir}</echo>
- <available file="${jsr173.jar}" type="file" property="jsr173.present"/>
- <echo>jsr173.present: ${jsr173.present}</echo>
- <antcall target="get.jsr173"/>
- </target>
- <target name="get.jsr173" unless="jsr173.present">
- <mkdir dir="${beehive.external.dir}/xmlbeans"/>
- <get dest="${jsr173.installer}" src="http://workshop.bea.com/xmlbeans/jsr173v1/jsr173.jar" verbose="true" usetimestamp="true" ignoreerrors="false"/>
- <unzip src="${jsr173.installer}" dest="${beehive.installed.dir}/jsr173"/>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Proxy Setup Targets. -->
- <!-- -->
- <!-- These settings are used if a proxy needs to -->
- <!-- be used when downloading third party software -->
- <!-- on which Beehive depends. See BUILDING.txt -->
- <!-- for more information. -->
- <!-- -->
- <!-- ============================================= -->
- <target name="ensure.proxysettings">
- <echo>Check to see if proxy setup is required</echo>
- <condition property="proxy.needed">
- <and>
- <isset property="os.PROXYHOST"/>
- </and>
- </condition>
- <condition property="socks.proxy.needed" value="true">
- <and>
- <isset property="os.SOCKSPROXYHOST"/>
- </and>
- </condition>
- <antcall target="set.proxy"/>
- <antcall target="set.socks.proxy"/>
- </target>
- <target name="set.proxy" if="proxy.needed">
- <echo>Proxy setup needed.</echo>
- <echo>Proxy host: ${os.PROXYHOST}</echo>
- <echo>Proxy port: ${os.PROXYPORT}</echo>
- <echo>Proxy user: ${os.PROXYUSER}</echo>
- <echo>Proxy password: ${os.PROXYPASSWORD}</echo>
- <echo>Non proxy hosts: ${os.NONPROXYHOSTS}</echo>
- <setproxy proxyhost="${os.PROXYHOST}" proxyport="${os.PROXYPORT}" proxyuser="${os.PROXYUSER}" proxypassword="${os.PROXYPASSWORD}" nonproxyhosts="${os.NONPROXYHOSTS}"/>
- </target>
- <target name="set.socks.proxy" if="socks.proxy.needed">
- <echo>Socks Proxy setup needed.</echo>
- <setproxy socksproxyhost="${os.SOCKSPROXYHOST}" socksproxyport="${os.SOCKSPROXYPORT}"/>
- </target>
- <target name="usage" description="Print the usage for this build.xml">
- <java fork="no" classname="org.apache.tools.ant.Main">
- <arg line="-projecthelp"/>
- </java>
- </target>
- <!-- ============================================= -->
- <!-- -->
- <!-- Documentation targets -->
- <!-- -->
- <!-- ============================================= -->
- <target name="docs">
- <ant dir="controls" target="docs" inheritAll="false"/>
- <ant dir="netui/ant" antfile="javadoc.xml" target="build" inheritAll="false"/>
- <ant dir="wsm" target="docs" inheritAll="false"/>
- </target>
- <target name="copy-to-forrest">
- <copy todir="site\src\documentation\content\reference" overwrite="true">
- <fileset dir="controls\build\docs\reference"/>
- <fileset dir="netui\build\docs\reference"/>
- <fileset dir="wsm\build\docs\reference"/>
- </copy>
- </target>
+ <copy file="${junit.jar}" todir="${os.ANT_HOME}/lib"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Build targets -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="clean" description="Clean Beehive">
+ <ant dir="controls" target="clean" inheritAll="false"/>
+ <ant dir="netui" target="clean" inheritAll="false"/>
+ <ant dir="wsm" target="clean" inheritAll="false"/>
+ </target>
+
+ <target name="deploy" description="Deploy Beehive">
+ <ant dir="controls" target="build" inheritAll="false"/>
+ <ant dir="netui" target="deploy" inheritAll="false"/>
+ <ant dir="wsm" target="deploy" inheritAll="false"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Test targets -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="drt" description="Run the Beehive DRT suite">
+ <antcall target="controls.drt"/>
+ <antcall target="netui.drt"/>
+ <antcall target="wsm.drt"/>
+ </target>
+
+ <target name="controls.drt" description="Run the Beehive/Controls DRT suite">
+ <ant dir="controls" target="drt" inheritAll="false"/>
+ </target>
+
+ <target name="netui.drt" description="Run the Beehive/NetUI DRT suite">
+ <ant dir="netui" antfile="build.xml" target="drt" inheritAll="false"/>
+ </target>
+
+ <target name="wsm.drt" description="Run the Beehive/WSM DRT suite">
+ <ant dir="wsm" target="drt" inheritAll="false"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Installation targets. These are used to -->
+ <!-- install external products that Beehive -->
+ <!-- depends on to build or test. -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="install.deps" description="Ensure that the external dependencies (Tomcat, etc) have been installed locally">
+ <antcall target="ensure.ant"/>
+ <antcall target="ensure.tomcat"/>
+ <antcall target="ensure.log4j"/>
+ <antcall target="ensure.jsr173"/>
+ </target>
+
+ <target name="uninstall.deps" description="Uninstall the external dependencies">
+ <delete dir="${beehive.installed.dir}"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Tomcat -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="ensure.tomcat">
+ <echo>Ensuring Tomcat present in directory: ${beehive.installed.dir}</echo>
+ <available file="${tomcat.dir}" type="dir" property="tomcat.present"/>
+ <echo>tomcat.present: ${tomcat.present}</echo>
+ <antcall target="unzip.tomcat"/>
+ </target>
+
+ <target name="unzip.tomcat" unless="tomcat.present">
+ <echo>Unzipping Tomcat to directory: ${beehive.installed.dir} from installer ${tomcat.installer}</echo>
+ <unzip src="${tomcat.installer}" dest="${beehive.installed.dir}"/>
+ <chmod dir="${tomcat.dir}/bin" perm="755" includes="**/*.sh"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Log4J -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="ensure.log4j">
+ <echo>Ensuring Log4J present in directory: ${beehive.installed.dir}</echo>
+ <available file="${log4j.dir}" type="dir" property="log4j.present"/>
+ <echo>log4j.present: ${log4j.present}</echo>
+ <antcall target="unzip.log4j"/>
+ </target>
+
+ <target name="unzip.log4j" unless="log4j.present">
+ <echo>Unzipping Log4J to directory: ${beehive.installed.dir} from installer ${log4j.installer}</echo>
+ <unzip src="${log4j.installer}" dest="${beehive.installed.dir}"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Ant -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="ensure.ant">
+ <echo>Ensuring Ant present in directory: ${beehive.installed.dir}</echo>
+ <available file="${ant.dir}" type="dir" property="ant.present"/>
+ <echo>ant.present: ${ant.present}</echo>
+ <antcall target="unzip.ant"/>
+ </target>
+
+ <target name="unzip.ant" unless="ant.present">
+ <echo>Unzipping Ant to directory: ${beehive.installed.dir} from installer ${ant.installer}</echo>
+ <unzip src="${ant.installer}" dest="${beehive.installed.dir}"/>
+ <chmod dir="${beehive.installed.dir}/apache-ant-1.6.2/bin" perm="755" includes="**/*.sh"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- JSR 173 == this is required by XMLBeans and -->
+ <!-- needs to be downloaded from the net. -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="ensure.jsr173">
+ <echo>Ensuring JSR 173 present in directory: ${beehive.installed.dir}</echo>
+ <available file="${jsr173.jar}" type="file" property="jsr173.present"/>
+ <echo>jsr173.present: ${jsr173.present}</echo>
+ <antcall target="get.jsr173"/>
+ </target>
+
+ <target name="get.jsr173" unless="jsr173.present">
+ <mkdir dir="${beehive.external.dir}/xmlbeans"/>
+ <get dest="${jsr173.installer}"
+ src="http://workshop.bea.com/xmlbeans/jsr173v1/jsr173.jar"
+ verbose="true"
+ usetimestamp="true"
+ ignoreerrors="false"/>
+ <unzip src="${jsr173.installer}" dest="${beehive.installed.dir}/jsr173"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Proxy Setup Targets. -->
+ <!-- -->
+ <!-- These settings are used if a proxy needs to -->
+ <!-- be used when downloading third party software -->
+ <!-- on which Beehive depends. See BUILDING.txt -->
+ <!-- for more information. -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="ensure.proxysettings">
+ <echo>Check to see if proxy setup is required</echo>
+
+ <condition property="proxy.needed">
+ <and>
+ <isset property="os.PROXYHOST"/>
+ </and>
+ </condition>
+ <condition property="socks.proxy.needed" value="true">
+ <and>
+ <isset property="os.SOCKSPROXYHOST"/>
+ </and>
+ </condition>
+
+ <antcall target="set.proxy"/>
+ <antcall target="set.socks.proxy"/>
+ </target>
+
+ <target name="set.proxy" if="proxy.needed">
+ <echo>Proxy setup needed.</echo>
+ <echo>Proxy host: ${os.PROXYHOST}</echo>
+ <echo>Proxy port: ${os.PROXYPORT}</echo>
+ <echo>Proxy user: ${os.PROXYUSER}</echo>
+ <echo>Proxy password: ${os.PROXYPASSWORD}</echo>
+ <echo>Non proxy hosts: ${os.NONPROXYHOSTS}</echo>
+
+ <setproxy proxyhost="${os.PROXYHOST}"
+ proxyport="${os.PROXYPORT}"
+ proxyuser="${os.PROXYUSER}"
+ proxypassword="${os.PROXYPASSWORD}"
+ nonproxyhosts="${os.NONPROXYHOSTS}"/>
+ </target>
+
+ <target name="set.socks.proxy" if="socks.proxy.needed">
+ <echo>Socks Proxy setup needed.</echo>
+ <setproxy socksproxyhost="${os.SOCKSPROXYHOST}" socksproxyport="${os.SOCKSPROXYPORT}"/>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Documentation targets -->
+ <!-- -->
+ <!-- ============================================= -->
+
+ <target name="docs" description="Generate the Beehive documentation">
+ <ant dir="controls" target="docs" inheritAll="false"/>
+ <ant dir="netui" target="docs" inheritAll="false"/>
+ <ant dir="wsm" target="docs" inheritAll="false"/>
+ </target>
+
+ <target name="copy-to-forrest" description="Copy the documentation to forrest">
+ <copy todir="site\src\documentation\content\reference" overwrite="true">
+ <fileset dir="controls\build\docs\reference"/>
+ <fileset dir="netui\build\docs\reference"/>
+ <fileset dir="wsm\build\docs\reference"/>
+ </copy>
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Distribution targets -->
+ <!-- -->
+ <!-- ============================================= -->
+ <target name="build.dist">
+ <mkdir dir="build/dist"/>
+
+ <!-- copy the required libraries into dist/ -->
+
+ <!-- copy the required Ant build files dist/ -->
+
+ <!-- build the project templates in dist/ -->
+ </target>
+
+ <!-- ============================================= -->
+ <!-- -->
+ <!-- Default usage target -->
+ <!-- -->
+ <!-- ============================================= -->
+ <target name="usage" description="Print the usage for this build.xml">
+ <java fork="no" classname="org.apache.tools.ant.Main">
+ <arg line="-projecthelp"/>
+ </java>
+ </target>
+
</project>
Modified: incubator/beehive/trunk/netui/build.xml
==============================================================================
--- incubator/beehive/trunk/netui/build.xml (original)
+++ incubator/beehive/trunk/netui/build.xml Tue Oct 12 08:52:48 2004
@@ -9,7 +9,7 @@
<property file="${os.BEEHIVE_HOME}/beehive.properties"/>
<target name="docs" description="Generate NetUI Javadoc and JSP tag doc.">
- <ant dir="ant" target="build" antfile="${os.BEEHIVE_HOME}/netui/ant/javadoc.xml"/>
+ <ant dir="ant" target="build" antfile="${os.BEEHIVE_HOME}/netui/ant/javadoc.xml" inheritAll="false"/>
</target>
<target name="build" description="Compiles and builds the server bits of NetUI.">
Modified: incubator/beehive/trunk/test/ant/buildWebapp.xml
==============================================================================
--- incubator/beehive/trunk/test/ant/buildWebapp.xml (original)
+++ incubator/beehive/trunk/test/ant/buildWebapp.xml Tue Oct 12 08:52:48 2004
@@ -4,6 +4,7 @@
<property environment="os"/>
<property file="${os.BEEHIVE_HOME}/beehive.properties"/>
+ <property name="velocity.jar" location="${velocity14.jar}"/>
<import file="buildWebappCore.xml"/>
Modified: incubator/beehive/trunk/test/ant/runTomcat.xml
==============================================================================
--- incubator/beehive/trunk/test/ant/runTomcat.xml (original)
+++ incubator/beehive/trunk/test/ant/runTomcat.xml Tue Oct 12 08:52:48 2004
@@ -5,63 +5,17 @@
<property environment="os"/>
<property file="${os.BEEHIVE_HOME}/beehive.properties"/>
- <property name="catalina-ant.jar" location="${tomcat.dir}/server/lib/catalina-ant.jar"/>
+ <!-- define properties needed for runTomcatCore -->
<property name="catalina.username" value="manager"/>
<property name="catalina.password" value="manager"/>
- <property name="default.tomcat-users.xml" value="${beehive.test.dir}/conf/tomcat-users.xml"/>
-
- <target name="deploy" description="Deploy a webapp to a running Tomcat server">
- <fail unless="context.path" message="Can't deploy webapp; the value ${context.path} was unspecified"/>
- <fail unless="webapp.root" message="Can't deploy webapp; the value ${webapp.name} was unspecified"/>
-
- <available property="webapp.available" file="${webapp.root}" type="dir"/>
- <fail unless="webapp.available" message="The webapp at ${webapp.root} does not exist."/>
-
- <property name="_url" value="file://${webapp.root}"/>
- <echo>deploy webapp from ${_url} with context path ${context.path}</echo>
-
- <taskdef name="tomcatdeploy" classname="org.apache.catalina.ant.DeployTask" classpath="${catalina-ant.jar}"/>
- <tomcatdeploy path="/${context.path}" localWar="${_url}" username="${catalina.username}" password="${catalina.password}"/>
- </target>
-
- <target name="undeploy" description="Undeploy a webapp running on a Tomcat server">
- <fail unless="context.path" message="Can't undeploy webapp; the value ${context.path} was unspecified"/>
-
- <taskdef name="tomcatundeploy" classname="org.apache.catalina.ant.UndeployTask" classpath="${catalina-ant.jar}"/>
- <tomcatundeploy path="/${context.path}" username="${catalina.username}" password="${catalina.password}"/>
- </target>
-
- <target name="redeploy" description="Redeploy a webapp already running on a Tomcat server">
- <fail unless="context.path" message="Can't undeploy webapp; the value ${context.path} was unspecified"/>
-
- <taskdef name="tomcatreload" classname="org.apache.catalina.ant.ReloadTask" classpath="${catalina-ant.jar}"/>
- <tomcatreload path="/${context.path}" username="${catalina.username}" password="${catalina.password}"/>
- </target>
-
- <target name="start" depends="ensure.tomcat" description="Start a Tomcat instance.">
-
- <condition property="cmdline.options" value="">
- <not><isset property="cmdline.options"/></not>
- </condition>
-
- <condition property="java.options" value="">
- <not><isset property="java.options"/></not>
- </condition>
+ <property name="tomcat.home" location="${tomcat.dir}"/>
+ <property name="catalina-ant.jar" location="${tomcat.dir}/server/lib/catalina-ant.jar"/>
- <echo>startup.dir: ${tomcat.dir}/bin</echo>
- <echo>cmdline.options: ${cmdline.options}</echo>
- <echo>java.options: ${java.options}</echo>
+ <!-- import runTomcatCore tasks -->
+ <import file="runTomcatCore.xml"/>
- <echo>Start Tomcat</echo>
- <exec os="Windows 2000,Windows 2003,Windows XP" dir="${tomcat.dir}\bin" executable="cmd.exe">
- <env key="JAVA_OPTS" value="${java.options}"/>
- <arg line="/c startup.bat ${cmdline.options}"/>
- </exec>
- <exec os="Linux,SunOS,Solaris" dir="${tomcat.dir}/bin" executable="sh">
- <env key="JAVA_OPTS" value="${java.options}"/>
- <arg line="startup.sh ${cmdline.options}"/>
- </exec>
- </target>
+ <!-- define properties needed local targets -->
+ <property name="default.tomcat-users.xml" location="${beehive.test.dir}/conf/tomcat-users.xml"/>
<target name="start.with.shmem" depends="ensure.tomcat" description="Start a Tomcat instance.">
@@ -86,17 +40,6 @@
<env key="JAVA_OPTS" value="${java.options}"/>
<arg line="startup.sh jpda start ${cmdline.options}"/>
</exec>
- </target>
-
- <target name="stop" description="Stop the NetUI server">
- <echo>Stop Tomcat in: ${tomcat.dir}</echo>
- <exec os="Windows 2000,Windows 2003,Windows XP" dir="${tomcat.dir}\bin" executable="cmd.exe">
- <arg line=" /c shutdown"/>
- </exec>
-
- <exec os="Linux,SunOS,Solaris" dir="${tomcat.dir}/bin" executable="sh">
- <arg line="shutdown.sh"/>
- </exec>
</target>
<target name="reset.config" description="Reset the Tomcat configuration to the 'default' test state">
Added: incubator/beehive/trunk/test/ant/runTomcatCore.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/test/ant/runTomcatCore.xml Tue Oct 12 08:52:48 2004
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+
+<!--
+ Expected properties:
+ - catalina-ant.jar
+ - catalina.username
+ - catalina.password
+ - tomcat.home
+-->
+<project name="Beehive/NetUI/RunTomcatWebapps" default="usage" basedir=".">
+
+ <target name="deploy" description="Deploy a webapp to a running Tomcat server">
+ <fail unless="context.path" message="Can't deploy webapp; the value ${context.path} was unspecified"/>
+ <fail unless="webapp.root" message="Can't deploy webapp; the value ${webapp.name} was unspecified"/>
+
+ <available property="webapp.available" file="${webapp.root}" type="dir"/>
+ <fail unless="webapp.available" message="The webapp at ${webapp.root} does not exist."/>
+
+ <property name="_url" value="file://${webapp.root}"/>
+ <echo>deploy webapp from ${_url} with context path ${context.path}</echo>
+
+ <taskdef name="tomcatdeploy" classname="org.apache.catalina.ant.DeployTask" classpath="${catalina-ant.jar}"/>
+ <tomcatdeploy path="/${context.path}" localWar="${_url}" username="${catalina.username}" password="${catalina.password}"/>
+ </target>
+
+ <target name="undeploy" description="Undeploy a webapp running on a Tomcat server">
+ <fail unless="context.path" message="Can't undeploy webapp; the value ${context.path} was unspecified"/>
+
+ <taskdef name="tomcatundeploy" classname="org.apache.catalina.ant.UndeployTask" classpath="${catalina-ant.jar}"/>
+ <tomcatundeploy path="/${context.path}" username="${catalina.username}" password="${catalina.password}"/>
+ </target>
+
+ <target name="redeploy" description="Redeploy a webapp already running on a Tomcat server">
+ <fail unless="context.path" message="Can't undeploy webapp; the value ${context.path} was unspecified"/>
+
+ <taskdef name="tomcatreload" classname="org.apache.catalina.ant.ReloadTask" classpath="${catalina-ant.jar}"/>
+ <tomcatreload path="/${context.path}" username="${catalina.username}" password="${catalina.password}"/>
+ </target>
+
+ <target name="start" depends="ensure.tomcat" description="Start a Tomcat instance.">
+
+ <condition property="cmdline.options" value="">
+ <not><isset property="cmdline.options"/></not>
+ </condition>
+
+ <condition property="java.options" value="">
+ <not><isset property="java.options"/></not>
+ </condition>
+
+ <echo>startup.dir: ${tomcat.home}/bin</echo>
+ <echo>cmdline.options: ${cmdline.options}</echo>
+ <echo>java.options: ${java.options}</echo>
+
+ <echo>Start Tomcat</echo>
+ <exec os="Windows 2000,Windows 2003,Windows XP" dir="${tomcat.home}\bin" executable="cmd.exe">
+ <env key="JAVA_OPTS" value="${java.options}"/>
+ <arg line="/c startup.bat ${cmdline.options}"/>
+ </exec>
+ <exec os="Linux,SunOS,Solaris" dir="${tomcat.home}/bin" executable="sh">
+ <env key="JAVA_OPTS" value="${java.options}"/>
+ <arg line="startup.sh ${cmdline.options}"/>
+ </exec>
+ </target>
+
+ <target name="stop" description="Stop the NetUI server">
+ <echo>Stop Tomcat in: ${tomcat.home}</echo>
+ <exec os="Windows 2000,Windows 2003,Windows XP" dir="${tomcat.home}\bin" executable="cmd.exe">
+ <arg line=" /c shutdown"/>
+ </exec>
+
+ <exec os="Linux,SunOS,Solaris" dir="${tomcat.home}/bin" executable="sh">
+ <arg line="shutdown.sh"/>
+ </exec>
+ </target>
+
+</project>
\ No newline at end of file