Author: vgritsenko Date: Fri Nov 5 07:24:58 2004 New Revision: 56676 Modified: cocoon/branches/BRANCH_2_1_X/tools/jetty/conf/webdefaults.xml cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl cocoon/branches/BRANCH_2_1_X/tools/targets/compile-build.xml cocoon/branches/BRANCH_2_1_X/tools/targets/docs-build.xml Log: syncing build with 2.2: consolidating warnings, rename targets.
Modified: cocoon/branches/BRANCH_2_1_X/tools/jetty/conf/webdefaults.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/tools/jetty/conf/webdefaults.xml (original) +++ cocoon/branches/BRANCH_2_1_X/tools/jetty/conf/webdefaults.xml Fri Nov 5 07:24:58 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <!-- ===================================================================== --> <web-app> Modified: cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java ============================================================================== --- cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java (original) +++ cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/SitemapTask.java Fri Nov 5 07:24:58 2004 @@ -341,7 +341,7 @@ i++; } if ( nextLabel == null ) { - sectionNode.appendChild(newEntry); + sectionNode.appendChild(newEntry); } else { sectionNode.insertBefore(newEntry, nextLabel); } Modified: cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl ============================================================================== --- cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl (original) +++ cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl Fri Nov 5 07:24:58 2004 @@ -1,4 +1,5 @@ <?xml version="1.0"?> + <!-- Copyright 1999-2004 The Apache Software Foundation @@ -14,8 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. --> -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> @@ -60,20 +61,6 @@ <exclude name="**/package.html"/> </patternset> - <target name="init"> - <xsl:for-each select="module/project[starts-with(@name, 'cocoon-block-')]"> - <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> - <condition property="include.block.{$block-name}"> - <not> - <istrue value="${{exclude.block.{$block-name}}}"/> - </not> - </condition> - <condition property="internal.exclude.block.{$block-name}"> - <isfalse value="${{include.block.{$block-name}}}"/> - </condition> - </xsl:for-each> - </target> - <xsl:apply-templates select="module"/> </project> </xsl:template> @@ -81,9 +68,71 @@ <xsl:template match="module"> <xsl:variable name="cocoon-blocks" select="project[starts-with(@name, 'cocoon-block-')]"/> + <target name="init"> + <xsl:for-each select="module/project[starts-with(@name, 'cocoon-block-')]"> + <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> + <condition property="include.block.{$block-name}"> + <not> + <istrue value="${{exclude.block.{$block-name}}}"/> + </not> + </condition> + <condition property="internal.exclude.block.{$block-name}"> + <isfalse value="${{include.block.{$block-name}}}"/> + </condition> + </xsl:for-each> + </target> + + <target name="unstable" depends="init"> + <xsl:for-each select="[EMAIL PROTECTED]'unstable']"> + <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> + <condition property="unstable.blocks.present"> + <isfalse value="${{internal.exclude.block.{$block-name}}}"/> + </condition> + </xsl:for-each> + <if> + <istrue value="${{unstable.blocks.present}}"/> + <then> + <echo message="==================== WARNING ======================="/> + <xsl:for-each select="[EMAIL PROTECTED]'unstable']"> + <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> + <echo message=" Block '{$block-name}' should be considered unstable."/> + </xsl:for-each> + <echo message="----------------------------------------------------"/> + <echo message=" This means that its API, schemas "/> + <echo message=" and other contracts might change without notice."/> + <echo message="===================================================="/> + </then> + </if> + </target> + + <target name="excluded" depends="init"> + <xsl:for-each select="$cocoon-blocks"> + <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> + <condition property="excluded.blocks.present"> + <istrue value="${{internal.exclude.block.{$block-name}}}"/> + </condition> + </xsl:for-each> + <if> + <istrue value="${{excluded.blocks.present}}"/> + <then> + <echo message="==================== NOTICE ========================"/> + <xsl:for-each select="$cocoon-blocks"> + <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> + <if> + <istrue value="${{internal.exclude.block.{$block-name}}}"/> + <then> + <echo message=" Block '{$block-name}' is excluded from the build."/> + </then> + </if> + </xsl:for-each> + <echo message="===================================================="/> + </then> + </if> + </target> + <target name="compile"> <xsl:attribute name="depends"> - <xsl:text>init</xsl:text> + <xsl:text>unstable,excluded</xsl:text> <xsl:for-each select="$cocoon-blocks"> <xsl:text>,</xsl:text> <xsl:value-of select="concat(@name, '-compile')"/> @@ -184,7 +233,7 @@ <xsl:text>init, javadocs-check</xsl:text> <xsl:for-each select="$cocoon-blocks"> <xsl:text>,</xsl:text> - <xsl:value-of select="concat(substring-after(@name, 'cocoon-block-'), '-prepare')"/> + <xsl:value-of select="concat(@name, '-prepare')"/> </xsl:for-each> </xsl:attribute> @@ -272,21 +321,18 @@ <xsl:apply-templates select="$cocoon-blocks"/> </xsl:template> + <xsl:template match="project"> <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/> <xsl:variable name="cocoon-block-dependencies" select="depend[starts-with(@project,'cocoon-block-')]"/> - <target name="[EMAIL PROTECTED]" if="internal.exclude.block.{$block-name}"> - <echo message="NOTICE: Block '{$block-name}' is excluded from the build."/> - </target> - <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"/> <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"> <xsl:attribute name="depends"> <xsl:if test="depend"> - <xsl:value-of select="$block-name"/><xsl:text>-prepare,</xsl:text> - <xsl:value-of select="@name"/>,<xsl:value-of select="@name"/>-excluded<xsl:text/> + <xsl:value-of select="concat(@name, '-prepare,')"/> + <xsl:value-of select="@name"/> <xsl:for-each select="$cocoon-block-dependencies"> <xsl:text>,</xsl:text> <xsl:value-of select="concat(@project, '-compile')"/> @@ -294,15 +340,6 @@ </xsl:if> </xsl:attribute> - <xsl:if test="@status='unstable'"> - <echo message="==================== WARNING ======================="/> - <echo message=" Block '{$block-name}' should be considered unstable."/> - <echo message="----------------------------------------------------"/> - <echo message=" This means that its API, schemas "/> - <echo message=" and other contracts might change without notice."/> - <echo message="===================================================="/> - </xsl:if> - <!-- Test if this block has special build --> <if> <available file="${{blocks}}/{$block-name}/build.xml"/> @@ -428,7 +465,7 @@ <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"> <xsl:attribute name="depends"> - <xsl:value-of select="$block-name"/><xsl:text>-prepare</xsl:text> + <xsl:value-of select="concat(@name, '-prepare')"/> <xsl:if test="depend"> <xsl:text>,</xsl:text> <xsl:value-of select="@name"/> @@ -451,6 +488,7 @@ <xpatch file="${{build.webapp}}/WEB-INF/web.xml" srcdir="${{blocks}}"> <include name="{$block-name}/conf/*.xweb"/> </xpatch> + <!-- generate sitemap entries <sitemap-components sitemap="${{build.webapp}}/sitemap.xmap" source="${{blocks}}/{$block-name}/java" @@ -483,7 +521,13 @@ <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"> <xsl:if test="depend"> - <xsl:attribute name="depends"><xsl:value-of select="@name"/><xsl:for-each select="depend[contains(@project,'cocoon-block-')]"><xsl:text>,</xsl:text><xsl:value-of select="@project"/>-roles</xsl:for-each></xsl:attribute> + <xsl:attribute name="depends"> + <xsl:value-of select="@name"/> + <xsl:for-each select="depend[contains(@project,'cocoon-block-')]"> + <xsl:text>,</xsl:text> + <xsl:value-of select="concat(@project, '-roles')"/> + </xsl:for-each> + </xsl:attribute> </xsl:if> <xpatch file="${{build.dest}}/org/apache/cocoon/cocoon.roles" srcdir="${{blocks}}"> @@ -578,16 +622,16 @@ </copy> </then> </if> - </target> - <target name="{$block-name}-prepare" unless="internal.exclude.block.{$block-name}"> + + <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"> <xsl:if test="depend"> <xsl:attribute name="depends"> <xsl:value-of select="@name"/> <xsl:for-each select="$cocoon-block-dependencies"> <xsl:text>,</xsl:text> - <xsl:value-of select="concat(substring-after(@project,'cocoon-block-'), '-prepare')"/> + <xsl:value-of select="concat(@project, '-prepare')"/> </xsl:for-each> </xsl:attribute> </xsl:if> @@ -678,6 +722,7 @@ </then> </if> </target> + <target name="[EMAIL PROTECTED]" unless="internal.exclude.block.{$block-name}"> <!-- Test if this block has Anteater tests --> <if> Modified: cocoon/branches/BRANCH_2_1_X/tools/targets/compile-build.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/tools/targets/compile-build.xml (original) +++ cocoon/branches/BRANCH_2_1_X/tools/targets/compile-build.xml Fri Nov 5 07:24:58 2004 @@ -64,7 +64,7 @@ <!-- compiles deprecated code --> <target name="compile-deprecated" depends="prepare" - unless="internal.exclude.deprecated"> + unless="internal.exclude.deprecated"> <mkdir dir="${build.deprecated}"/> <xpatch file="${build.dest}/org/apache/cocoon/cocoon.roles" Modified: cocoon/branches/BRANCH_2_1_X/tools/targets/docs-build.xml ============================================================================== --- cocoon/branches/BRANCH_2_1_X/tools/targets/docs-build.xml (original) +++ cocoon/branches/BRANCH_2_1_X/tools/targets/docs-build.xml Fri Nov 5 07:24:58 2004 @@ -236,11 +236,12 @@ <!-- Creates Javadocs --> <target name="javadocs" depends="prepare-blocks" - description="Builds the API documentation (javadocs)"> + description="Builds the API documentation (javadocs)" + unless="internal.exclude.javadocs"> <ant antfile="${build.temp}/blocks-build.xml" inheritAll="true" inheritRefs="false" target="javadocs"/> </target> - + </project>