ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Koberg" <...@livestoryboard.com>
Subject RE: Naming build files
Date Tue, 26 Nov 2002 18:20:59 GMT
Hi,
>
>
> Our sub-components has its own project and its own source directory.
> That's the way our SourceSafe hierarchy was set up--so that's how the
> sources are fetched before a compile.
>

We have a somewhat similar setup (livestoryboard.com). Each client site/project
has its own chroot jail. The master app contains a config XML that I use in the
app. I transform this with XSLT to find the site specific config files and
transform everything into a bigass build.xml.

For example below is an XSL that sets up Jing validation for the master Schemas,
site configs and all content pieces - if anyone would like some sample XML, just
ask.

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output
method="xml"
encoding="utf-8"
omit-xml-declaration="yes"
indent="no"/>

<xsl:strip-space elements="*"/>

<xsl:template match="/">

<project name="sites_xml_validator" default="validate" basedir=".">
   <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
   <target name="validate">
      <jing rngfile="../Schemas/relaxng.rng">
         <fileset dir="../Schemas">
            <include name="config/site.rng"/>
            <include name="content/article.rng"/>
            <include name="content/faqs.rng"/>
            <include name="content/jobs.rng"/>
         </fileset>
      </jing>

      <xsl:apply-templates/>

   </target>
</project>

</xsl:template>

<xsl:template match="sites">

<jing rngfile="../Schemas/config/site.rng">
   <xsl:for-each select="site">
      <xsl:call-template name="site.xml_validator">
         <xsl:with-param name="context" select="concat('../../../_u/', @id, '/',
@default_context, '/')"/>
      </xsl:call-template>
   </xsl:for-each>
</jing>
<jing rngfile="../Schemas/content/article.rng">
   <xsl:for-each select="site">
      <xsl:call-template name="article_validator">
         <xsl:with-param name="context" select="concat('../../../_u/', @id, '/',
@default_context, '/')"/>
      </xsl:call-template>
   </xsl:for-each>
</jing>
<jing rngfile="../Schemas/content/faqs.rng">
   <xsl:for-each select="site">
      <xsl:call-template name="faq_validator">
         <xsl:with-param name="context" select="concat('../../../_u/', @id, '/',
@default_context, '/')"/>
      </xsl:call-template>
   </xsl:for-each>
</jing>

<jing rngfile="../Schemas/content/jobs.rng">
   <xsl:for-each select="site">
      <xsl:call-template name="job_validator">
         <xsl:with-param name="context" select="concat('../../../_u/', @id, '/',
@default_context, '/')"/>
      </xsl:call-template>
   </xsl:for-each>
</jing>

</xsl:template>

<xsl:template name="site.xml_validator">
   <xsl:param name="context"/>

   <fileset dir="{$context}WEB-INF">
      <include name="site.xml"/>
   </fileset>

</xsl:template>


<xsl:template name="article_validator">
   <xsl:param name="context"/>

   <fileset dir="{$context}WEB-INF/content">

      <xsl:apply-templates select="document(concat($context,
'WEB-INF/site.xml'))//article" mode="content"/>

   </fileset>

</xsl:template>

<xsl:template name="faq_validator">
   <xsl:param name="context"/>

   <fileset dir="{$context}WEB-INF/content">

      <xsl:apply-templates select="document(concat($context,
'WEB-INF/site.xml'))//faq" mode="content"/>

   </fileset>

</xsl:template>

<xsl:template name="job_validator">
   <xsl:param name="context"/>

   <fileset dir="{$context}WEB-INF/content">

      <xsl:apply-templates select="document(concat($context,
'WEB-INF/site.xml'))//job" mode="content"/>

   </fileset>

</xsl:template>


<xsl:template match="article | faq | job" mode="content">
   <include name="{@id}.xml"/>
</xsl:template>

</xsl:stylesheet>



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message