You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ni...@apache.org on 2002/12/03 17:54:00 UTC
cvs commit: xml-cocoon2/tools/src blocks-build.xsl
nicolaken 2002/12/03 08:54:00
Modified: tools/src blocks-build.xsl
Log:
<action dev="NKB" type="update">
Updated block build system to compile and use mock objects in
the "mocks" subdir of the blocks if present.
</action>
Revision Changes Path
1.12 +79 -2 xml-cocoon2/tools/src/blocks-build.xsl
Index: blocks-build.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon2/tools/src/blocks-build.xsl,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- blocks-build.xsl 29 Oct 2002 15:52:56 -0000 1.11
+++ blocks-build.xsl 3 Dec 2002 16:54:00 -0000 1.12
@@ -62,8 +62,8 @@
</fileset>
</copy>
</target>
-
- <target name="-single-project" depends="-single-project-samples,prepare-jdbc,prepare-database-connection">
+
+ <target name="-single-project-mocks" if="currentblock.has.mocks">
<path id="currentblock.classpath">
<fileset>
<xsl:attribute name="dir">${lib.dir}</xsl:attribute>
@@ -79,6 +79,40 @@
</include>
</fileset>
</path>
+
+ <property name="currentblock.dir">
+ <xsl:attribute name="value">${blocks.dir}/${currentblock.name}</xsl:attribute>
+ </property>
+
+ <property name="currentblock.mocks.dir">
+ <xsl:attribute name="value">${currentblock.dir}/mocks</xsl:attribute>
+ </property>
+
+ <property name="build.currentblock.mocks.dir">
+ <xsl:attribute name="value">${build.blocks.root}/${currentblock.name}/mocks</xsl:attribute>
+ </property>
+
+ <mkdir>
+ <xsl:attribute name="dir">${build.currentblock.mocks.dir}</xsl:attribute>
+ </mkdir>
+
+ <javac>
+ <xsl:attribute name="srcdir">${currentblock.mocks.dir}</xsl:attribute>
+ <xsl:attribute name="destdir">${build.currentblock.mocks.dir}</xsl:attribute>
+ <xsl:attribute name="debug">${debug}</xsl:attribute>
+ <xsl:attribute name="optimize">${optimize}</xsl:attribute>
+ <xsl:attribute name="deprecation">${deprecation}</xsl:attribute>
+ <xsl:attribute name="target">${target.vm}</xsl:attribute>
+ <xsl:attribute name="nowarn">${nowarn}</xsl:attribute>
+
+ <classpath refid="currentblock.classpath" />
+ </javac>
+
+
+ </target>
+
+
+ <target name="-single-project" depends="-single-project-mocks,-single-project-samples,prepare-jdbc,prepare-database-connection">
<property name="currentblock.dir">
<xsl:attribute name="value">${blocks.dir}/${currentblock.name}</xsl:attribute>
@@ -116,6 +150,44 @@
<xsl:attribute name="dir">${build.currentblock.dest}</xsl:attribute>
</mkdir>
+
+
+ <property name="currentblock.mocks.dir">
+ <xsl:attribute name="value">${currentblock.dir}/mocks</xsl:attribute>
+ </property>
+
+ <property name="build.currentblock.mocks.dir">
+ <xsl:attribute name="value">${build.blocks.root}/${currentblock.name}/mocks</xsl:attribute>
+ </property>
+
+ <mkdir>
+ <xsl:attribute name="dir">${build.currentblock.mocks.dir}</xsl:attribute>
+ </mkdir>
+
+
+
+
+ <path id="currentblock.classpath">
+ <fileset>
+ <xsl:attribute name="dir">${lib.dir}</xsl:attribute>
+
+ <include name="**/*.jar" />
+ </fileset>
+
+ <fileset>
+ <xsl:attribute name="dir">${build.dir}</xsl:attribute>
+
+ <include>
+ <xsl:attribute name="name">*.jar</xsl:attribute>
+ </include>
+ </fileset>
+
+ <pathelement>
+ <xsl:attribute name="path">${build.currentblock.mocks.dir}</xsl:attribute>
+ </pathelement>
+
+ </path>
+
<copy filtering="on">
<xsl:attribute name="todir">${build.currentblock.src}</xsl:attribute>
@@ -231,6 +303,11 @@
<xsl:attribute name="file">${blocks.dir}/<xsl:value-of select="$block-name"/>/samples/sitemap.xmap</xsl:attribute>
</available>
+ <!-- Test if this block has a sample -->
+ <available property="currentblock.has.mocks" type="dir">
+ <xsl:attribute name="file">${blocks.dir}/<xsl:value-of select="$block-name"/>/mocks/</xsl:attribute>
+ </available>
+
<xsl:if test="@status='unstable'">
<echo message="-----------------------------------------------"/>
<echo message="ATTENTION: {$block-name} is marked unstable"/>
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org