Permalink
Browse files

JRUBY-2292: Initial draft of Ivy and FindBugs integration

  • Loading branch information...
1 parent c222583 commit ec41d76fef9a997ecf8be9aa3b2d6d62a1bcc45f James Abley committed with headius May 31, 2009
Showing with 101 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 build.xml
  3. +7 −0 findbugs.xml
  4. +65 −0 ivy/build.xml
  5. +15 −0 ivy/ivy.xml
  6. +12 −0 ivy/ivysettings.xml
View
@@ -26,3 +26,4 @@ gem/pkg
*.orig
*.rej
tool/nailgun/ng
+jruby-findbugs.html
View
@@ -46,6 +46,7 @@
</patternset>
<import file="netbeans-ant.xml" optional="true"/>
+ <import file="ivy/build.xml" />
<!-- Initializes the build -->
<target name="init">
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FindBugsFilter>
+ <Match>
+ <Package name="~org\.jruby\.*" />
+ <Bug code="Nm" />
+ </Match>
+</FindBugsFilter>
View
@@ -0,0 +1,65 @@
+<project xmlns:ivy="antlib:org.apache.ivy.ant">
+
+ <property name="ivy.install.version" value="2.0.0" />
+ <property name="ivy.jar.dir" value="${user.home}/.ivy2" />
+ <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" />
+ <property name="jsch.install.version" value="0.1.29" />
+ <property name="jsch.jar.file" value="${ivy.jar.dir}/jsch-${jsch.install.version}.jar" />
+
+ <!--
+ download ivy from the web site so that it can be used without being
+ installed. if the file has already been downloaded, we use a rename
+ trick to avoid hitting the website again. (that would be annoying
+ when building offline.)
+ -->
+ <target name="download-ivy" unless="skip.download">
+ <mkdir dir="${ivy.jar.dir}" />
+ <condition property="ivy.url" value="file:${ivy.jar.file}">
+ <available file="${ivy.jar.file}" />
+ </condition>
+ <property name="ivy.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" />
+ <get src="${ivy.url}" dest="${ivy.jar.file}.download" usetimestamp="true" />
+ <move file="${ivy.jar.file}.download" tofile="${ivy.jar.file}" />
+
+ <condition property="jsch.url" value="file:${jsch.jar.file}">
+ <available file="${jsch.jar.file}" />
+ </condition>
+ <property name="jsch.url" value="http://repo1.maven.org/maven2/jsch/jsch/${jsch.install.version}/jsch-${jsch.install.version}.jar" />
+ <get src="${jsch.url}" dest="${jsch.jar.file}.download" usetimestamp="true" />
+ <move file="${jsch.jar.file}.download" tofile="${jsch.jar.file}" />
+ </target>
+
+ <!-- import ivy's ant tasks -->
+ <target name="install-ivy" depends="download-ivy">
+ <path id="ivy.lib.path">
+ <fileset dir="${ivy.jar.dir}" includes="ivy-${ivy.install.version}.jar" />
+ </path>
+ <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
+ </target>
+
+ <!-- where to look for the ivy config -->
+ <property name="ivy.dep.file" value="${basedir}/ivy/ivy.xml" />
+ <property name="ivy.settings.file" value="${basedir}/ivy/ivysettings.xml" />
+
+ <target name="findbugs" depends="install-ivy" description="Run Findbugs on JRuby source">
+
+ <!--
+ TODO move this out into a target that can be dependended on, and introduce code coverage,
+ cyclomatic complexity and any other metrics that you want to include.
+ -->
+ <ivy:resolve conf="check" />
+ <ivy:cachepath pathid="check.path" conf="check" />
+
+ <taskdef name="findbugs" classpathref="check.path" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/>
+
+ <findbugs classpathref="check.path" pluginList="" output="html" outputfile="${basedir}/jruby-findbugs.html"
+ excludefilter="${basedir}/findbugs.xml">
+ <sourcepath path="${basedir}/source" />
+ <class location="${jruby.classes.dir}" />
+ <auxclasspath>
+ <path refid="build.classpath" />
+ </auxclasspath>
+ </findbugs>
+ </target>
+
+</project>
View
@@ -0,0 +1,15 @@
+<ivy-module version="2.0">
+ <info organisation="org.jruby" module="jruby" revision="1.3-SNAPSHOT" />
+ <configurations>
+ <conf name="default" description="normal build" />
+ <conf name="test" visibility="private" description="build and run tests" />
+ <conf name="check" visibility="private" description="run analysis tools on the source" />
+ </configurations>
+ <publications>
+ <artifact />
+ <artifact name="jruby-sources" />
+ </publications>
+ <dependencies>
+ <dependency org="com.google.code.findbugs" name="findbugs" rev="1.3.8" conf="check->*" />
+ </dependencies>
+</ivy-module>
View
@@ -0,0 +1,12 @@
+<ivysettings>
+ <settings defaultResolver="chain-repos" />
+ <resolvers>
+ <chain name="chain-repos">
+ <!-- Disable consistency checking due to invalid poms for Findbugs -->
+ <ibiblio name="maven2" m2compatible="true" checkconsistency="false" />
+ </chain>
+ <filesystem name="local" m2compatible="true" transactional="false">
+ <artifact pattern="${basedir}/dist/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
+ </filesystem>
+ </resolvers>
+</ivysettings>

0 comments on commit ec41d76

Please sign in to comment.