My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" ?>
<project name="crap4j" default="run-crap4j" basedir="..">

<!-- #1 redefine crap4j_home to point to the absolute directory where you unzipped crap4j -->
<property name="CRAP4J_HOME" value="/Users/bobevans/Documents/projects/crap4j/org.crap4j/dist/crap4j"/>

<!-- Define the Crap4j ant task -->
<taskdef name="crap4j" classname="org.crap4j.anttask.Crap4jAntTask" >
<classpath>
<fileset dir="${CRAP4J_HOME}/lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</taskdef>

<!-- #2 Setup your project base directory. In most cases, it can just be basedir.
The following is a fancy version -->
<!-- Use of ${project.dir.crap4j} allows for the resolution of relative paths
even when this file is imported in another build file -->
<dirname file="${ant.file.crap4j}" property="import.dir.crap4j" />
<condition property="my.project.root.dir" value="${import.dir.crap4j}/.." else="${basedir}">
<isset property="import.dir.crap4j" />
</condition>

<!-- #3 Use crap4j on the project -->
<target name="run-crap4j">
<crap4j projectdir="${my.project.root.dir}"
outputDir="agitar/reports/crap4j"
dontTest="false" debug="false">

<classes>
<!-- put the project's class directories here. These are the classes you want crap numbers for -->
<pathElement location="${my.project.root.dir}/bin" />
</classes>

<srces>
<!-- The project's src folders -->
<pathElement location="${my.project.root.dir}/src" />
</srces>

<testClasses>
<!-- The project's test classes.
Note, separating it from the project classes makes life so much easier
but if you didn't, then you probably just want to repeat the classDir entry here -->
<pathElement location="${my.project.root.dir}/test_bin" />
<pathElement location="${my.project.root.dir}/integration_tests_bin" />
<pathElement location="${my.project.root.dir}/agitar/test_bin" />
</testClasses>

<libClasspath>
<!-- Put the dependent paths and libraries here.
This is for stuff necessary to your project, but not stuff you want analyzed -->
<fileset dir="${my.project.root.dir}/lib">
<include name="**/*.jar" />
</fileset>
<!-- if you get errors loading any agitar classes, like the mock classes, add this entry -->
<!--
<fileset dir="${CRAP4J_HOME}/lib/com.agitar.eclipse.api_4.2.0.401405/lib/ext">
<include name="**/*.jar" />
</fileset>
-->
</libClasspath>

</crap4j>
</target>
</project>

Change log

r197 by bob on Dec 6, 2007   Diff
more ant testing for filesets,
particularly antbuilder's use of mixed
filesets
Go to: 
Project members, sign in to write a code review

Older revisions

r169 by bob on Nov 30, 2007   Diff
fix for #38, better ant element names
for mixed class and dir elements
r159 by bob on Nov 27, 2007   Diff
Fix #9 Add better discriminant for
test classes in CrapProject.
Fix #35 ignore abstract classes.
r115 by bob on Nov 8, 2007   Diff
preliminary 1.1.5 -- benchmarking, bug
fixes
All revisions of this file

File info

Size: 2608 bytes, 66 lines
Powered by Google Project Hosting