Hello.

Here is a patch file for the buildfile bug and the CVS sub-module bug
that I described in my previous letter.

In the buildfile the 'build.classpath' was being referenced by the name
'build-classpath' (or vice versa... can't remember).  I changed the name
of the build and site classpath properties to 'build.classpath' and
'site.classpath' respectively.  This was only done to maintain
consistency since all other property names had periods but not dashes as
a word seperator.

The 'xsl/build.build.xsl' has been modified so that it flattens out
module names when the module is a submodule of another.  The module
'app/ips' caused us problems because alexandria was trying to write to
the "file" 'logs/app/ips.HEAD.build.log.xml' and of course the directory
'logs/app' didn't exist so it failed.  We added an XSL template that
checks the module name and replaces the '/' with a '-' so now it writes
to the logfile 'logs/app-ips.HEAD.build.log.xml' instead and that works
fine.  This seems to work ok now... at least we got to the JXR task now
which seems to be failing though... more on that one later!

Can somebody please apply these patches to the two files.  Better yet...
since the core of the project seems to be stagnating is it possible to
get write access to the Alexandria repository?  We are setting it up
here and when we come across bugs we fix them... why not commit them as
well ;o)

Regards,
        Stefan Freyr.

-----Original Message-----
From: Stef�n F. Stef�nsson 
Sent: 1. �g�st 2001 12:30
To: Alexandria-Dev
Subject: [BUG] Alexandria fails on grouped modules


We've discovered a bug in Alexandria when generating log files for
grouped modules (by grouped modules we mean modules that are stored in
subdirectories on the CVS server).  Our CVS repository for example is
split up into two main modules, "app" and "lib".  Under these modules
are the project modules.  When we started out trying to set up
Alexandria we did so with a project stored under the module named
"app/ips" in CVS.

The generated file build.build.xml under the var/ directory in
Alexandria calls Ant with some parameters, one of which is a logfile
parameter.  The "build.build.xml" file is generated by utilizing the
"build.build.xsl" stylesheet.  In this stylesheet the call to ant is
generated by using the following lines:

        <java
          fork="true"
          classname="org.apache.tools.ant.Main">
          <xsl:if test="build/@file">
            <arg value="-buildfile" />
            <arg
value="${{content.dir}}/cvs/{module}/{@tag}/{module}/{build/@file}" />
          </xsl:if>
          <xsl:if test="build/@target">
            <arg value="build/@target" />
          </xsl:if>
          <arg value="-listener" />
          <arg value="org.apache.tools.ant.XmlLogger" />
          <arg value="-listener" />
          <arg value="org.apache.alexandria.blame.BlameListener" />
          <arg
value="-DXmlLogger.file=logs/{module}.{@tag}.build.log.xml" />
          <jvmarg value="-Dalexandria.module={module}" />
          <jvmarg value="-Dalexandria.tag={@tag}" />
          <jvmarg
value="-Dalexandria.content.dir=${{content.dir}}/cvs/{module}/{@tag}/{mo
dule}/{javasrc}/" />
          <jvmarg value="-Dant.home=${{ant.home}}" />
          <jvmarg value="-Djava.compiler=NONE" />
          <arg value="-logfile" />
          <arg value="logs/{module}.{@tag}.build.log" />
          <xsl:for-each select="build/arg">
            <xsl:element name="arg">
              <xsl:attribute name="value">-D<xsl:value-of
select="@name"/>=<xsl:value-of select="@value"/></xsl:attribute>
            </xsl:element>
          </xsl:for-each>
          <classpath>
            <fileset dir="lib" includes="*.jar"/>
            <fileset dir="${{ant.home}}/lib" includes="*.jar"/>
            <pathelement path="${{java.home}}/../lib/tools.jar"/>
            <pathelement path="Alexandria.jar"/>
            <pathelement path="{build/@classpath}"/>
            <xsl:for-each select="depend|option">
              <pathelement>
                <xsl:attribute name="path"><xsl:value-of
select="/workspace/project[@name=current()/@project]/jar/@name"/></xsl:a
ttribute>
              </pathelement>
            </xsl:for-each>
          </classpath>
        </java>


The <arg value="-DXmlLogger.file=logs/{module}.{@tag}.build.log.xml" />
line generates the logfile parameter I mentioned before.  When
Alexandria uses this line when retrieving a module called "app/ips" the
logfile parameter will be "logs/app/ips.HEAD.build.log.xml".  Ant will
then try to create the logfile ips.HEAD.build.log.xml in the directory
logs/app/ which does not exist!  This will generate an exception and
Alexandria will fail.

One way of resolving this would be to create a modified version of the
{module} string where slashes ('/') would be exchanged for periods ('.')
(or something else like a dash ('-').  This version of the {module}
string would then be used when generating the logfile so it would
actually become logs/app.ips.HEAD.build.log.xml (or
logs/app-ips.HEAD.build.log.xml).  I do not have any experience in
working with XLSs but I'm trying to contact somebody who does.  Any
response from the development team for Alexandria would be greatly
appreciated.  If you have other ideas on how this should be fixed or
want to comment on this bug in any way please reply ASAP.

Kind regards,
        Stefan Freyr Stefansson.

--------------------------------------------
Stefan Freyr Stefansson
Software Developer
deCODE Genetics, Inc.
http://www.decode.com

Phone: (+354) 570 2854
GSM:   (+354) 861 1718
Fax:   (+354) 491 3782
 
 <<Stefan Stefansson.vcf>> 

grouped-repositories.diff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to