JavaScud | Forum | JIRA | Blog |
  Dashboard > Todolet > Todolet文档
  Todolet Log In View a printable version of the current page.  
  Todolet文档
Added by scud, last edited by dohkoos on Sep 04, 2006  (view change)
Labels: 
(None)

Todolet简介

Todolet是一个建立在JTopas (Java tokenizer and parser tools)基础上的Ant任务。用来搜集任意文件(不仅仅是java文件,也可以是xml、properties等文件格式)中TODO注释。
目前只支持/**///#<!-- -->等注释。

使用说明

假如我们在applicationContext.xml里写了一个bean定义,如下所示:

applicationContext.xml
<bean id="example" class="org.jscud.example.FooBar">
</bean>

以后可能要给这个定义添加一些属性,但又怕到时记不住具体是哪个文件,这时候就可以通过在该文件中添加TODO注释来记住它,
就像在java文件中添加TODO注释一样。

applicationContext.xml
<bean id="example" class="org.jscud.example.FooBar">
<!-- TODO: comments -->
</bean>

然后编写一个ant task来收集applicationContext.xml中的TODO注释。

Ant Task
<taskdef resource="todo.properties" classpath="${lib.dir}/todolet-0.0.1.jar" />

<target name="todo" description="Generate report of todos in specified files">
    <property name="todo.report.dir" value="${build.dir}/docs/todo" />

    <empty dir="${todo.report.dir}" />
    <todo destdir="${todo.report.dir}">
        <fileset dir="${basedir}">
            <patternset includes="**/*.java" />
            <patternset includes="**/*.xml" />
            <patternset includes="**/*.sql" />
            <patternset includes="**/*.properties" />
        </fileset>
    </todo>
</target>

执行todolet任务后就会生成一个类似于以下样式的todo.txt文件

todo.txt
(applicationContext.xml) comments

文件下载

todolet-0.0.1.jar
todolet-src-0.0.1.zip

代码库

http://svn.javascud.org/svn/todolet

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators