Skip to content

Commit

Permalink
Added crap4j to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
unclebob committed Dec 18, 2008
1 parent 5a03aba commit d8289ce
Show file tree
Hide file tree
Showing 77 changed files with 1,947 additions and 164 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FitNesseRoot/ErrorLogs/
FitNesseRoot/RecentChanges/
src/fitnesse/FitNesseVersion.java
test-results/
agitar/
dist/
classes/
.svn
Expand Down
200 changes: 39 additions & 161 deletions FitNesse.iws

Large diffs are not rendered by default.

50 changes: 47 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
<property name="fitnesseRootZip" value="FitNesseRoot.zip"/>
<property name="zipDir" location="dist/fitnesse"/>
<property name="results.dir" location="test-results"/>
<property name="CRAP4J_HOME" value="crap4j"/>

<property name="cobertura.root" value="${lib}/cobertura-1.8"/>
<property name="cobertura.dir" value="${results.dir}/cobertura"/>
<taskdef name="crap4j" classname="org.crap4j.anttask.Crap4jAntTask">
<classpath>
<fileset dir="${CRAP4J_HOME}/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>

<path id="classpath">
<pathelement path="classes"/>
Expand Down Expand Up @@ -115,7 +121,6 @@

<target name="compile" depends="init, stamp-version" description="compile the source (make)">
<javac srcdir="src" destdir="classes" classpathref="classpath" debug="true"/>
<javac srcdir="srcFitServerTests" destdir="classes" classpathref="classpath" debug="true"/>
<copy file="extra/ant/tasks.properties" todir="classes"/>
</target>

Expand Down Expand Up @@ -181,4 +186,43 @@

<target name="release" depends="testbuild, build_distribution"/>

<target name="run-crap4j" depends="compile">
<crap4j projectdir="."
outputDir="test-results/crap4j"
dontTest="false" debug="false">

<classes>
<!-- put the project's class directories here. These are the classes you want crap numbers for -->
<pathElement location="classes"/>
</classes>

<srces>
<!-- The project's src folders -->
<pathElement location="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="classes"/>
</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="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>
15 changes: 15 additions & 0 deletions crap4j/RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Crap4j Release Notes


Version 1.1.6
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Crap-o-rama updated to show historical trends for crap metrics
Crap-o-rama updated to allow tagging of projects, and display of tagged projects
Ant task behaves better around filesets for class list
Ant task excludes class lists for the test task. New recommendation is to use superrunner task independently.
Better filtering on Test classes to remove them from crap results when there are ambiguous test output directories specified.
Added more feedback to user that crap4j is running. Now when the action is started in Eclipse, there is a dialog that notifies the user that running has commenced.
Fixed weird intermittent selection problem for enabling eclipse action when selecting projects.
Added more debugging to AnnotationVisitor, and another guard against NPEs.
Set precision on global avg in generated image.

Binary file added crap4j/crap4j_ant_latest.jar
Binary file not shown.
66 changes: 66 additions & 0 deletions crap4j/doc/example_build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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>
25 changes: 25 additions & 0 deletions crap4j/doc/projectConfig.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is an example project configuration file that runs crap4j on itself.

# Root directory of the project. Any relative paths for the other
# parameters are made relative to this.
#projectDir=c:\Documents and Settings\Agitar\My Documents\crap4j
projectDir=/Users/bobevans/Documents/projects/svnworkspace/crap4j

# The directory where reports will be sent.
# If unspecified, this defaults to <projectDir>/agitar/reports/crap4j.
outputDir=

# NOTE: Use the platform-specific path separators whenever there are
# multiple directories.

# The classpath of libraries used by the project.
libClasspaths=dist/crap4j/lib/asm-xml-3.0.jar:dist/crap4j/lib/asm-util-3.0.jar:dist/crap4j/lib/asm-tree-3.0.jar:dist/crap4j/lib/asm-commons-3.0.jar:dist/crap4j/lib/asm-analysis-3.0.jar:dist/crap4j/lib/asm-3.0.jar:dist/crap4j/lib/args4j-2.0.1.jar:dist/crap4j/lib/com.agitar.eclipse.coverage_4.2.0.401405/com.agitar.coverage.jar

# Directories containing the project's test class files.
testClassDirs=test_bin:integration_tests_bin:agitar/test_bin

# Directories containing project's class files, i.e., the classes to be analyzed.
classDirs=bin

# Directories containing the project's source files, i.e., the source files to be analyzed.
sourceDirs=src
Binary file added crap4j/lib/args4j-2.0.1.jar
Binary file not shown.
Binary file added crap4j/lib/asmlib.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_10-b03 (Sun Microsystems Inc.)
Bundle-Name: Agitar's public API Plug-in
Bundle-SymbolicName: com.agitar.eclipse.api; singleton=true
Bundle-Localization: plugin
Bundle-Activator: com.agitar.eclipse.api.APIPlugin
Provide-Package: com.agitar.eclipse.api,com.agitar.eclipse.api.quickfi
x,com.agitar.eclipse.api.variable,com.agitar.eclipse.api.runner,com.a
gitar.lib,org.apache.tools.ant.taskdefs.rmic,org.apache.commons.httpc
lient.params,org.apache.commons.httpclient.auth,com.agitar.testrunner
.parser,org.apache.commons.httpclient.methods.multipart,org.apache.to
ols.ant.taskdefs.cvslib,org.apache.tools.ant.filters,org.apache.tools
.ant.types.selectors,org.apache.commons.httpclient.util,junit.runner,
org.apache.tools.ant.types.selectors.modifiedselector,org.apache.tool
s.ant.util,org.apache.tools.zip,com.agitar.lib.mockingbird.java.io,or
g.apache.tools.ant.helper,org.apache.commons.codec,org.apache.xalan.x
path,junit.awtui,org.apache.tools.ant.filters.util,com.agitar.lib.moc
kingbird.tape,org.apache.tools.tar,org.apache.xalan.xslt,org.apache.t
ools.ant,com.agitar.lib.mockingbird.invocation,org.apache.tools.ant.t
askdefs.email,com.agitar.lib.junit,com.agitar.lib.mockingbird.java.ut
il,com.agitar.literunner,user.agitar.invocation,junit.swingui,org.apa
che.commons.codec.net,org.apache.tools.mail,com.agitar.lib.intercepto
r,org.apache.tools.ant.util.facade,org.apache.xalan.xslt.extensions,o
rg.apache.tools.ant.taskdefs.condition,org.apache.tools.ant.taskdefs,
org.apache.tools.ant.types,org.apache.xalan.xslt.trace,org.apache.com
mons.httpclient.protocol,com.agitar.testrunner,org.apache.commons.cod
ec.digest,com.agitar.lib.mockingbird,org.apache.tools.ant.util.regexp
,org.apache.commons.logging.impl,org.apache.tools.ant.launch,org.apac
he.tools.bzip2,org.apache.commons.httpclient.cookie,org.apache.common
s.httpclient.methods,com.agitar.instrument,org.apache.tools.ant.taskd
efs.compilers,org.apache.tools.ant.types.mappers,org.apache.xalan.xpa
th.dtm,com.agitar.concretemock,org.apache.tools.ant.types.resolver,or
g.apache.commons.codec.binary,org.apache.xalan.xpath.res,org.apache.t
ools.ant.taskdefs.optional.junit,junit.extensions,org.apache.tools.an
t.loader,org.apache.xalan.xslt.client,org.apache.xalan.xpath.xdom,org
.apache.commons.logging,junit.textui,org.apache.commons.httpclient,or
g.apache.xalan.xpath.xml,com.agitar.mockingbird.instrumenter,org.apac
he.tools.ant.input,com.agitar.junit.runner,org.apache.tools.ant.liste
ner,org.apache.xalan.xslt.res,junit.framework,org.apache.commons.code
c.language
Eclipse-LazyStart: false
Bundle-Version: 4.2.0.401405
Bundle-Vendor: Agitar Software
Bundle-ClassPath: com.agitar.eclipse.api.jar,com.agitar.mockingbird.ja
r,com.agitar.testrunner.jar,lib/ant-junit.jar,lib/ant-launcher.jar,li
b/ant.jar,lib/commons-codec-1.3.jar,lib/commons-httpclient-3.0.1.jar,
lib/commons-logging.jar,lib/junit.jar,lib/xalan.jar
Require-Bundle: org.eclipse.jdt.core,org.eclipse.core.runtime,org.ecli
pse.core.resources,org.eclipse.ui.workbench,org.eclipse.jdt.ui,org.ec
lipse.jface.text,org.eclipse.swt,org.eclipse.jface,org.eclipse.debug.
core,com.agitar.eclipse.coverage;reprovide=true

Loading

0 comments on commit d8289ce

Please sign in to comment.