Author: kentam
Date: Wed Oct 20 01:57:37 2004
New Revision: 55139

Modified:
   incubator/beehive/trunk/beehive.properties
   incubator/beehive/trunk/build.xml
   
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ClientInitializer.java
   
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
   
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
   
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
Log:
Distribution build work per the spec at 
http://wiki.apache.org/beehive/Distribution_20Structure

The following top-level commands will build a distribution:

"ant build.dist" : builds an exploded distribution in build/dist
"ant -Dbeehive.version=0.4 build.dist.jar" : builds a distribution JAR in 
build/jars/

The distribution now includes javadocs, but no samples yet. 

+ some minor null vs "" tweaks in the controls compilation code.




Modified: incubator/beehive/trunk/beehive.properties
==============================================================================
--- incubator/beehive/trunk/beehive.properties  (original)
+++ incubator/beehive/trunk/beehive.properties  Wed Oct 20 01:57:37 2004
@@ -21,6 +21,9 @@
 
 ant.jar=${ant.dir}/lib/ant.jar
 
+dist.dir=${beehive.dir}/build/dist
+dist.name=apache-beehive
+
 #
 # While still in the Workshop source tree, these reference
 # JARs that are statically checked-in.

Modified: incubator/beehive/trunk/build.xml
==============================================================================
--- incubator/beehive/trunk/build.xml   (original)
+++ incubator/beehive/trunk/build.xml   Wed Oct 20 01:57:37 2004
@@ -241,12 +241,16 @@
     <!-- Distribution targets                          -->
     <!--                                               -->
     <!-- ============================================= -->
-    <target name="build.dist">
-        <property name="dist.dir" location="${os.BEEHIVE_HOME}/build/dist"/>
 
+    <target name="build.dist" description="Builds a Beehive distribution">
         <mkdir dir="${dist.dir}"/>
         <mkdir dir="${dist.dir}/templates"/>
 
+        <antcall target="build.dist.core"/>
+        <antcall target="build.dist.docs"/>
+    </target>
+
+    <target name="build.dist.core" depends="deploy">
         <!-- copy the required libraries into dist/ -->
         <copy todir="${dist.dir}/lib/common" failOnError="true">
             <fileset file="${log4j.jar}"/>
@@ -302,11 +306,26 @@
         </copy>
 
         <ant dir="build/tmp-dist/${webapp.name}/WEB-INF/src" 
antfile="build.xml" target="build.webapp">
+            <property name="os.BEEHIVE_DIST_HOME" 
location="${os.BEEHIVE_HOME}/build/dist"/>
             <property name="webapp.dir" 
location="${os.BEEHIVE_HOME}/build/tmp-dist/${webapp.name}"/>
         </ant>
 
         <jar destfile="${dist.dir}/templates/${webapp.name}.war" 
basedir="build/tmp-dist/${webapp.name}"/>
         
+    </target>
+
+    <target name="build.dist.docs" depends="docs">
+        <!-- copy javadocs to dist -->
+        <copy todir="${dist.dir}/docs/javadoc" failOnError="true">
+            <fileset dir="controls\build\docs\reference"/>
+            <fileset dir="netui\build\docs\reference"/>
+            <fileset dir="wsm\build\docs\reference"/>
+        </copy>
+    </target>
+
+    <target name="build.dist.jar" depends="build.dist" description="Builds a 
Beehive distribution JAR">
+        <mkdir dir="build/jars"/>
+        <jar destfile="build/jars/${dist.name}-${beehive.version}.jar" 
basedir="${dist.dir}"/>
     </target>
 
     <target name="clean.dist">

Modified: 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ClientInitializer.java
==============================================================================
--- 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ClientInitializer.java
   (original)
+++ 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ClientInitializer.java
   Wed Oct 20 01:57:37 2004
@@ -28,19 +28,19 @@
 public class ClientInitializer extends GenClass
 {
     /**
-     * Constructs a new ClientInitializer class supporting a particular 
control bean implementation
-     * @param beanInterface the public interface associated with the bean
+     * Constructs a new ClientInitializer class
+     * @param controlClient the control client this initializer will target
      */
     protected ClientInitializer(ControlClient controlClient)
     {
         super();
+
+        assert controlClient != null;
+
         _controlClient = controlClient;
-        if (_controlClient != null)
-        {
-            _packageName = _controlClient.getPackage();
-            _shortName = _controlClient.getShortName() + "ClientInitializer";
-            _className = _packageName + "." + _shortName;
-        }
+        _packageName = _controlClient.getPackage();
+        _shortName = _controlClient.getShortName() + "ClientInitializer";
+        _className = isRootPackage() ? _shortName : _packageName + "." + 
_shortName;
 
         //
         // Compute the list of impl fields that will require reflected Fields. 
 This is

Modified: 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
==============================================================================
--- 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
        (original)
+++ 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
        Wed Oct 20 01:57:37 2004
@@ -114,7 +114,7 @@
     public String getPackage()
     {
         if ( _clientDecl == null || _clientDecl.getPackage() == null )
-            return null;
+            return "";
         
         return _clientDecl.getPackage().getQualifiedName();
     }
@@ -125,7 +125,7 @@
     public String getShortName()
     {
         if ( _clientDecl == null )
-            return null;
+            return "";
         
         return _clientDecl.getSimpleName();
     }
@@ -136,7 +136,7 @@
     public String getClassName()
     {
         if ( _clientDecl == null )
-            return null;
+            return "";
         
         assert ( getPackage().equals("") ? 
_clientDecl.getQualifiedName().equals( getShortName() ) :
                 _clientDecl.getQualifiedName().equals( getPackage() + "." + 
getShortName() ) );

Modified: 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
==============================================================================
--- 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
        (original)
+++ 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
        Wed Oct 20 01:57:37 2004
@@ -111,7 +111,7 @@
     public String getPackage()
     {
         if ( _implDecl == null || _implDecl.getPackage() == null )
-            return null;
+            return "";
         
         return _implDecl.getPackage().getQualifiedName();
     }
@@ -122,7 +122,7 @@
     public String getShortName()
     {
         if ( _implDecl == null )
-            return null;
+            return "";
         
         return _implDecl.getSimpleName();
     }
@@ -133,7 +133,7 @@
     public String getClassName()
     {
         if ( _implDecl == null )
-            return null;
+            return "";
         
         assert ( getPackage().equals("") ? 
_implDecl.getQualifiedName().equals( getShortName() ) :
                 _implDecl.getQualifiedName().equals( getPackage() + "." + 
getShortName() ) );

Modified: 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
==============================================================================
--- 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
     (original)
+++ 
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
     Wed Oct 20 01:57:37 2004
@@ -28,13 +28,11 @@
 import com.sun.mirror.declaration.AnnotationMirror;
 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
 import com.sun.mirror.declaration.Declaration;
-import com.sun.mirror.declaration.EnumDeclaration;
 import com.sun.mirror.declaration.InterfaceDeclaration;
 import com.sun.mirror.declaration.MethodDeclaration;
 import com.sun.mirror.declaration.TypeDeclaration;
 import com.sun.mirror.type.DeclaredType;
 import com.sun.mirror.type.InterfaceType;
-import com.sun.mirror.type.TypeMirror;
 
 import org.apache.beehive.controls.api.bean.ControlChecker;
 import org.apache.beehive.controls.api.events.EventSet;
@@ -47,7 +45,6 @@
 import org.apache.beehive.controls.runtime.generator.ControlInterface;
 import org.apache.beehive.controls.runtime.generator.ControlOperation;
 import org.apache.beehive.controls.runtime.generator.ControlPropertySet;
-import org.apache.beehive.controls.runtime.generator.GenClass;
 
 /**
  * REVIEW: does it make sense to define AptControlExtension and/or 
ControlExtension?
@@ -262,6 +259,7 @@
     {
         if ( _intfDecl == null || _intfDecl.getPackage() == null )
             return "";
+
         return _intfDecl.getPackage().getQualifiedName();
     }
 
@@ -272,6 +270,7 @@
     {
         if ( _intfDecl == null )
             return "";
+
         return _intfDecl.getSimpleName();
     }
 
@@ -303,8 +302,8 @@
 
     /**
      * Returns the most-derived interface in the inheritance chain that is 
annotated
-     * with @ControlInterface.  It represents the point in the inheritance 
chain where
-     * @ControlInterface becomes @ControlExtension (i.e., anything interface 
derived from
+     * with @ControlInterface.  It represents the point in the inheritance 
chain
+     * where @ControlInterface becomes @ControlExtension (i.e., anything 
interface derived from
      * the 'most-derived interface' is annotated with @ControlExtension).  May 
return
      * null if the inheritance chain is malformed.
      */

Reply via email to