Skip to content

Commit ffed2ec

Browse files
author
rbrewer
committed
Initial commit just to get a copy into the cloud. The build files should be
mostly correct, but the source doesn't build because it's just the source from the hackystat-developer-example project. git-svn-id: https://wattdepot.googlecode.com/svn/trunk@2 962b3a1e-5fa1-11de-82f7-67359cf3946f
1 parent e7a11f9 commit ffed2ec

28 files changed

+1241
-0
lines changed

README.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2+
<html>
3+
<head>
4+
<title>README</title>
5+
</head>
6+
7+
<body>
8+
For installation and usage instructions for this system,
9+
please see: http://code.google.com/p/wattdepot/.
10+
11+
12+
</html>

build.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<project name="wattdepot" default="compile" xmlns:ivy="antlib:org.apache.ivy.ant">
2+
<description>
3+
Build file for the WattDepot system.
4+
</description>
5+
6+
<!-- Override version number properties set in common.build.xml before loading it -->
7+
<property name="majorVersionNumber" value="0" />
8+
<property name="minorVersionNumber" value="0" />
9+
10+
<import file="common.build.xml" />
11+
12+
<target name="install-libraries" description="Install external libraries.">
13+
<ivy:retrieve organisation="org.junit" module="junit" revision="${junit.version}" pattern="${lib.dir}/junit/[artifact].[ext]" sync="true" inline="true" conf="default" log="download-only" transitive="false" type="jar" />
14+
<path id="junit.path" location="${lib.dir}/junit/junit.jar" />
15+
16+
<ivy:retrieve organisation="javax" module="mail" revision="${javamail.version}" pattern="${lib.dir}/javamail/[artifact].[ext]" sync="true" inline="true" conf="default" log="download-only" transitive="false" type="jar" />
17+
<path id="javamail.path" location="${lib.dir}/javamail/mail.jar" />
18+
19+
<ivy:retrieve organisation="org.restlet" module="restlet" revision="${restlet.version}" pattern="${lib.dir}/restlet/[artifact].[ext]" sync="false" inline="true" conf="core,net,simple" log="download-only" transitive="false" type="jar, javadoc, source" />
20+
<path id="restlet.path">
21+
<fileset dir="${lib.dir}/restlet">
22+
<include name="*.jar" />
23+
</fileset>
24+
</path>
25+
26+
<ivy:retrieve organisation="org.apache.derby" module="derby" revision="${derby.version}" pattern="${lib.dir}/derby/[artifact].[ext]" sync="true" inline="true" conf="default,locale" log="download-only" transitive="false" type="jar, javadoc, source" />
27+
<path id="derby.path">
28+
<fileset dir="${lib.dir}/derby">
29+
<include name="*.jar" />
30+
</fileset>
31+
</path>
32+
33+
<ivy:retrieve module="hackystat" organisation="org.hackystat" revision="${hackystat.version}" pattern="${lib.dir}/hackystat/utilities/[artifact].[ext]" sync="true" inline="true" log="download-only" conf="utilities" transitive="false" type="jar, javadoc, source" />
34+
<path id="utilities.path">
35+
<fileset dir="${lib.dir}/hackystat/utilities/">
36+
<include name="*.jar" />
37+
</fileset>
38+
</path>
39+
</target>
40+
41+
<!-- Basic properties for this system. -->
42+
<property name="system.name" value="wattdepot" />
43+
44+
<!-- The compile classpath is useful to many tools. -->
45+
<path id="compile.classpath">
46+
<path refid="junit.path" />
47+
<path refid="javamail.path" />
48+
<path refid="restlet.path" />
49+
<path refid="derby.path" />
50+
<path refid="utilities.path" />
51+
</path>
52+
53+
<target name="compile" depends="install-libraries" description="Compiles the code.">
54+
<!-- Now compile the code into build/classes -->
55+
<mkdir dir="${build.dir}/classes" />
56+
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" debug="on" includeAntRuntime="no">
57+
<classpath refid="compile.classpath" />
58+
<compilerarg value="-Xlint:all" />
59+
<compilerarg value="-Werror" />
60+
</javac>
61+
</target>
62+
63+
<target name="run" depends="compile" description="Compiles the sensorbase and starts it up.">
64+
<java classname="org.wattdepot.wattdepot.server.Server" fork="yes">
65+
<classpath>
66+
<pathelement location="${build.dir}/classes" />
67+
<path refid="compile.classpath" />
68+
</classpath>
69+
</java>
70+
</target>
71+
72+
</project>

checkstyle.build.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<project name="checkstyle" default="checkstyle" xmlns:ivy="antlib:org.apache.ivy.ant">
2+
<description>
3+
Runs checkstyle on system, using rules in: lib/checkstyle/checkstyle.modules.xml
4+
Invocation: ant -f checkstyle.build.xml
5+
For more information about checkstyle, goto http://checkstyle.sourceforge.net
6+
</description>
7+
8+
<import file="build.xml"/>
9+
<property name="checkstyle.dir" location="${build.dir}/checkstyle/"/>
10+
<property name="checkstyle.install.dir" location="${lib.dir}/checkstyle"/>
11+
<property name="checkstyle.jar" value="checkstyle-all.jar"/>
12+
<property name="checkstyle.failOnViolation" value="false"/>
13+
<property name="checkstyle.config.file" value="hackystat.checkstyle.xml"/>
14+
<property name="checkstyle.config.file.path" location="${configfiles.dir}/${checkstyle.config.file}"/>
15+
16+
<!-- Make sure Checkstyle is installed (using Ivy) and the local config file is downloaded. -->
17+
<ivy:retrieve module="checkstyle" organisation="com.puppycrawl" revision="${checkstyle.version}" pattern="${lib.dir}/checkstyle/[artifact].[ext]" sync="true" inline="true" log="download-only" conf="bundled" transitive="false" type="jar,report"/>
18+
<available file="${checkstyle.config.file.path}" type="file" property="checkstyle.config.available" />
19+
20+
<target name="checkstyle.install.config.file" unless="checkstyle.config.available">
21+
<get src="${configfiles.url}/${checkstyle.config.file}"
22+
dest="${checkstyle.config.file.path}" usetimestamp="true"/>
23+
</target>
24+
25+
<path id="checkstyle.classpath">
26+
<pathelement path="${build.dir}/classes"/>
27+
<path refid="compile.classpath"/>
28+
</path>
29+
30+
<target name="checkstyle" depends="compile, checkstyle.tool, checkstyle.report, checkstyle.sensor"
31+
description="Runs Checkstyle."/>
32+
33+
<target name="checkstyle.tool" depends="checkstyle.install.config.file" description="Checks the style of the sources and reports issues.">
34+
<taskdef resource="checkstyletask.properties" classpath="${checkstyle.install.dir}/${checkstyle.jar}" />
35+
<mkdir dir="${checkstyle.dir}"/>
36+
<checkstyle config="${checkstyle.config.file.path}"
37+
failOnViolation="${checkstyle.failOnViolation}"
38+
classpathref="checkstyle.classpath">
39+
<fileset dir="${src.dir}" includes="**/*.java" />
40+
<formatter type="plain"/>
41+
<formatter type="xml" tofile="${checkstyle.dir}/checkstyle.xml" />
42+
</checkstyle>
43+
</target>
44+
45+
<target name="checkstyle.report" description="Generates an HTML report for Checkstyle.">
46+
<xslt in="${checkstyle.dir}/checkstyle.xml"
47+
out="${checkstyle.dir}/index.html"
48+
style="${checkstyle.install.dir}/checkstyle-noframes.xsl">
49+
<param name="title" expression="Checkstyle Report" />
50+
<param name="module" expression="${system.name}" />
51+
</xslt>
52+
</target>
53+
54+
<target name="checkstyle.sensor" depends="install-sensors" description="Sends CodeIssue data to Hackystat using the Checkstyle Sensor.">
55+
<hacky-checkstyle verbose="${hackystat.verbose.mode}" failOnError="true">
56+
<datafiles>
57+
<fileset file="${checkstyle.dir}/checkstyle.xml" />
58+
</datafiles>
59+
</hacky-checkstyle>
60+
</target>
61+
62+
</project>
63+

common.build.xml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<project name="common" xmlns:ivy="antlib:org.apache.ivy.ant">
2+
<description>
3+
Boilerplate Ant code used by many Hackystat projects.
4+
</description>
5+
6+
<!-- Basic directory structure. -->
7+
<property name="src.dir" location="${basedir}/src" />
8+
<property name="lib.dir" location="${basedir}/lib" />
9+
<property name="build.dir" location="${basedir}/build" />
10+
11+
<!-- Make sure we're running a Java 5 or better. -->
12+
<condition property="java.5.available">
13+
<or>
14+
<contains string="${java.version}" substring="1.5" />
15+
<contains string="${java.version}" substring="1.6" />
16+
</or>
17+
</condition>
18+
<fail message="This package requires Java 5 or 6." unless="java.5.available" />
19+
20+
<!-- Make sure we're running Ant 1.7.1 or better. Ant 1.7.0 has a bug that we must avoid. -->
21+
<condition property="ant.1.7.available">
22+
<and>
23+
<contains string="${ant.version}" substring="1.7" />
24+
<not>
25+
<contains string="${ant.version}" substring="1.7.0" />
26+
</not>
27+
</and>
28+
</condition>
29+
<fail message="This package requires Ant 1.7.1 or better; found ${ant.version}" unless="ant.1.7.available" />
30+
31+
<!-- Make sure Ivy is installed. -->
32+
<import file="ivy.build.xml" />
33+
<available file="${ivy.jar.path}/ivy.jar" type="file" property="ivy.available" />
34+
<fail message="This package requires Ivy. To install, invoke 'ant -f ivy.build.xml'." unless="ivy.available" />
35+
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.path}/ivy.jar" />
36+
37+
<!-- Make sure library.versions.properties is installed, which provides all library version numbers. -->
38+
<property name="library.versions.path" location="${user.home}/.hackystat/library.versions.properties" />
39+
<available file="${library.versions.path}" type="file" property="library.versions.available" />
40+
<fail message="This package requires ~/.hackystat/library.versions.properties. To install, invoke 'ant -f ivy.build.xml'." unless="library.versions.available" />
41+
<!-- Now load all library version numbers. -->
42+
<property file="${library.versions.path}" />
43+
44+
<!-- Where to look for configuration files (Checkstyle, PMD, FindBugs, etc.) -->
45+
<property name="configfiles.url" value="http://hackystat.googlecode.com/svn/trunk/configfiles/" />
46+
<property name="configfiles.dir" location="${lib.dir}/configfiles" />
47+
<mkdir dir="${configfiles.dir}" />
48+
49+
<!-- Basic properties for this system. -->
50+
<property name="majorVersionNumber" value="8" />
51+
<property name="minorVersionNumber" value="3" />
52+
<tstamp>
53+
<format property="DAYSTAMP" pattern="Mdd" />
54+
</tstamp>
55+
<property name="version" value="${majorVersionNumber}.${minorVersionNumber}.${DAYSTAMP}" />
56+
57+
<!-- Hackystat sensor definitions and configuration. -->
58+
<property name="hackystat.verbose.mode" value="false" />
59+
<property name="hackystat.enable" value="false" />
60+
<!-- define hackystat.enabled if hackystat.enable is true, so we can use it in an 'if' clause -->
61+
<condition property="hackystat.enabled">
62+
<istrue value="${hackystat.enable}" />
63+
</condition>
64+
65+
<target name="convertLineEndings" description="Makes line endings compatible with host platform.">
66+
<fixcrlf srcdir="${basedir}" includes="*.build.xml" />
67+
</target>
68+
69+
<target name="clean" description="Delete build/ directory and top-level jar files.">
70+
<delete>
71+
<fileset dir="${basedir}" includes="*.jar" />
72+
</delete>
73+
<delete dir="${build.dir}" />
74+
<delete dir="${basedir}/sandbox" />
75+
</target>
76+
77+
<target name="reallyclean" depends="clean" description="Delete build/ directory, top-level jar files, and lib/ directory.">
78+
<delete dir="${lib.dir}" />
79+
</target>
80+
81+
<target name="install-sensors" description="Installs the Ant and XmlData sensors.">
82+
<ivy:retrieve module="hackystat" organisation="org.hackystat" revision="${hackystat.version}" pattern="${lib.dir}/hackystat-sensors/[artifact].[ext]" sync="false" inline="true" log="download-only" conf="ant,xmldata" transitive="false" type="jar"/>
83+
<taskdef resource="antlib.xml" classpath="${lib.dir}/hackystat-sensors/antsensors.jar" />
84+
<property name="hackystat-sensors.dir" location="${lib.dir}/hackystat-sensors/"/>
85+
</target>
86+
</project>

dependencyfinder.build.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<project name="dependencyfinder" default="dependencyfinder" xmlns:ivy="antlib:org.apache.ivy.ant">
2+
<description>
3+
Provides the DependencyFinder tool and the DependencyFinder sensor.
4+
</description>
5+
6+
<import file="build.xml"/>
7+
<property name="dependencyfinder.install.dir" location="${lib.dir}/dependencyfinder/" />
8+
<ivy:retrieve module="DependencyFinder" organisation="com.jeantessier" revision="${dependencyfinder.version}" pattern="${lib.dir}/dependencyfinder/[artifact].[ext]" sync="true" inline="true" log="download-only" type="jar,report"/>
9+
10+
<property name="dependencyfinder.dir" location="${build.dir}/dependencyfinder" />
11+
12+
<path id="dependencyfinder.path">
13+
<pathelement location="${dependencyfinder.install.dir}" /> <!-- for log4j.properties -->
14+
<fileset dir="${dependencyfinder.install.dir}">
15+
<include name="*.jar" />
16+
</fileset>
17+
</path>
18+
19+
<target name="dependencyfinder" depends="dependencyfinder.tool, dependencyfinder.report, dependencyfinder.sensor"
20+
description="Runs DependencyFinder tool, report, and sensor."/>
21+
22+
<target name="dependencyfinder.tool" depends="compile" description="Computes dependency metrics on the source code.">
23+
<!-- Verify that DependencyFinder is installed. -->
24+
<taskdef name="dependencyextractor" classname="com.jeantessier.dependencyfinder.ant.DependencyExtractor" classpathref="dependencyfinder.path"/>
25+
<taskdef name="dependencyreporter" classname="com.jeantessier.dependencyfinder.ant.DependencyReporter" classpathref="dependencyfinder.path"/>
26+
<mkdir dir="${dependencyfinder.dir}"/>
27+
<!-- Extract dependencies, excluding java.* and javax.* packages. -->
28+
<dependencyextractor destfile="${dependencyfinder.dir}/all.xml" filterexcludes="/^java\./||/^javax\./" xml="yes" minimize="yes">
29+
<path path="${build.dir}/classes" />
30+
</dependencyextractor>
31+
<!-- Create a class2class.xml file containing just class-level dependency information. -->
32+
<dependencyreporter srcfile="${dependencyfinder.dir}/all.xml" destfile="${dependencyfinder.dir}/class2class.xml"
33+
c2c="yes" showall="yes" validate="yes" xml="yes" />
34+
</target>
35+
36+
<target name="dependencyfinder.report" description="Generates an HTML report from DependencyFinder data.">
37+
<xslt style="${dependencyfinder.install.dir}/DependencyGraphToHTML.xsl"
38+
in="${dependencyfinder.dir}/all.xml" out="${dependencyfinder.dir}/all/index.html" />
39+
<xslt style="${dependencyfinder.install.dir}/DependencyGraphToHTML.xsl"
40+
in="${dependencyfinder.dir}/class2class.xml" out="${dependencyfinder.dir}/class2class/index.html" />
41+
</target>
42+
43+
44+
<target name="dependencyfinder.sensor" depends="install-sensors" unless="dependencyfinder.disabled" description="Sends coupling data to Hackystat using the DependencyFinder sensor.">
45+
46+
<hacky-dependencyfinder verbose="${hackystat.verbose.mode}" failOnError="true">
47+
<datafiles>
48+
<fileset file="${dependencyfinder.dir}/class2class.xml"/>
49+
</datafiles>
50+
<sourcefiles>
51+
<fileset dir="${src.dir}" includes="**/*.java" />
52+
</sourcefiles>
53+
</hacky-dependencyfinder>
54+
</target>
55+
56+
</project>
57+

dist.build.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<project name="dist" default="dist">
2+
<description>
3+
Provides the target for building a distribution of this system.
4+
</description>
5+
6+
<import file="build.xml"/>
7+
<import file="jar.build.xml"/>
8+
9+
<target name="dist" depends="clean, compile, publish" description="Create a distribution package.">
10+
<!-- Define the directories and distribution name -->
11+
<property name="dist.dir" location="${build.dir}/dist" />
12+
<property name="dist.tmp.dir" location="${basedir}/dist-tmp" />
13+
<property name="dist.name" value="${system.name}-${version}" />
14+
15+
<!-- Copy distribution files to the tmp dir. -->
16+
<mkdir dir="${dist.tmp.dir}/${dist.name}" />
17+
<copy todir="${dist.tmp.dir}/${dist.name}">
18+
<fileset dir="${basedir}" excludes="lib/**, javadoc/**, dist-tmp/**, bin/**, **/.svn/*, **/*~, tmp/**, build/**" />
19+
</copy>
20+
<copy todir="${dist.tmp.dir}/${dist.name}">
21+
<fileset dir="${build.jar.dir}" includes="*.jar" />
22+
</copy>
23+
24+
<!-- Create the zip distribution of this system, and then delete the tmp dir. -->
25+
<mkdir dir="${dist.dir}" />
26+
<zip zipfile="${dist.dir}/${dist.name}.zip" basedir="${dist.tmp.dir}" />
27+
<delete dir="${dist.tmp.dir}"/>
28+
</target>
29+
30+
</project>

0 commit comments

Comments
 (0)