>Yes, we also ended up with a relatively stable master build which has 
>all the interproject dependencies but delegates each project to the 
>project build file via the nant task. I've hacked the XSLT a bit but we 
>stil have to do quite a lot of references etc by hand 
  
Since I wrote that article, I've changed the stylesheet to allow one to pass 
additional references, as well as source or content files, to include or exclude as 
parameters to the stylesheet.  This has been really effective in getting our build 
process totally automated - now I just run the build and never touch the generated 
build files.  
For example, if you've defined a parameter $includes-bin, you can add to your 
references like so: 

 <xsl:template match="References"> 
   <references> 
  <xsl:call-template name="process-list"> 
   <xsl:with-param name="list" select="$includes-bin"/> 
   <xsl:with-param name="type" select="'includes'"/> 
  </xsl:call-template> 
    <xsl:apply-templates /> 
   </references> 
 </xsl:template> 
  
 <xsl:template name="process-list"> 
  <xsl:param name="list"/> 
  <xsl:param name="type"/> 
  <xsl:variable name="first" select="normalize-space(substring-before($list,';'))"/> 
  <xsl:variable name="rest" select="normalize-space(substring-after($list,';'))"/> 
  <xsl:if test="$first"> 
  <xsl:element name="{$type}" > 
   <xsl:attribute name="name"><xsl:value-of select="$first"/></xsl:attribute> 
  </xsl:element> 
  </xsl:if> 
  <xsl:if test="$rest" > 
   <xsl:call-template name="process-list"> 
    <xsl:with-param name="list" select="$rest"/> 
    <xsl:with-param name="type" select="$type"/> 
   </xsl:call-template> 
  </xsl:if> 
 </xsl:template> 

You'd invoke the style like this, using a semicolon delimited list of libraries you 
want to link in: 
  <property name="includes-bin" value="${dir.lib}\foo.dll;${dir.lib}\bar.dll;"/> 
  <style in="projX\$projX.csproj" basedir="projX" out="projX\ProjX.build" 
destdir="projX" extension="build" style="${nant.project.basedir}\vsconvert.xsl" 
verbose="true"> 
   <param name="includes-bin" expression="${includes-bin}"/> 
  </style> 


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to