[Japi-cvs] SF.net SVN: japi:[703] tools
Status: Beta
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-11-30 15:25:32
|
Revision: 703
http://japi.svn.sourceforge.net/japi/?rev=703&view=rev
Author: christianhujer
Date: 2008-11-30 15:25:28 +0000 (Sun, 30 Nov 2008)
Log Message:
-----------
Added TodoScanner tool.
Added Paths:
-----------
tools/todoScanner/
tools/todoScanner/branches/
tools/todoScanner/tags/
tools/todoScanner/trunk/
tools/todoScanner/trunk/build.xml
tools/todoScanner/trunk/lib/
tools/todoScanner/trunk/module.properties
tools/todoScanner/trunk/src/
tools/todoScanner/trunk/src/doc/
tools/todoScanner/trunk/src/prj/
tools/todoScanner/trunk/src/prj/net/
tools/todoScanner/trunk/src/prj/net/sf/
tools/todoScanner/trunk/src/prj/net/sf/japi/
tools/todoScanner/trunk/src/prj/net/sf/japi/tools/
tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/
tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/TodoScanner.java
tools/todoScanner/trunk/src/tst/
tools/todoScanner/trunk/todoScanner.iml
Property changes on: tools/todoScanner/trunk
___________________________________________________________________
Added: svn:externals
+ common https://japi.svn.sourceforge.net/svnroot/japi/common/trunk
Added: tools/todoScanner/trunk/build.xml
===================================================================
--- tools/todoScanner/trunk/build.xml (rev 0)
+++ tools/todoScanner/trunk/build.xml 2008-11-30 15:25:28 UTC (rev 703)
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ TodoScanner is a program for finding TODO comments.
+ ~ Copyright (C) 2008 Christian Hujer
+ ~
+ ~ This program is free software; you can redistribute it and/or modify
+ ~ it under the terms of the GNU General Public License as published by
+ ~ the Free Software Foundation; either version 2 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along
+ ~ with this program; if not, write to the Free Software Foundation, Inc.,
+ ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ -->
+
+<project name="Replacer" default="buildapp">
+
+ <property file="module.properties" />
+
+ <!-- Sets module.version to something very reasonable, depending on whether we're in trunk, tags, branches or somewhere else. -->
+ <basename property="dir.version" file="${user.dir}" />
+ <dirname property="parent" file="${user.dir}" />
+ <basename property="parentRegion" file="${parent}" />
+ <exec outputproperty="svnversion" executable="svnversion">
+ <env key="LC_ALL" value="C" />
+ </exec>
+ <condition property="module.version" value="trunk-${svnversion}">
+ <equals arg1="trunk" arg2="${dir.version}" />
+ </condition>
+ <condition property="module.version" value="branch-${dir.version}-${svnversion}">
+ <equals arg1="branches" arg2="${parentRegion}" />
+ </condition>
+ <condition property="module.version" value="${dir.version}">
+ <equals arg1="tags" arg2="${parentRegion}" />
+ </condition>
+ <property name="module.version" value="${parentRegion}-${dir.version}-${svnversion}" />
+
+ <property name="main.class" value="net.sf.japi.tools.replacer.Replacer" />
+
+ <taskdef name="pack200" classpath="common/antlib/Pack200Task.jar" classname="com.sun.tools.apache.ant.pack200.Pack200Task" />
+
+ <target
+ name = "clean"
+ description = "Cleans Sandbox"
+ >
+ <delete dir="classes" />
+ <delete dir="docs" />
+ </target>
+
+ <target
+ name = "compile"
+ description = "Compiles production classes"
+ >
+ <mkdir dir="classes/production/${module.shortname}" />
+ <javac
+ srcdir="src/prj"
+ destdir="classes/production/${module.shortname}"
+ encoding="utf-8"
+ source="1.5"
+ target="1.5"
+ >
+ <classpath>
+ <fileset dir="lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ <fileset dir="common/lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ </classpath>
+ </javac>
+ <copy
+ todir="classes/production/${module.shortname}"
+ >
+ <fileset dir="src/prj" includes="**/*.properties" excludes="test/**/*.properties" />
+ <fileset dir="src/prj" includes="META-INF/services/**" />
+ </copy>
+ <copy
+ todir="classes/production/${module.shortname}"
+ >
+ <fileset dir="lib" includes="LICENSE-*" />
+ <fileset dir="." includes="COPYING" />
+ </copy>
+ </target>
+
+ <target
+ name = "dist"
+ description = "Packs distribution archives."
+ depends = "clean, compile"
+ >
+ <delete dir="dist" />
+ <mkdir dir="dist" />
+ <property name="distName" value="dist/${module.name}-${module.version}" />
+ <parallel>
+ <tar tarfile="${distName}.src.tar">
+ <tarfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </tarfileset>
+ </tar>
+ <zip destfile="${distName}.src.zip">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </zip>
+ <jar destfile="${distName}.src.jar">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="src/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </jar>
+ <jar destfile="${distName}.jar">
+ <zipfileset dir="classes/production/${module.shortname}"/>
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ <attribute name="Class-Path" value="lib/annotations.jar lib/japi-lib-lang-0.1.jar lib/japi-lib-swing-about-0.1.jar lib/japi-lib-swing-action-0.1.jar" />
+ <attribute name="Implementation-Title" value="${module.name}" />
+ <attribute name="Implementation-Vendor" value="Christian Hujer + the JAPI Developers" />
+ <attribute name="Implementation-Version" value="${module.version}" />
+ <attribute name="Implementation-URL" value="http://sourceforge.net/projects/japi/" />
+ </manifest>
+ </jar>
+ <tar tarfile="${distName}.doc.tar">
+ <tarfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ <include name="build.xml" />
+ </tarfileset>
+ </tar>
+ <zip destfile="${distName}.doc.zip">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ <include name="build.xml" />
+ </zipfileset>
+ </zip>
+ <jar destfile="${distName}.doc.jar">
+ <zipfileset dir="." prefix="${module.name}-${module.version}">
+ <include name="docs/**" />
+ </zipfileset>
+ </jar>
+ </parallel>
+ <parallel>
+ <gzip src="${distName}.src.tar" destfile="${distName}.src.tar.gz" />
+ <bzip2 src="${distName}.src.tar" destfile="${distName}.src.tar.bz2" />
+ <gzip src="${distName}.doc.tar" destfile="${distName}.doc.tar.gz" />
+ <bzip2 src="${distName}.doc.tar" destfile="${distName}.doc.tar.bz2" />
+ <pack200
+ src="${distName}.jar"
+ destfile="${distName}.pack.gz"
+ gzipoutput="true"
+ stripdebug="true"
+ effort="9"
+ keepfileorder="false"
+ modificationtime="latest"
+ deflatehint="false"
+ />
+ </parallel>
+ <delete file="${distName}.src.tar" />
+ <delete file="${distName}.doc.tar" />
+ </target>
+
+ <target
+ name = "doc"
+ description = "Creates public javadoc documentation."
+ >
+ <mkdir dir="docs/api" />
+ <!--copy todir="docs/api" file="src/doc/api/public/copyright.html" />
+ <copy todir="docs/api" file="src/doc/api/public/.htaccess" /-->
+ <javadoc
+ destdir = "docs/api"
+ access = "protected"
+ author = "yes"
+ version = "yes"
+ locale = "en_US"
+ use = "yes"
+ splitindex = "yes"
+ windowtitle = "JAPI Library ${module.title} ${module.version} API documentation"
+ doctitle = "JAPI<br />Yet another Java API<br />Library ${module.title} ${module.version} API documentation"
+ header = "JAPI Library ${module.title} ${module.version}<br />API Documentation"
+ footer = "JAPI<br />Yet another Java API<br />Library ${module.title} ${module.version} API documentation"
+ bottom = "<div style=" text-align:center;">© 2005-2006 Christian Hujer. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>"
+ serialwarn = "yes"
+ charset = "utf-8"
+ docencoding = "utf-8"
+ encoding = "utf-8"
+ source = "1.5"
+ linksource = "yes"
+ link = "${user.javadoc.link}"
+ >
+ <!--
+ overview = "src/overview.html"
+ -->
+ <classpath>
+ <fileset dir="lib" includes="annotations.jar" />
+ </classpath>
+ <sourcepath>
+ <pathelement path="${user.javadoc.javasrc}" />
+ <pathelement path="src/prj" />
+ </sourcepath>
+ <packageset
+ dir="src/prj"
+ defaultexcludes="yes"
+ >
+ <include name="net/**" />
+ </packageset>
+ <taglet name="net.sf.japi.taglets.FixmeTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.HistoryTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.InvariantTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.NoteTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.PostconditionTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.PreconditionTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.ReturnValueTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.TodoTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.WarningTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ <taglet name="net.sf.japi.taglets.XxxTaglet" path="${commonPath}/antlib/japi-lib-taglets-trunk.jar" />
+ </javadoc>
+ </target>
+
+ <target
+ name = "buildapp"
+ description = "Creates executable jar"
+ depends = "compile"
+ >
+ <property name="appName" value="${module.name}-${module.version}-app" />
+ <jar destfile="${appName}.jar">
+ <zipfileset dir="classes/production/${module.shortname}"/>
+ <zipgroupfileset dir="lib" includes="*.jar" excludes="LICENSE-*.jar" />
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ <!--attribute name="Class-Path" value="lib/annotations.jar lib/japi-lib-lang-0.1.jar lib/japi-lib-swing-about-0.1.jar lib/japi-lib-swing-action-0.1.jar" /-->
+ <attribute name="Implementation-Title" value="${module.name}" />
+ <attribute name="Implementation-Vendor" value="Christian Hujer + the JAPI Developers" />
+ <attribute name="Implementation-Version" value="${module.version}" />
+ <attribute name="Implementation-URL" value="http://sourceforge.net/projects/japi/" />
+ </manifest>
+ </jar>
+ </target>
+
+</project>
Property changes on: tools/todoScanner/trunk/build.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ LF
Added: tools/todoScanner/trunk/module.properties
===================================================================
--- tools/todoScanner/trunk/module.properties (rev 0)
+++ tools/todoScanner/trunk/module.properties 2008-11-30 15:25:28 UTC (rev 703)
@@ -0,0 +1,23 @@
+#
+# Replacer is a command for performing regular expression substitutions.
+# Copyright (C) 2008 Christian Hujer.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+update.focus=none
+module.name=TodoScanner
+module.shortname=TodoScanner
+module.title=TodoScanner
Property changes on: tools/todoScanner/trunk/module.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/TodoScanner.java
===================================================================
--- tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/TodoScanner.java (rev 0)
+++ tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/TodoScanner.java 2008-11-30 15:25:28 UTC (rev 703)
@@ -0,0 +1,78 @@
+package net.sf.japi.tools.todoScanner;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.util.List;
+import net.sf.japi.io.args.ArgParser;
+import net.sf.japi.io.args.BasicCommand;
+import org.jetbrains.annotations.NotNull;
+
+/** Scanner for comments of specific formats like to do comments.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class TodoScanner extends BasicCommand {
+
+ /** The file encoding that is used for reading and writing files as weil es parsing substitutions from {@link System#in}. */
+ private Charset encoding = Charset.defaultCharset();
+
+ /** Main program.
+ * @param args Command line arguments (try --help).
+ */
+ public static void main(@NotNull final String... args) {
+ ArgParser.simpleParseAndRun(new TodoScanner(), args);
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings({"InstanceMethodNamingConvention"})
+ public int run(@NotNull final List<String> args) throws Exception {
+ if (args.size() == 0) {
+ scanForTodos(System.in);
+ } else {
+ for (final String filename : args) {
+ scanForTodos(new File(filename));
+ }
+ }
+ return 0;
+ }
+
+ /** Scans for todos in the specified file.
+ * @param file File to scan for todos.
+ * @throws IOException In case of I/O problems.
+ */
+ public void scanForTodos(@NotNull final File file) throws IOException {
+ final InputStream in = new FileInputStream(file);
+ try {
+ scanForTodos(in);
+ } finally {
+ in.close();
+ }
+ }
+
+ /** Scans for todos in the specified stream.
+ * @param in Stream to scan for todos.
+ * @throws IOException In case of I/O problems.
+ */
+ public void scanForTodos(@NotNull final InputStream in) throws IOException {
+ scanForTodos(new InputStreamReader(in, encoding));
+ }
+
+ /** Scans for todos in the specified stream.
+ * @param cin Stream to scan for todos.
+ * @throws IOException In case of I/O problems.
+ */
+ public void scanForTodos(@NotNull final Reader cin) throws IOException {
+ final BufferedReader in = cin instanceof BufferedReader ? (BufferedReader) cin : new BufferedReader(cin);
+ int lineNumber = 0;
+ for (String line; (line = in.readLine()) != null; lineNumber++) {
+ if (line.matches("TODO")) {
+ System.out.println(lineNumber + ": " + line);
+ }
+ }
+ }
+}
Property changes on: tools/todoScanner/trunk/src/prj/net/sf/japi/tools/todoScanner/TodoScanner.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: tools/todoScanner/trunk/todoScanner.iml
===================================================================
--- tools/todoScanner/trunk/todoScanner.iml (rev 0)
+++ tools/todoScanner/trunk/todoScanner.iml 2008-11-30 15:25:28 UTC (rev 703)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/doc" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/prj" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/tst" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="libs-argparser" />
+ <orderEntry type="library" name="annotations" level="project" />
+ <orderEntry type="library" name="junit" level="project" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Property changes on: tools/todoScanner/trunk/todoScanner.iml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ LF
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|