You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alexandria-dev@jakarta.apache.org by "Stefán F. Stefánsson" <st...@snote.decode.is> on 2001/08/01 14:30:02 UTC

[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>>