ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Schirripa" <>
Subject Re: Count Task
Date Wed, 13 Mar 2002 14:19:43 GMT

  Does this do a physical or logical line count? If physical (meaning it
counts all physical lines, excluding blanks and comments), this might
require the developer(s) to adhere to a strict coding standard (which they
should anyway) before this makes sense.

  If it is logical, then a physical line would possibly be counted as
several logical lines (and vice versa). Some people in the industry prefer
logical line counters and others physical line counters - the debate rages

  Implementing logical line counters are tricky, and this is best achieved
by creating a class hierarchy/framework that supports plugging in logical
line counters for different languages, and possibly even the same language
(people define a line of code differently).

  I have also recently implemented something like this, except I focused on
Java and C++ as my target languages. Right now I have defined for myself a
coding standard and a line of code counter that adheres to it. Both
languages have a filter and a counter that adhere to a common interface.

  Unfortunately, I am far from being able to submit my work to the group, so
I just wanted to put in my 2 cents as you go forward with this effort. I
personally find it useful, especially in a situation where you are
collecting metrics such as defect rates.

Good luck,

----- Original Message -----
From: "Valentin Crettaz" <>
To: <>
Sent: Tuesday, March 12, 2002 1:39 PM
Subject: Count Task

> Hi everybody,
> I'm new to the ant community so I'll keep this short.
> I've developed a new task called "count" which summarizes the line counts
> of a project.
> Currently the following file types are implemented:
> *.jsp,*.php
> The syntax of the task is for instance:
> <count dir="." recursive="true" filter="java,xml,html"/>
> This recursively counts the source code lines of Java, XML and HTML
> files (filter="java,xml,html") beginning in the current
> directory (dir=".") and iterating in all nested directories
> the output is something like this:
>  [count] XML files in /homes/valentin/testing/ant:
>  [count]     8 program lines
>  [count]     3 comment lines
>  [count]     2 blank lines
>  [count]     13 lines in total
>  [count]
>  [count] Java files in /homes/valentin/testing/ant:
>  [count]     12 program lines
>  [count]     13 comment lines
>  [count]     4 blank lines
>  [count]     29 lines in total
>  [count]
>  [count] HTML files in /homes/valentin/testing/ant:
>  [count]     6 program lines
>  [count]     3 comment lines
>  [count]     2 blank lines
>  [count]     11 lines in total
>  [count]
>  [count] ---------------------------------------------
>  [count] All files in /homes/valentin/testing/ant:
>  [count]     26 program lines
>  [count]     19 comment lines
>  [count]     8 blank lines
>  [count]     53 lines in total
> So I just wanted to know if the Ant community would be interested in this
> or if another existing task already performs this.
> Thank you
> Val
> --
> Sun Certified Programmer for the Java 2 Platform
> Valentin Crettaz       Office: EK 247
> SRI International    Internet:
> 333 Ravenswood Ave.     Phone: +1 (650) 859 39 04
> Menlo Park, CA 94025   WWW:
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

Do You Yahoo!?
Get your free address at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message