ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Oxspring" <roxspr...@yahoo.com>
Subject [SUBMIT] Task to extract comments from a source file
Date Fri, 09 Nov 2001 21:08:59 GMT
Hi all,

I was investigating the possibility of producing generated documentation for
non-java source files recently, and one of the tasks (i've called it
doccommments) that emerged is attached.  The task extends is an extension of
the Copy task and allows the build engineer to suppy either a block comment
or line comment description to identify how to extract the comments.  The
linecomment element assumes that any text between the prefix and a newline
character is to be extracted, while the blockcomment uses a supplied prefix
and postfix to identify the block.  The blockcomment also allows you to
specify a lineprefix to allow the javadoc style of inserting an * at the
beginning of doc comment lines.  Example usage follows:

<doccomments todir="${build.dir}" overwrite="yes">
	<linecomment prefix="REM!"/>
	<fileset dir="${test.dir}" includes="**/*.bat"/>
</doccomments>

<doccomments todir="${build.dir}" overwrite="yes">
	<blockcomment prefix="/**" postfix="*/" lineprefix="*"/>
	<mapper type="glob" from="*.js" to="*.js.xml"/>
	<fileset dir="${test.dir}"/>
</doccomments>

If people find this useful then please feel free to use it,

If the committers like it then let me know and I'll add comments / docs /
test cases along with the apache licence.

Keep up the good work,

Rob

Mime
View raw message