Val, 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 on... 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, -Steve ----- Original Message ----- From: "Valentin Crettaz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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: > *.java,*.xml,*.html,*.js,*.properties,*.c,*.h,*.cpp,*.hpp,*.c++,*.h++,*.cxx, *.hxx > *.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 (recursive="true") > > 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 task > 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: [EMAIL PROTECTED] > 333 Ravenswood Ave. Phone: +1 (650) 859 39 04 > Menlo Park, CA 94025 WWW: http://www.sdl.sri.com/people/valentin/ > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
