Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

How to use javancss ant task to count number of code lines, number of methods, etc

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have downloaded the javancss ant task but when i try to use it to count number of lines and generate a report it gives me an error saying that the javancss ant task does not support those attributes.

This is the ant target i wrote
<target name="collect-metrics">
<javancss srcdir="${project.source.dir}" abortOnFail="false"
generateReport="yes" outputfile="report.xml"
format="xml" includes="**/*.java" />
</target>

I have also added the taskdef as follows
<taskdef name="javancss" classname="net.jernigan.javancss2ant.JavaNCSS"
classpath="${javancss.ant.lib};${javancss.lib};${javancss.jhbasic.lib};${javancss.ccl.lib}" />

What am i doing wrong?
 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaron,
Can you try to narrow down the problem to see what attribute it is complaining about?

First try <javancss srcdir="${project.source.dir}" />. Per the documentation, this is the only required property. If it works, the problem is in one of the other attributes and you can add them one at a time to see where the problem lies. If it doesn't work, the problem may be in classpath or configuration.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<taskdef name="javancss" classname="net.jernigan.javancss2ant.JavaNCSS"
classpath="${javancss.ant.lib};${javancss.lib};${javancss.jhbasic.lib};${javancss.ccl.lib}" />
In the example from the documentation, the task is defined like this :
<taskdef name="javancss" classname="javancss.JavancssAntTask" classpath="${CLASSPATH}"/>
Try to change the classname.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!