You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ke...@apache.org on 2004/10/28 01:03:23 UTC

svn commit: rev 55746 - in incubator/beehive/trunk: . samples/controls-blank samples/controls-blank/src samples/controls-blank/src/pkg

Author: kentam
Date: Wed Oct 27 16:03:22 2004
New Revision: 55746

Added:
   incubator/beehive/trunk/samples/controls-blank/
   incubator/beehive/trunk/samples/controls-blank/build.xml   (contents, props changed)
   incubator/beehive/trunk/samples/controls-blank/src/
   incubator/beehive/trunk/samples/controls-blank/src/pkg/
   incubator/beehive/trunk/samples/controls-blank/src/pkg/Hello.java   (contents, props changed)
   incubator/beehive/trunk/samples/controls-blank/src/pkg/HelloImpl.jcs   (contents, props changed)
Modified:
   incubator/beehive/trunk/build.xml
Log:
Adding a blank controls template app.  This makes it easy to build controls -- just copy this template, author controls in it and run "ant build" to produce a JAR with your controls that can be used elsewhere.



Modified: incubator/beehive/trunk/build.xml
==============================================================================
--- incubator/beehive/trunk/build.xml	(original)
+++ incubator/beehive/trunk/build.xml	Wed Oct 27 16:03:22 2004
@@ -304,7 +304,6 @@
 
         <!-- build the project templates in dist/ -->
         <echo>Create the Beehive webapp template</echo>
-        <mkdir dir="${dist.dir}/templates"/>
         <copy todir="build/tmp-dist/${webapp.name}">
             <fileset dir="${os.BEEHIVE_HOME}/netui/build/dist/webapp">
                 <exclude name="WEB-INF/lib/*.jar"/>
@@ -338,6 +337,12 @@
                 <exclude name="WEB-INF/*.tldx"/>
             </fileset>
         </copy>
+
+        <!-- Build the controls blank template app distro -->
+        <copy todir="${dist.dir}/samples/controls-blank" failOnError="true">
+            <fileset dir="samples/controls-blank"/>
+        </copy>
+
     </target>
 
     <target name="build.dist.docs" depends="docs" description="Builds documentation for a Beehive distribution">
@@ -366,14 +371,14 @@
 <!--        <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> -->
 
         <mkdir dir="build/jars"/>
-        <zip destfile="build/jars/${dist.name}.zip" basedir="${dist.dir}"/>
+        <zip destfile="build/jars/${dist.name}.zip" basedir="${dist.base.dir}"/>
     </target>
 
     <target name="build.dist.tgz" description="Builds a Beehive distribution tarball (.tar.gz)">
 <!--        <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> -->
 
         <mkdir dir="build/jars"/>
-        <tar destfile="build/jars/${dist.name}.tar.gz" basedir="${dist.dir}" compression="gzip"/>
+        <tar destfile="build/jars/${dist.name}.tar.gz" basedir="${dist.base.dir}" compression="gzip"/>
     </target>
 
     <target name="build.dist.docs.jar" depends="build.dist" description="Builds a Beehive distribution docs JAR">
@@ -400,6 +405,7 @@
             </condition>
         </fail>
         <echo message="${testDistro.output}"/>
+        <echo message="${testDistro.output}" file="build/jars/testDistro.output"/>
     </target>
 
     <!-- ============================================= -->

Added: incubator/beehive/trunk/samples/controls-blank/build.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/controls-blank/build.xml	Wed Oct 27 16:03:22 2004
@@ -0,0 +1,63 @@
+<?xml version="1.0" ?>
+
+<project name="controls-blank" default="usage">
+
+    <property environment="os"/>
+    <property file="${os.BEEHIVE_HOME}/beehive.properties"/>
+
+    <property name="source.dir" value="${basedir}/src"/>
+    <property name="build.dir" value="${basedir}/build"/>
+    <property name="build.classes" value="${build.dir}/classes"/>
+    <property name="build.beansrc" value="${build.dir}/beansrc"/>
+    <property name="build.jar" value="mycontrols.jar"/>
+
+    <path id="build.classpath">
+        <pathelement location="${tools.jar}"/>
+        <pathelement location="${velocity14.jar}"/>
+        <pathelement location="${velocitydep14.jar}"/>
+        <pathelement location="${controls.jar}"/>
+        <pathelement path="${build.classes}"/>
+    </path>
+
+    <taskdef name="apt" classname="org.apache.beehive.controls.runtime.generator.AptTask" 
+             classpath="${controls.jar}" onerror="report" />
+    <taskdef name="control-jar" 
+             classname="org.apache.beehive.controls.runtime.packaging.ControlJarTask" 
+             classpath="${controls.jar}" onerror="report" />             
+
+    <target name="usage">
+        <echo message=""/>
+        <echo message=""/>
+        <echo message="Controls Template Build file"/>
+        <echo message="================================================================"/>
+        <echo message="|                          Usage                               |"/>
+        <echo message="================================================================"/>
+        <echo message="----------------------------------------------------------------"/>
+        <echo message="|                      Standard Targets                        |"/>
+        <echo message="----------------------------------------------------------------"/>
+        <echo message="clean               - Delete all generated files"/>
+        <echo message="build               - build controls"/>
+        <echo message="----------------------------------------------------------------"/>
+    </target>
+
+    <target name="clean" description="Deletes all generated files">
+        <delete dir="${build.dir}"/>
+        <delete file="velocity.log"/>
+    </target>
+
+    <target name="dirs">
+        <mkdir dir="${build.classes}" />
+        <mkdir dir="${build.beansrc}" />
+    </target>
+
+    <target name="build" depends="dirs" description="Builds controls sources">
+        <apt srcdir="${source.dir}" destdir="${build.classes}" gendir="${build.beansrc}"
+             classpathref="build.classpath"
+             debug="on"
+             compileByExtension="true"
+             srcExtensions="*.java,*.jcx,*.jcs">
+        </apt>
+        <control-jar destfile="${build.dir}/${build.jar}"  basedir="${build.classes}" />
+    </target>
+
+</project>

Added: incubator/beehive/trunk/samples/controls-blank/src/pkg/Hello.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/controls-blank/src/pkg/Hello.java	Wed Oct 27 16:03:22 2004
@@ -0,0 +1,11 @@
+package pkg;
+
+import org.apache.beehive.controls.api.bean.*;
+
+@ControlInterface
+public interface Hello
+{
+    String hello();
+}
+
+

Added: incubator/beehive/trunk/samples/controls-blank/src/pkg/HelloImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/samples/controls-blank/src/pkg/HelloImpl.jcs	Wed Oct 27 16:03:22 2004
@@ -0,0 +1,14 @@
+package pkg;
+
+import org.apache.beehive.controls.api.bean.*;
+
+@ControlImplementation
+public class HelloImpl implements Hello
+{
+    public String hello()
+    {
+        return "hello!";
+    }
+}
+
+