Crap4j 1.1.4 Release w/ Ant Task

New!

There’s a new version of Crap4j available. The big feature is Ant support via a new Crap4j Ant task.

This won’t mean as much if you are using the Eclipse plugin, but if you want to incorporate the Crap score into your regular build, or if you want more control over the classpath setup for your project, this will be a way to achieve it.

For the Eclipse users, you can just update the existing version via the Update Manager.

For the Ant version, there is a different distribution (sometime soon I will make it one download.) You can get the zip file at http://www.crap4j.org/downloads/crap4j_ant_latest.jar.

See the full usage instructions on the Ant Usage Page.

We hope you find it useful, and please let us know how it works for you.

2 Responses to “Crap4j 1.1.4 Release w/ Ant Task”

  1. Mike Colegrove Says:

    The ant version still has dependencies on an Eclipse like environment. I have not been able to get the coverage report include in with the class distribution to properly calculate the crap score.

    We want to run this in an continuous build cycle and not all users will be using Eclipse or possibly even an IDE to do the analysis.

    The ant implementation could be done better to allow you to pass in jvm arguments, allow forking, and pass in ant home and additional libraries.

    However, this is a great concept and I am looking forward to the refined result.

  2. bob Says:

    Hi Mike,

    The ant version doesn’t require Eclipse. I had suggested an easy way to get the build.xml was to generate it in Eclipse, but it isn’t necessary at all.

    The ant task can be better indeed, and that is a focus for the next release 1.1.6. It does take ANT_HOME as passed in by the environment, and additional libraries the same way. (You can also add additional libraries to the taskdef.)

    As for forking, the agitar test runner task already requires forking to run tests, and then the complexity and crap calculation are pretty quick, but you are correct that the running of the whole computation is not currently forkable.

    As for passing in jvm args, that is also something useful to do. I am wondering, if it might be better to actually have the crap4j task dependent on some other testrunner task that generates coverage, specified separately in the ant file, and possibly also a component for complexity to be pluggable as well. Then it would just focus on computing the crap score from the work of those two components. How does this sound to you?

    Please feel free to file requests and bugs on the bug system at http://trac.crap4j.org/. I look forward to hearing more detail about how you want to use it.

    Thanks for trying it,
    Bob

Leave a Reply