Recap:

I find when I run my master build script xdoclet always forces the generation
source code. I have set the xdoclet.force property to false but no luck
there.
I have checked to ensure the source files are generated in the
expected directory and as far as possible I have checked the master build
to see
if it touches the source files, triggering source generation. I am quite
stuck now
any help would be most appreciated.

When running the sub build file xdoclet behaves correctly and does not
regenerate
source files.

My build structure and files are as follows:

projectdir
    |
    |---xiapp
    |    |build.xml (The master build file)
    |    |
    |    |---etc
    |         |
    |         |---xml
    |              modules.xml
    |
    |---securityStatusBean
    |       |build.xml (A sub build)
    |       |
    |       |---build
    |            |
    |            |---src (source files are generated into this directory)
    |            |---securitystatus.jar
    |
    |---share
    |     |
    |     |---xml
    |          shared_properties.xml

Master build script:

<?xml version="1.0"?>
<!DOCTYPE project [
    <!ENTITY shared_properties SYSTEM "../share/xml/shared_properties.xml">
    <!ENTITY modules SYSTEM "./etc/xml/modules.xml">
]>

<!--
 ant build file for Xensia application
 Auther Hussein H Badakhchani
 -->

<project name="xibms" default="build" basedir=".">

    <description>
        XIBMS application
    </description>

    <!-- Inline the shared_properties xml file -->
    &shared_properties;

    <!-- Inline the shared_properties xml file -->
    &modules;

    <!-- The default platform property file describes the dev environment 
  -->
    <property name="platform" value="local"/>

    <!--
     Just redo the ear file
     -->
    <target name="dev" depends="makeear, deploy"/>

    <!--
     Recreate all from scratch and redeploy
     -->
    <target name="cleandeploy" depends="clean, build, deploy"/>

    <!--
     Create the time stamp
     -->
    <target name="init">
        <tstamp/>
    </target>

    <!--
     dependants
     -->
    <target name="dependants"
            description="  - calls dependant modules build scripts">
        <property name="target" value="export"/>
        <antcall target="modules"/>
    </target>

    <!--
     Build
     -->
    <target name="build" depends="init, dependants, ear, deploy"
            description="  - (build)s the Xensia application server">
        <buildnumber file="version"/>
    </target>

    <!--
     Clean build
     -->
    <target name="clean" description="  - (clean)s the build">
        <echo message="${ant.project.name}"/>
        <delete dir="${build.dir}"/>
        <delete dir="${dist.dir}"/>
        <delete file="${share.lib.dir}/${ant.project.name}.ear"/>
        <!--delete file="${deploy.dir}/${ant.project.name}.ear"/-->
        <property name="target" value="clean"/>
        <antcall target="modules">
        </antcall>
    </target>


    <!--
     ear
     -->
    <target name="ear" depends="makeear, dependants"/>

    <target name="makeear"
            description="  - Create a generic (ear) file">
        <mkdir dir="${build.dir}/${ant.project.name}.ear"/>
        <mkdir dir="${build.dir}/${ant.project.name}.ear/lib"/>

        <copy todir="${build.dir}/${ant.project.name}.ear/lib" flatten="yes">
            <fileset dir="../">
                <include name="**/build/util.jar"/>
                <include name="**/build/common.jar"/>
            </fileset>
        </copy>

        <!--copy todir="${build.dir}/${ant.project.name}.ear" flatten="no">
            <fileset dir="../action/build" excludes="**/src/**"/>
            <fileset dir="../address/build" excludes="**/src/**"/>
            <fileset dir="../addresstype/build" excludes="**/src/**"/>
            <fileset dir="../asset/build" excludes="**/src/**"/>
            <fileset dir="../assettype/build" excludes="**/src/**"/>
            <fileset dir="../building/build" excludes="**/src/**"/>
            <fileset dir="../buildingtype/build" excludes="**/src/**"/>
            <fileset dir="../controller/build" excludes="**/src/**"/>
            <fileset dir="../country/build" excludes="**/src/**"/>
            <fileset dir="../demo/build" excludes="**/src/**"/>
            <fileset dir="../dimension/build" excludes="**/src/**"/>
            <fileset dir="../error/build" excludes="**/src/**"/>
            <fileset dir="../floor/build" excludes="**/src/**"/>
            <fileset dir="../note/build" excludes="**/src/**"/>
            <fileset dir="../notetype/build" excludes="**/src/**"/>
            <fileset dir="../position/build" excludes="**/src/**"/>
            <fileset dir="../priority/build" excludes="**/src/**"/>
            <fileset dir="../securitystatus/build" excludes="**/src/**"/>
            <fileset dir="../spaceregion/build" excludes="**/src/**"/>
            <fileset dir="../spaceregiontype/build" excludes="**/src/**"/>
            <fileset dir="../task/build" excludes="**/src/**"/>
            <fileset dir="../tasktype/build" excludes="**/src/**"/>
            <fileset dir="../user/build" excludes="**/src/**"/>
            <fileset dir="../view/build" excludes="**/src/**"/>
            <fileset dir="../warranty/build" excludes="**/src/**"/>
            <fileset dir="../website/build" excludes="**/src/**"/>
        </copy>
        <copy file="${dd.dir}/application.xml"
todir="${build.dir}/${ant.project.name}.ear/META-INF"/-->
    </target>

    <!--
     configure
     -->
    <target name="configure" description="  - (configure)s the build using
platform system property">
        <mkdir dir="${build.dir}/work"/>
        <unjar src="${build.dir}/${ant.project.name}.ear"
dest="${build.dir}/work"/>
        <copy todir="${build.dir}/work/META-INF">
            <fileset dir="${build.dir}/work/META-INF">
                <include name="application.xml"/>
            </fileset>
            <filterset filtersfile="${share.conf.dir}/${platform}.conf"/>
        </copy>
        <ear earfile="${build.dir}/${ant.project.name}.ear"
basedir="${build.dir}/work"
             appxml="${build.dir}/work/META-INF/application.xml"
update="yes"/>
    </target>

    <!--
     deploy
     -->
    <target name="deploy" description="  - (deploy)s the application on to
J2EE container">
        <!--delete dir="${deploy.dir}/${ant.project.name}.ear"/>
        <copy todir="${deploy.dir}" overwrite="yes">
            <fileset dir="${build.dir}"/>
        </copy-->
    </target>

    <!--
     Test
     -->
    <target name="test"
            description="  - calls dependant modules build scripts">
    </target>

    <!--
     Generate javadocs of src.dir
     -->
    <target name="doc" description="  - generates java(doc) for EngineBean">
        <mkdir dir="${build.javadoc.dir}"/>
        <path id="srcpath">
            <pathelement path="../enterbean/src"/>
            <dirset dir="..">
                <include name="**/src/"/>
                <exclude name="**/beantemplate/**"/>
                <exclude name="**/servlettemplate/**"/>
            </dirset>
        </path>

        <path id="classpath">
            <fileset dir="${share.lib.dir}">
                <include name="*.jar"/>
            </fileset>
        </path>

        <javadoc packagenames="com.xensia.*" sourcepathref="srcpath"
                 classpathref="classpath" destdir="${build.javadoc.dir}"
                 author="true" version="true" use="true"
                 windowtitle="${ant.project.name} API"/>
    </target>

</project>

Shared Properties xml:

<!-- =================================================================== -->
<!-- Module directory structures are referenced via the aliases          -->
<!-- described here.                                                     -->
<!-- =================================================================== -->

<!-- Static directories -->
<!--property name="base.dir" location="."/-->
<property name="lib.dir" location="${basedir}/lib"/>
<property name="build.dir" location="${basedir}/build"/>
<property name="src.dir" location="${basedir}/src"/>
<property name="etc.dir" location="${basedir}/etc"/>
<property name="dist.dir" location="${basedir}/dist"/>

<!-- Created directories -->
<property name="build.etc.dir" location="${build.dir}/etc"/>
<property name="build.log.dir" location="${build.dir}/log"/>
<property name="build.lib.dir" location="${build.dir}/lib"/>

<!-- Web application properties -->
<property name="gensrc.dir" location="${basedir}/gensrc"/>
<property name="webapp.dir" location="${build.dir}/${ant.project.name}.war"/>
<property name="build.classes.dir"
location="${build.dir}/${ant.project.name}"/>
<property name="ejb.classes.dir" location="${build.classes.dir}.jar"/>
<property name="war.classes.dir" location="${build.classes.dir}.war"/>
<property name="build.webinf.dir" location="${webapp.dir}/WEB-INF"/>
<property name="build.javadoc.dir" location="${build.dir}/doc"/>
<property name="build.src.dir" location="${build.dir}/src"/>
<property name="ejb.dd.dir" location="${ejb.classes.dir}/META-INF"/>
<property name="web.dd.dir" location="${war.classes.dir}/META-INF"/>
<property name="build.webapp.classes"
location="${build.webinf.dir}/classes"/>
<property name="build.gensrc.dir" location="${build.dir}/gensrc"/>
<property name="share.lib.dir" location="../share/lib"/>
<property name="share.conf.dir" location="../share/conf"/>
<property name="share.xml.dir" location="../share/xml"/>
<property name="share.sql.dir" location="../share/sql"/>
<property name="dd.dir" location="${etc.dir}/descriptor"/>
<property name="dtd.dir" location="${share.xml.dir}"/>
<property name="conf.dir" location="${etc.dir}/conf"/>
<property name="sql.dir" location="${basedir}/sql"/>
<property name="report.dir" location="../test"/>
<property name="web.dir" location="${basedir}/web"/>


<property name="xdoclet.force" value="false"/>
<property name="xdoclet.lib.dir" location="../xdoclet-1.2/lib"/>

<!-- JBoss properties -->
<property name="jboss.home" location="C:\jboss-3.2.3"/>
<property name="jboss.dtd.dir" location="${jboss.home}/docs/dtd"/>
<property name="deploy.dir" location="${jboss.home}/server/default/deploy"/>

<!-- ejb properties -->
<property name="jboss.create.table" value="true" />
<property name="jboss.remove.table" value="true" />
<property name="jboss.tuned.updates" value="true" />
<property name="jboss.read.only" value="false" />

<!-- compilation args -->
<property name="build.compiler" value="jikes" />


Modules xml file:

<macrodef name="module">
  <attribute name="target"/>
  <attribute name="platform"/>
  <attribute name="module"/>
  <sequential>
    <ant antfile="../@{module}/build.xml" target="@{target}"
         inheritAll="false">
        <property name="platform" value="@{platform}"/>
    </ant>
  </sequential>
</macrodef>

<!--
  Define all the modules components of the application.
  Base modules must be defined first to satisfy dependencies.
-->
<target name="modules">
    <module target="${target}" platform="${platform}" module="common"/>
    <module target="${target}" platform="${platform}" module="util"/>
    <module target="${target}" platform="${platform}"
module="securitystatus"/>
    <!--module target="${target}" platform="${platform}" module="country"/>
    <module target="${target}" platform="${platform}" module="addresstype"/>
    <module target="${target}" platform="${platform}" module="assettype"/>
    <module target="${target}" platform="${platform}" module="priority"/>
    <module target="${target}" platform="${platform}" module="notetype"/>
    <module target="${target}" platform="${platform}" module="tasktype"/>
    <module target="${target}" platform="${platform}"
module="spaceregiontype"/>
    <module target="${target}" platform="${platform}" module="position"/>
    <module target="${target}" platform="${platform}" module="dimension"/>
    <module target="${target}" platform="${platform}" module="warranty"/>
    <module target="${target}" platform="${platform}" module="address"/>
    <module target="${target}" platform="${platform}" module="buildingtype"/>
    <module target="${target}" platform="${platform}" module="building"/>
    <module target="${target}" platform="${platform}" module="floor"/>
    <module target="${target}" platform="${platform}" module="spaceregion"/>
    <module target="${target}" platform="${platform}" module="user"/>
    <module target="${target}" platform="${platform}" module="note"/>
    <module target="${target}" platform="${platform}" module="task"/>
    <module target="${target}" platform="${platform}" module="asset"/>
    <module target="${target}" platform="${platform}" module="controller"/>
    <module target="${target}" platform="${platform}" module="demo"/>
    <module target="${target}" platform="${platform}" module="view"/>
    <module target="${target}" platform="${platform}" module="action"/>
    <module target="${target}" platform="${platform}" module="error"/>
    <module target="${target}" platform="${platform}" module="website"/-->
</target>

EJBDoclet xml file:

<target name="ejbdoclet" depends="init">
    <taskdef name="ejbdoclet"
             classname="xdoclet.modules.ejb.EjbDocletTask"
             classpathref="project.class.path"
    />
    <echo message="build.src.dir dir=${build.src.dir}"/>
    <echo message="src.dir dir=${src.dir}"/>
    <echo message="force=${xdoclet.force}"/>
    <ejbdoclet destdir="${build.src.dir}"
               excludedtags="@version,@author,@todo"
               ejbspec="2.0"
               force="${xdoclet.force}"
               verbose="true">
         <fileset dir="${src.dir}">
            <include name="com/xensia/ejb/impl/*Bean.java" />
         </fileset>
         <packageSubstitution packages="impl" substituteWith="interfaces"/>
         <remoteinterface/>
         <localinterface/>
         <homeinterface />
         <valueobject/>
         <localhomeinterface/>
         <entitypk/>
         <entitybmp/>
         <utilobject cacheHomes="true" includeGUID="true"/>
         <deploymentdescriptor destdir="${ejb.dd.dir}" validatexml="false"/>
         <jboss
            version="3.2"
            unauthenticatedPrincipal="nobody"
            xmlencoding="UTF-8"
            destdir="${ejb.dd.dir}"
            validatexml="false"
            preferredrelationmapping="relation-table"/>
    </ejbdoclet>
</target>

Sub build file

<?xml version="1.0"?>
<!DOCTYPE project [
    <!ENTITY shared_properties SYSTEM "../share/xml/shared_properties.xml">
    <!ENTITY ejbdoclet SYSTEM "../share/xml/ejbdoclet.xml">
]>

<!--
 Ant build file for securitystatus
 Auther Hussein H Badakhchani
 -->
<project name="securitystatus" default="build" basedir=".">

    <description>securitystatus</description>

    <!-- Inline the shared_properties xml file -->
    &shared_properties;

    <!--
     Load the module properties
     This is set to default but can be overridden from the command prompt
     -->
    <property name="platform" value="local"/>
    <property file="${share.conf.dir}/${platform}.conf"/>

    <!--
     Classpath
     All libraries are located in the poroject lib directory.
     Developers should only reference the jar files they need as this
     tag may be used to identify the modules dependencies.
     -->
    <path id="xdoclet.jar.path">
        <fileset dir="${xdoclet.lib.dir}">
           <include name="*.jar" />
        </fileset>
    </path>

    <path id="project.class.path">
        <pathelement location="${share.lib.dir}/ejb.jar"/>
        <pathelement location="${share.lib.dir}/log4j.jar"/>
        <fileset dir="${share.lib.dir}">
           <include name="**/*.jar" />
        </fileset>
        <path refid="xdoclet.jar.path"/>
    </path>

    <property name="project.class.path" refid="project.class.path"/>

    <!--
     Create the time stamp
     -->
    <target name="init" description="  - Creates a timestamp for the build">
        <tstamp>
            <format property="version" pattern="MM-dd-yyyy-hh-mm"/>
        </tstamp>
    </target>

    <!--
     Dependants
     This target ensures all dependant packages are built and copied
     to the shared library directory where they become available to our
     builds project.class.path.
     -->
    <target name="dependants"
            description="  - calls dependant modules build scripts">
        <!--ant antfile="build.xml" target="export"
            dir="../common" inheritAll="false"/-->
    </target>

    <!--
     Build
     Creates a Bean.jar file
     -->
    <target name="build" depends="init, dependants, ejbdoclet, comp"
            description="  - (build)s the securitystatus application server">
    </target>

    <!--
     Create EJB files
     -->
     &ejbdoclet;

    <!--
     Compile java sources
     The javac compilation options are read from the property file in
     the shared conf directory (see share module) thus we can compile
     the application with different options for different platforms.
     -->
    <target name="comp" depends="ejbdoclet" description="  - (comp)iles
the source code">
        <mkdir dir="${ejb.classes.dir}"/>
        <javac destdir="${ejb.classes.dir}"
               optimize="${optimize}" debug="${debug}" 
deprecation="${deprecation}"
               classpathref="project.class.path">
            <src path="${src.dir}"/>
            <src path="${build.src.dir}"/>
        </javac>
        <copy file="${conf.dir}/MANIFEST.MF" todir="${ejb.dd.dir}"/>
    </target>

    <!--
     Generate javadocs of src.dir
     -->
    <target name="doc" description="  - generates java(doc)">
        <mkdir dir="${build.javadoc.dir}"/>
        <javadoc project.class.pathref="project.class.path"
destdir="${build.javadoc.dir}"
            author="true" version="true" use="true"
            windowtitle="${ant.project.name} API">
            <fileset dir="${src.dir}" defaultexcludes="yes"/>
        </javadoc>
    </target>

    <!--
     Clean build
     Remove all trace of the build including from application server.
     -->
    <target name="clean" description="  - (clean)s the build">
        <echo message="${ant.project.name}"/>
        <delete dir="${build.dir}"/>
        <delete dir="${report.dir}"/>
        <delete file="${deploy.dir}/${ant.project.name}.jar"/>
        <delete file="${share.lib.dir}/${ant.project.name}.jar"/>
    </target>

    <!--
     Export jar file
     -->
    <target name="export" depends="comp"
            description="  - creates a generic (ejb) jar file">
        <jar basedir="${ejb.classes.dir}"
             destfile="${share.lib.dir}/${ant.project.name}.jar"
             filesetmanifest="merge"/>
    </target>

    <!--
     Remote Client jar file
     -->
    <target name="client" depends="comp">
        <jar jarfile="${build.dir}/${ant.project.name}-jboss-client.jar">
        <fileset dir="${build.classes.dir}" includes="**/test/*"/>
        <fileset dir="${build.classes.dir}" includes="**/ejb/*"/>
        </jar>
    </target>

    <!--
     Deploy
     Used for standalone testing of the bean.
     -->
    <target name="deploy" depends="comp" description="  - (deploy)s the
application on to J2EE container">
        <!--ant antfile="build.xml" target="deploy"
            dir="../common" inheritAll="false"/-->
        <copy file="${build.dir}/${ant.project.name}.jar"
todir="${deploy.dir}" overwrite="no"/>
    </target>

    <!--
     Unit test
     -->
    <target name="test" depends="build"
            description="  - unit (test)">

        <mkdir dir="${report.dir}"/>
        <junit fork="yes">
            <classpath>
                <pathelement location="${share.lib.dir}/junit.jar"/>
                <pathelement location="${share.lib.dir}/log4j.jar"/>
                <pathelement location="${share.lib.dir}/jnet.jar"/>
                <pathelement location="${share.lib.dir}/postgresql.jar"/>
                <pathelement location="${share.lib.dir}/j2ee.jar"/>
                <pathelement
location="${share.lib.dir}/jbossall-client.jar"/>
                <pathelement location="${build.classes.dir}"/>
            </classpath>
            <formatter type="plain" usefile="yes"/>
            <test name="com.xensia.ejb.test.SecurityStatusBeanTest"
todir="${report.dir}"/>
            <sysproperty key="java.naming.factory.initial"
value="${java.naming.factory.initial}"/>
            <sysproperty key="java.naming.provider.url"
value="${java.naming.provider.url}"/>
            <sysproperty key="jdbc.driver" value="${jdbc.driver}"/>
            <sysproperty key="jdbc.url" value="${jdbc.url}"/>
            <sysproperty key="db.user" value="${db.user}"/>
            <sysproperty key="db.password" value="${db.password}"/>
        </junit>
    </target>
</project>





-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to