Author: ddevienne Date: Fri Apr 15 08:00:09 2005 New Revision: 161477 URL: http://svn.apache.org/viewcvs?view=rev&rev=161477 Log: Proposal for XML doc of Ant, transformed to HTML using XSL.
Added: ant/sandbox/antlibs/gendoc/ ant/sandbox/antlibs/gendoc/build.xml ant/sandbox/antlibs/gendoc/manual/ ant/sandbox/antlibs/gendoc/manual.xsl ant/sandbox/antlibs/gendoc/manual/ant.xml ant/sandbox/antlibs/gendoc/manual/mkdir.xml ant/sandbox/antlibs/gendoc/whatsnew.xml ant/sandbox/antlibs/gendoc/whatsnew.xsl Added: ant/sandbox/antlibs/gendoc/build.xml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/build.xml?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/build.xml (added) +++ ant/sandbox/antlibs/gendoc/build.xml Fri Apr 15 08:00:09 2005 @@ -0,0 +1,46 @@ +<?xml version="1.0"?> + +<!-- +============================================================ + XML+XSL based new documentation for Ant. + + Dominique Devienne, <[EMAIL PROTECTED]>, Mar 2005 +============================================================ +--> +<project name="xd3ocs" default="all"> + + <description> + Generates HTML documentation from the custom Ant XML vocabulary, + and the custom stylesheets (XSL 1.0 based for now). + </description> + + <!-- ===================================================== --> + <target name="whatsnew" description="Generates HTML whatsnew"> + + <mkdir dir="build" /> + <style in="whatsnew.xml" out="build/whatsnew.html" style="whatsnew.xsl" /> + + </target> + + <!-- ===================================================== --> + <target name="manual" description="Generates HTML manual"> + + <mkdir dir="build/manual" /> + <style basedir="manual" includes="*.xml" + style="manual.xsl" destdir="build/manual" /> + + </target> + + <!-- ===================================================== --> + <target name="clean" description="Deletes all generated files"> + + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="build" /> + </delete> + + </target> + + <!-- ===================================================== --> + <target name="all" depends="whatsnew, manual" /> + +</project> Added: ant/sandbox/antlibs/gendoc/manual.xsl URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/manual.xsl?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/manual.xsl (added) +++ ant/sandbox/antlibs/gendoc/manual.xsl Fri Apr 15 08:00:09 2005 @@ -0,0 +1,346 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" + xmlns:m="uri:org.apache.ant:manual" + xmlns:attr="uri:org.apache.ant:manual:attribute" + xmlns:elem="uri:org.apache.ant:manual:element" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + exclude-result-prefixes="m attr elem"> + + <xsl:output method="html" encoding="UTF-8" indent="yes" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + + <!-- Space-only nodes matter in the example snippets only --> + <xsl:preserve-space elements="m:snippet" /> + + <!-- ================================================= --> + <xsl:template match="/m:manual"> + <!-- For now, process only first <task> of each file --> + <xsl:apply-templates select="m:task[position()=1]" /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:task"> + <html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title><<xsl:value-of select="@name"/>> task</title> + <style type="text/css"> + code { font: 9pt monospace, regular; } + .antlib { background-color: #E5E5E5; } + .ns { color: #6A5ACD; background-color: #F2F2F2; } + .tag { color: #804040; font-weight: bold; } + .attr { color: #2E8B57; font-weight: bold; } + .value { color: #FF00FF; background-color: #F2F2F2; } + .example { border-left: thick solid gray; padding-left: 1em; } + .example pre { margin-bottom: 0.5em; } + h4 { margin-bottom: 0.33em; } + div.nested-1 { margin-left: 1.0em; } + div.nested-1 h5 { margin-bottom: 0.0em; } + .synopsis { background-color: #E9E9E9; } + .since {font: italic normal; } + .at { font: 9pt monospace, regular; color: gray; } + .elem-ref { font: 9pt monospace, regular; font-weight: bold; + color: #804040; background-color: #E5E5E5; } + .attr-ref { font: 9pt monospace, regular; font-weight: bold; + color: #2E8B57; background-color: #E5E5E5; } + </style> + </head> + <body> + <h2 class="{local-name()}" id="[EMAIL PROTECTED]"> + <xsl:call-template name="bracket-name" /> task + </h2> + <xsl:apply-templates /> + </body> + </html> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:alias"> + <!-- Just ignore for now --> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:description"> + <xsl:apply-templates /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:task/m:description/m:synopsis"> + <h3 class="description">Description</h3> + <span class="synopsis"><xsl:apply-templates /></span> + <br /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:description/m:synopsis"> + <span class="synopsis"><xsl:apply-templates /></span> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:attributes"> + <xsl:if test="m:attribute"> + <h3>Parameters</h3> + <xsl:call-template name="attributes" /> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:nested-element/m:attributes"> + <xsl:if test="m:attribute"> + <div class="nested-1"> + <h5><xsl:call-template name="bracket-name" />'s parameters</h5> + <xsl:call-template name="attributes" /> + </div> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template name="attributes"> + <table id="attributes" border="1" cellpadding="2" cellspacing="0"> + <thead> + <tr> + <th valign="top"><b>Attribute</b></th> + <th valign="top"><b>Description</b></th> + <th align="center" valign="top"><b>Required?</b></th> + </tr> + </thead> + <tbody> + <xsl:apply-templates select="m:attribute" /> + </tbody> + </table> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:attribute"> + <tr> + <td valign="top"> + <xsl:value-of select="@name" /> + </td> + <td valign="top"> + <xsl:apply-templates select="m:synopsis | m:description" /> + </td> + <td align="center" valign="top"> + <xsl:choose> + <xsl:when test="m:required"> + <xsl:apply-templates select="m:required" /> + </xsl:when> + <xsl:otherwise>No</xsl:otherwise> + </xsl:choose> + </td> + </tr> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:nested-elements"> + <xsl:if test="m:nested-element"> + <h3 class="{local-name()}">Parameters specified as nested elements</h3> + <xsl:apply-templates select="m:nested-element" /> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:nested-element"> + <h4 id="[EMAIL PROTECTED]" class="{local-name()}"> + <xsl:call-template name="bracket-name" /> + <xsl:if test="@since"> + <!-- Not great, but will do for now --> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + <span class="since">(since Ant <xsl:value-of select="@since" />)</span> + </xsl:if> + </h4> + <xsl:apply-templates /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:section"> + <h3 class="{local-name()}"><xsl:value-of select="@name" /></h3> + <xsl:apply-templates /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:required"> + Yes<xsl:text/> + <xsl:if test="normalize-space(text())!=''"> + <xsl:text/>, <em><xsl:apply-templates /></em> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:examples"> + <xsl:if test="m:example"> + <h3 class="{local-name()}">Examples</h3> + <xsl:apply-templates select="m:example" /> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:example"> + <xsl:variable name="num"><xsl:number /></xsl:variable> + <div class="{local-name()}" id="e.g.{$num}"> + <xsl:apply-templates /> + </div> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:snippet"> + <pre><xsl:apply-templates /></pre> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:snippet/text()"> + <!-- Swallow the first and last text nodes for better formatting. + Note that position() is in the context of all the child nodes + of the snippet, both text() and element() nodes. + Test for normalize-space='' ??? --> + <xsl:if test="not(position()=1 or position()=last())"> + <xsl:value-of select="." /> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="m:copyright"> + <hr/> + <p align="center"> + Copyright © <xsl:value-of select="." /> + The Apache Software Foundation. All rights Reserved. + </p> + </xsl:template> + + <!-- ================================================= --> + <xsl:template name="bracket-name"> + <xsl:variable name="name"> + <xsl:choose> + <xsl:when test="@name"><xsl:value-of select="@name" /></xsl:when> + <xsl:when test="../@name"><xsl:value-of select="../@name" /></xsl:when> + <xsl:otherwise><xsl:value-of select="." /></xsl:otherwise> + </xsl:choose> + </xsl:variable> + <code><</code><xsl:value-of select="$name"/><code>></code> + </xsl:template> + + <!-- ================================================= + A reference to a local attribute using the special + 'attr' namespace (prefix). (from task/type, or a nested element.) + + Note: No links for now, until unicity of link can be asserted. + --> + <xsl:template match="attr:*"> + <!--<span class="at">@</span>--> + <span class="attr-ref" title="{local-name()} Attribute"> + <xsl:value-of select="local-name()" /> + </span> + </xsl:template> + + <!-- ================================================= + A reference to a local nested elemnt using the special + 'elem' namespace (prefix). (from task/type, or a nested element.) + + Note: No links for now, until unicity of link can be asserted. + --> + <xsl:template match="elem:*"> + <!--<span class="at">@</span>--> + <span class="elem-ref" title="<{local-name()}> Nested Element"> + <xsl:text/><<xsl:value-of select="local-name()" />><xsl:text/> + </span> + </xsl:template> + + <!-- ================================================= + Auto-<code> the boolean values true/false/yes/no. + --> + <xsl:template match="m:true | m:false | m:yes | m:no"> + <code><xsl:value-of select="local-name()" /></code> + </xsl:template> + + + <!-- ================================================= + Handle generic XML + --> + + <!-- ================================================= --> + <xsl:template match="*[starts-with(namespace-uri(), 'antlib:')]"> + <xsl:variable name="ns" select="namespace-uri()" /> + <xsl:call-template name="tag"> + <xsl:with-param name="class" select="'antlib'" /> + <!-- TODO: Name should be a link to task/type documentation --> + <xsl:with-param name="name"> + <span title="{$ns}:{local-name()}"> + <!-- Drop the namespace prefix for Ant tasks/types --> + <xsl:if test="not($ns = 'antlib:org.apache.tools.ant')"> + <span class="ns"> + <xsl:value-of select="name(namespace::*[. = $ns])" /> + <!--<xsl:value-of select="substring-before(name(), ':')" />--> + </span>:<xsl:text/> + </xsl:if> + <span class="tag"><xsl:value-of select="local-name()" /></span> + </span> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="*[not(namespace-uri() = '')]" priority="-10"> + <xsl:call-template name="tag" /> + </xsl:template> + + <!-- ================================================= + Copy HTML tags in the default namespace as-is, + while still converting custom tags thru templates. + --> + <xsl:template match="*[namespace-uri() = '']" priority="-20"> + <xsl:copy> + <xsl:copy-of select="@*" /> + <xsl:apply-templates select="node()" /> + </xsl:copy> + </xsl:template> + + <!-- ================================================= --> + <xsl:template name="tag"> + <xsl:param name="name" select="name()" /> + <xsl:param name="class" select="''" /> + + <code> + <xsl:if test="$class"> + <xsl:attribute name="class"> + <xsl:value-of select="$class" /> + </xsl:attribute> + </xsl:if> + + <!-- tag name start --> + <xsl:text/><<xsl:copy-of select="$name" /> + + <!-- show its attributes, if any --> + <xsl:apply-templates select="@*" mode="antlib" /> + + <xsl:choose> + <xsl:when test="node()"> <!-- SOME nested elements --> + <xsl:text>></xsl:text> + + <xsl:apply-templates /> + + <!-- tag name end (until lexical end of template) --> + <xsl:text/></<xsl:copy-of select="$name" /> + </xsl:when> + <xsl:otherwise> + <xsl:if test="@*"> <!-- No nested elements but SOME attributes --> + <xsl:text> /</xsl:text> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + <xsl:text>></xsl:text> + </code> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="@*" mode="antlib"> + <xsl:text> </xsl:text> + <span class="attr"> + <xsl:value-of select="name()"/> + </span>=<span class="value"> + <xsl:text/>"<xsl:value-of select="."/>"<xsl:text/> + </span> + </xsl:template> + +</xsl:stylesheet> Added: ant/sandbox/antlibs/gendoc/manual/ant.xml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/manual/ant.xml?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/manual/ant.xml (added) +++ ant/sandbox/antlibs/gendoc/manual/ant.xml Fri Apr 15 08:00:09 2005 @@ -0,0 +1,291 @@ +<?xml version="1.0"?> + +<?xml-stylesheet type="text/xsl" href="../manual.xsl"?> + +<m:manual xmlns:m="uri:org.apache.ant:manual" + xmlns:a="antlib:org.apache.tools.ant" + xmlns:elem="uri:org.apache.ant:manual:element" + xmlns:attr="uri:org.apache.ant:manual:attribute"> + + <m:task name="ant"> + <m:description> + <m:synopsis>Runs Ant on a supplied buildfile.</m:synopsis> + + <p>This can be used to build subprojects. <strong>This task must not be + used outside of a <code>target</code> if it invokes the same build file + it is part of.</strong></p> + + <p>When the <attr:antfile/> attribute is omitted, the file "build.xml"; + in the supplied directory (<attr:dir/> attribute) is used.</p> + <p>If no <attr:target/> attribute is supplied, the default target of + the new project is used.</p> + + <p>By default, all of the properties of the current project will be + available in the new project. Alternatively, you can set the + <attr:inheritAll/> attribute to <m:false/> and only + "user" properties (i.e., those passed on the command-line) + will be passed to the new project. In either case, the set of + properties passed to the new project will override the properties that + are set in the new project (See also the <a + href="property.html">property task</a>).</p> + + <p>You can also set properties in the new project from the old project + by using nested property tags. These properties are always passed + to the new project and any project created in that project + regardless of the setting of <attr:inheritAll/>. This allows you to + parameterize your subprojects. Properties defined on the command line + cannot be overridden by nested <elem:property/> elements.</p> + + <p>References to data types can also be passed to the new project, but + by default they are not. If you set the inheritrefs attribute to + true, all references will be copied, but they will not override + references defined in the new project.</p> + + <p>Nested <elem:reference/> elements can also be used to copy references + from the calling project to the + new project, optionally under a different id. References taken from + nested elements will override existing references that have been + defined outside of targets in the new project - but not those defined + inside of targets.</p> + </m:description> + + <!-- The task's attributes --> + <m:attributes> + <m:attribute name="antfile"> + <m:type>java.io.File</m:type> + <m:description> + <m:synopsis>the buildfile to use.</m:synopsis> + Defaults to "build.xml". This file is expected to be a filename + relative to the dir attribute given. + </m:description> + </m:attribute> + + <m:attribute name="dir"> + <m:type>java.io.File</m:type> + <m:description> + <m:synopsis> + the directory to use as a basedir for the new Ant project. + </m:synopsis> + Defaults to the current project's basedir, unless + inheritall has been set to false, in which case it doesn't + have a default value. This will override the basedir + setting of the called project. + </m:description> + </m:attribute> + + <m:attribute name="target"> + <m:type>java.lang.String</m:type> + <m:description> + <m:synopsis> + the target of the new Ant project that should be executed. + </m:synopsis> + Defaults to the new project's default target. + </m:description> + </m:attribute> + + <m:attribute name="output"> + <m:type>java.io.File</m:type> + <m:description> + <m:synopsis> + Filename to write the ant output to. + </m:synopsis> + This is relative to the value of the dir attribute if it has been + set or to the base directory of the current project otherwise. + </m:description> + </m:attribute> + + <m:attribute name="inheritAll"> + <m:type>boolean</m:type> + <m:description> + <m:synopsis>Whether to inherit properties.</m:synopsis> + If <m:true/>, pass all properties to the + new Ant project. Defaults to <m:false/>. + </m:description> + </m:attribute> + + <m:attribute name="inheritRefs"> + <m:type>boolean</m:type> + <m:description> + <m:synopsis>Whether to inherit references.</m:synopsis> + If <m:true/>, pass all references to the + new Ant project. Defaults to <m:false/>. + </m:description> + </m:attribute> + </m:attributes> + + <!-- The tasks nested-elements --> + <m:nested-elements> + <m:nested-element name="property"> + <m:description> + <m:synopsis> + Pass an explicit property value to the new Ant project. + </m:synopsis> + + <p>See the description of the <a:property/> task.</p> + + <p>These properties become equivalent to properties you define on + the command line. These are special properties and they will always + get passed down, even through additional <a:ant/>, <a:antcall/>, + <a:subant/> tasks with inheritAll set to <m:false/> (see above).</p> + + <p>Note that the <code>refid</code> attribute points to a + reference in the calling project, not in the new one.</p> + </m:description> + </m:nested-element> + + <m:nested-element name="reference"> + <m:description> + <m:synopsis> + Pass an explicit reference value to the new Ant project. + </m:synopsis> + Used to choose references that shall be copied into the + new project, optionally changing their id. + </m:description> + + <!-- The <reference> nested-element's attributes --> + <m:attributes> + <m:attribute name="refid"> + <m:type>java.lang.String</m:type> + <m:required/> + <m:description> + <m:synopsis> + The id of the reference in the <em>calling</em> project. + </m:synopsis> + </m:description> + </m:attribute> + + <m:attribute name="torefid"> + <m:type>java.lang.String</m:type> + <m:description> + <m:synopsis> + The id of the reference in the <em>new</em> project. + </m:synopsis> + Defaults to the value of <attr:refid/>. + </m:description> + </m:attribute> + </m:attributes> + </m:nested-element> + + <m:nested-element name="propertyset" since="1.6"> + <m:description> + You can specify a set of properties to be copied into the new + project with <a:propertyset/>s. + </m:description> + </m:nested-element> + + <m:nested-element name="target" since="1.6.3"> + <m:description> + <m:synopsis>Call an explicit target.</m:synopsis> + You can specify multiple targets using nested <elem:target/> + elements instead of using the target attribute. These will be + executed as if Ant had been invoked with a single target whose + dependencies are the targets so specified, in the order specified. + </m:description> + + <!-- The <target> nested-element's attributes --> + <m:attributes> + <m:attribute name="name"> + <m:type>java.lang.String</m:type> + <m:required/> + <m:description> + <m:synopsis>The name of the called target.</m:synopsis> + </m:description> + </m:attribute> + </m:attributes> + </m:nested-element> + + </m:nested-elements> + + <m:section name="Basedir of the new project"> + <p>The <attr:basedir/> value of the new project is affected + by the two attributes <attr:dir/> and <attr:inheritAll/>, + see the following table for details:</p> + + <table border="1" cellpadding="2" cellspacing="0"> + <tr> + <th valign="top">dir attribute</th> + <th valign="top">inheritAll attribute</th> + <th valign="top">new project's basedir</th> + </tr> + <tr> + <td valign="top">value provided</td> + <td valign="top">true</td> + <td valign="top">value of dir attribute</td> + </tr> + <tr> + <td valign="top">value provided</td> + <td valign="top">false</td> + <td valign="top">value of dir attribute</td> + </tr> + <tr> + <td valign="top">omitted</td> + <td valign="top">true</td> + <td valign="top">basedir of calling project (the one whose build + file contains the <code><ant></code> task).</td> + </tr> + <tr> + <td valign="top">omitted</td> + <td valign="top">false</td> + <td valign="top">basedir attribute of the <code><project></code> element + of the new project</td> + </tr> + </table> + </m:section> + + <m:examples> + <m:example> + <m:snippet> + <a:ant dir="subproject"/> + </m:snippet> + </m:example> + + <m:example> + <m:snippet> + <a:ant antfile="subproject/subbuild.xml" + dir="subproject" target="compile"/> + </m:snippet> + </m:example> + + <m:example> + <m:snippet> +<a:ant antfile="subproject/property_based_subbuild.xml"> + <a:property name="param1" value="version 1.x"/> + <a:property file="config/subproject/default.properties"/> +</a:ant> + </m:snippet> + </m:example> + + <m:example> + <m:snippet> +<a:ant inheritAll="false" antfile="subproject/subbuild.xml"> + <a:property name="output.type" value="html"/> +</a:ant> + </m:snippet> + </m:example> + + <m:example> + <m:snippet> +<a:ant antfile="subproject/subbuild.xml" + dir="subproject" target="compile"/> + +<a:ant dir="subproject"/> + +<a:ant antfile="subproject/property_based_subbuild.xml"> + <a:property name="param1" value="version 1.x"/> + <a:property file="config/subproject/default.properties"/> +</a:ant> + +<a:ant inheritAll="false" antfile="subproject/subbuild.xml"> + <a:property name="output.type" value="html"/> +</a:ant> + </m:snippet> + <m:description> + The build file of the calling project defines some <a:path/> + elements like this: + </m:description> + </m:example> + </m:examples> + <m:copyright>2000-2005</m:copyright> + </m:task> + +</m:manual> Added: ant/sandbox/antlibs/gendoc/manual/mkdir.xml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/manual/mkdir.xml?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/manual/mkdir.xml (added) +++ ant/sandbox/antlibs/gendoc/manual/mkdir.xml Fri Apr 15 08:00:09 2005 @@ -0,0 +1,61 @@ +<?xml version="1.0"?> + +<?xml-stylesheet type="text/xsl" href="../manual.xsl"?> + +<m:manual xmlns:m="uri:org.apache.ant:manual" + xmlns:a="antlib:org.apache.tools.ant"> + + <m:task name="mkdir"> + <!-- (OPTIONAL) A task could have a deprecated alternate name --> + <m:alias deprecated="true">md</m:alias> + + <!-- A short description of the task, that will be used + in a page listing all available tasks. + (Equivalent to the first sentence of a Javadoc block.) --> + + <!-- (OPTIONAL) A more in-depth description of the task. + (Equivalent to the rest sentence of a Javadoc block.) --> + <m:description> + <m:synopsis>Creates a <code>directory</code>.</m:synopsis> + Also non-existent parent directories are created, when necessary. + </m:description> + + <!-- The tasks attributes --> + <m:attributes> + <!-- Possibly allow to group attributes + <group id="bar"/> + --> + + <m:attribute name="dir"> <!-- groups="bar" --> + <m:type>java.io.File</m:type> + <m:required>unless foo is specified</m:required> + <m:description>the directory to create.</m:description> + </m:attribute> + </m:attributes> + + <!-- The tasks nested-elements --> + <m:nested-elements/> + + <m:examples> + <m:example> + <m:snippet> + <a:mkdir dir="${dist}" /> + </m:snippet> + <m:description> + Creates a directory <code>${dist}</code>. + </m:description> + </m:example> + + <m:example> + <m:snippet> + <a:mkdir dir="${dist}/lib" /> + </m:snippet> + <m:description> + Creates a directory <code>${dist}/lib</code>. + </m:description> + </m:example> + </m:examples> + <m:copyright>2000-2001,2004-2005</m:copyright> + </m:task> + +</m:manual> Added: ant/sandbox/antlibs/gendoc/whatsnew.xml URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/whatsnew.xml?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/whatsnew.xml (added) +++ ant/sandbox/antlibs/gendoc/whatsnew.xml Fri Apr 15 08:00:09 2005 @@ -0,0 +1,61 @@ +<?xml version="1.0"?> + +<?xml-stylesheet type="text/xsl" href="whatsnew.xsl"?> + +<w:whatsnew project="Ant" + title="What's New in Ant" + xmlns:w="uri:org.apache.ant:whatsnew" + xmlns:ac="antlib:net.sf.antcontrib" + xmlns:ant="antlib:org.apache.tools.ant" + xmlns:bm="antlib:com.lgc.buildmagic" + xmlns:ds="antlib:com.lgc.decisionspace" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <w:changes from="current Ant 1.6 CVS version" to="current CVS version"> + + <!-- =============================================== --> + <w:group name="Changes that could break older environments"> + <w:entry> + Use <w:class>org.apache.log4j.Logger</w:class> instead of + <w:class>org.apache.log4j.Category</w:class>. Category has been + deprecated for ~2 years and has been removed from the + <w:google>log4j</w:google> code. Logger was introduced in log4j + 1.2 so users of log4j 1.1 and log4j 1.0 need to upgrade to a newer + version of log4j. <w:bugzilla report="31951"/>. + </w:entry> + </w:group> + + <!-- =============================================== --> + <w:group name="Fixed bugs"> + <w:entry> + Translate task does not remove tokens when a key is not found. + It logs a verbose message. <w:bugzilla report="13936"/>. + </w:entry> + + <w:entry> + Incorrect task name with invalid "javac" task after a "presetdef. + <w:bugzilla reports="31389, 29499" />. + </w:entry> + + <w:entry> + <ant:manifest/> was not printing warnings about invalid manifest + elements. <w:bugzilla report="32190"/>. + </w:entry> + + <w:entry> + <ant:replace/> got out of memory on large files (part of + <w:bugzilla report="32566"/>). <ant:replace/> can now handle files + as long as there is enough disk space available. + </w:entry> + </w:group> + + <!-- =============================================== --> + <w:group name="Other changes"> + <w:entry> + <ant:echoproperties/> now (alphanumerically) sorts the property list + before echoing. <w:bugzilla report="18976"/>. + </w:entry> + </w:group> + </w:changes> + +</w:whatsnew> Added: ant/sandbox/antlibs/gendoc/whatsnew.xsl URL: http://svn.apache.org/viewcvs/ant/sandbox/antlibs/gendoc/whatsnew.xsl?view=auto&rev=161477 ============================================================================== --- ant/sandbox/antlibs/gendoc/whatsnew.xsl (added) +++ ant/sandbox/antlibs/gendoc/whatsnew.xsl Fri Apr 15 08:00:09 2005 @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" + xmlns:w="uri:org.apache.ant:whatsnew" + xmlns:ac="antlib:net.sf.antcontrib" + xmlns:ant="antlib:org.apache.tools.ant" + xmlns:bm="antlib:com.lgc.buildmagic" + xmlns:ds="antlib:com.lgc.decisionspace" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:output method="html" encoding="UTF-8" indent="yes" + doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /> + + <!-- ================================================= --> + <xsl:template match="/w:whatsnew"> + <xsl:variable name="title"> + DecisionSpace Artifacts + ~ <xsl:value-of select="/artifacts/@cyclename"/> + </xsl:variable> + <html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title><xsl:value-of select="@title"/></title> + <style type="text/css"> + code { font: 9pt CourrierNew, regular; } + .antlib { background-color: #E5E5E5; } + .ns { color: #6A5ACD; background-color: #F2F2F2; } + .tag { color: #804040; font-weight: bold; } + .attr { color: #2E8B57; font-weight: bold; } + .value { color: #FF00FF; background-color: #F2F2F2; } + </style> + </head> + <body> + <h1>~ <xsl:value-of select="@title"/> ~</h1> + <xsl:apply-templates select="w:changes" /> + </body> + </html> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:changes"> + <h2> + From <xsl:value-of select="@from" /> + to <xsl:value-of select="@to" /> + </h2> + <xsl:apply-templates select="w:group" /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:group"> + <h3><xsl:value-of select="@name" /></h3> + <ul> + <xsl:apply-templates select="w:entry" /> + </ul> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:entry"> + <li> + <xsl:apply-templates /> + </li> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:bugzilla"> + <xsl:if test="@report"> + BugZilla report + <a href="http://issues.apache.org/bugzilla/[EMAIL PROTECTED]"> + <xsl:value-of select="@report" /> + </a> + </xsl:if> + <xsl:if test="@reports"> + BugZilla reports + <xsl:call-template name="tokenize-ids"> + <xsl:with-param name="ids" select="@reports" /> + </xsl:call-template> + </xsl:if> + </xsl:template> + + <!-- ================================================= --> + <xsl:template name="tokenize-ids"> + <xsl:param name="ids" select="normalize-space(.)" /> + <xsl:param name="lhs" select="substring-before($ids, ',')" /> + <xsl:param name="rhs" select="substring-after($ids, ',')" /> + <xsl:param name="id" select="normalize-space($lhs)" /> + <xsl:param name="rest" select="normalize-space($rhs)" /> + + <xsl:choose> + <xsl:when test="not(contains($ids, ','))"> + <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id={$ids}"> + <xsl:value-of select="$ids" /> + </a> + </xsl:when> + <xsl:otherwise> + <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id={$id}"> + <xsl:value-of select="$id" /> + </a> + <xsl:if test="not($rest = '')"> + <xsl:text>, </xsl:text> + <xsl:call-template name="tokenize-ids"> + <xsl:with-param name="ids" select="$rest" /> + </xsl:call-template> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:class"> + <code><xsl:apply-templates /></code> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="w:google"> + <a href="http://www.google.com/search?q={text()}"> + <xsl:value-of select="text()" /> + </a> + </xsl:template> + + + <!-- ================================================= + Handle generic XML + --> + + <!-- ================================================= --> + <xsl:template match="*[starts-with(namespace-uri(), 'antlib:')]"> + <xsl:variable name="ns" select="namespace-uri()" /> + <xsl:call-template name="tag"> + <xsl:with-param name="class" select="'antlib'" /> + <!-- TODO: Name should be a link to task/type documentation --> + <xsl:with-param name="name"> + <span title="{$ns}:{local-name()}"> + <!-- Drop the namespace prefix for Ant tasks/types --> + <xsl:if test="not($ns = 'antlib:org.apache.tools.ant')"> + <span class="ns"> + <xsl:value-of select="name(namespace::*[. = $ns])" /> + <!--<xsl:value-of select="substring-before(name(), ':')" />--> + </span>:<xsl:text/> + </xsl:if> + <span class="tag"><xsl:value-of select="local-name()" /></span> + </span> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="*[not(namespace-uri() = '')]" priority="-10"> + <xsl:call-template name="tag" /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="*[namespace-uri() = '']" priority="-20"> + <xsl:copy-of select="." /> + </xsl:template> + + <!-- ================================================= --> + <xsl:template name="tag"> + <xsl:param name="name" select="name()" /> + <xsl:param name="class" select="''" /> + + <code> + <xsl:if test="$class"> + <xsl:attribute name="class"> + <xsl:value-of select="$class" /> + </xsl:attribute> + </xsl:if> + + <!-- tag name start --> + <xsl:text/><<xsl:copy-of select="$name" /> + + <!-- show its attributes, if any --> + <xsl:apply-templates select="@*" mode="antlib" /> + + <xsl:choose> + <xsl:when test="node()"> <!-- SOME nested elements --> + <xsl:text/>><xsl:apply-templates /> + + <!-- tag name end (until lexical end of template) --> + <xsl:text/><<xsl:value-of select="$name" /> + </xsl:when> + <xsl:otherwise> + <xsl:if test="@*"> <!-- No nested elements but SOME attributes --> + <xsl:text> /</xsl:text> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + <xsl:text>></xsl:text> + </code> + </xsl:template> + + <!-- ================================================= --> + <xsl:template match="@*" mode="antlib"> + <xsl:text> </xsl:text> + <span class="attr"> + <xsl:value-of select="name()"/> + </span>=<span class="value"> + <xsl:text/>"<xsl:value-of select="."/>"<xsl:text/> + </span> + </xsl:template> + +</xsl:stylesheet> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]