|
| 1 | +<project xmlns:ivy="antlib:org.apache.ivy.ant"> |
| 2 | + |
| 3 | + <property name="ivy.install.version" value="2.0.0" /> |
| 4 | + <property name="ivy.jar.dir" value="${user.home}/.ivy2" /> |
| 5 | + <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy-${ivy.install.version}.jar" /> |
| 6 | + <property name="jsch.install.version" value="0.1.29" /> |
| 7 | + <property name="jsch.jar.file" value="${ivy.jar.dir}/jsch-${jsch.install.version}.jar" /> |
| 8 | + |
| 9 | + <!-- |
| 10 | + download ivy from the web site so that it can be used without being |
| 11 | + installed. if the file has already been downloaded, we use a rename |
| 12 | + trick to avoid hitting the website again. (that would be annoying |
| 13 | + when building offline.) |
| 14 | + --> |
| 15 | + <target name="download-ivy" unless="skip.download"> |
| 16 | + <mkdir dir="${ivy.jar.dir}" /> |
| 17 | + <condition property="ivy.url" value="file:${ivy.jar.file}"> |
| 18 | + <available file="${ivy.jar.file}" /> |
| 19 | + </condition> |
| 20 | + <property name="ivy.url" value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" /> |
| 21 | + <get src="${ivy.url}" dest="${ivy.jar.file}.download" usetimestamp="true" /> |
| 22 | + <move file="${ivy.jar.file}.download" tofile="${ivy.jar.file}" /> |
| 23 | + |
| 24 | + <condition property="jsch.url" value="file:${jsch.jar.file}"> |
| 25 | + <available file="${jsch.jar.file}" /> |
| 26 | + </condition> |
| 27 | + <property name="jsch.url" value="http://repo1.maven.org/maven2/jsch/jsch/${jsch.install.version}/jsch-${jsch.install.version}.jar" /> |
| 28 | + <get src="${jsch.url}" dest="${jsch.jar.file}.download" usetimestamp="true" /> |
| 29 | + <move file="${jsch.jar.file}.download" tofile="${jsch.jar.file}" /> |
| 30 | + </target> |
| 31 | + |
| 32 | + <!-- import ivy's ant tasks --> |
| 33 | + <target name="install-ivy" depends="download-ivy"> |
| 34 | + <path id="ivy.lib.path"> |
| 35 | + <fileset dir="${ivy.jar.dir}" includes="ivy-${ivy.install.version}.jar" /> |
| 36 | + </path> |
| 37 | + <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> |
| 38 | + </target> |
| 39 | + |
| 40 | + <!-- where to look for the ivy config --> |
| 41 | + <property name="ivy.dep.file" value="${basedir}/ivy/ivy.xml" /> |
| 42 | + <property name="ivy.settings.file" value="${basedir}/ivy/ivysettings.xml" /> |
| 43 | + |
| 44 | + <target name="findbugs" depends="install-ivy" description="Run Findbugs on JRuby source"> |
| 45 | + |
| 46 | + <!-- |
| 47 | + TODO move this out into a target that can be dependended on, and introduce code coverage, |
| 48 | + cyclomatic complexity and any other metrics that you want to include. |
| 49 | + --> |
| 50 | + <ivy:resolve conf="check" /> |
| 51 | + <ivy:cachepath pathid="check.path" conf="check" /> |
| 52 | + |
| 53 | + <taskdef name="findbugs" classpathref="check.path" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/> |
| 54 | + |
| 55 | + <findbugs classpathref="check.path" pluginList="" output="html" outputfile="${basedir}/jruby-findbugs.html" |
| 56 | + excludefilter="${basedir}/findbugs.xml"> |
| 57 | + <sourcepath path="${basedir}/source" /> |
| 58 | + <class location="${jruby.classes.dir}" /> |
| 59 | + <auxclasspath> |
| 60 | + <path refid="build.classpath" /> |
| 61 | + </auxclasspath> |
| 62 | + </findbugs> |
| 63 | + </target> |
| 64 | + |
| 65 | +</project> |
0 commit comments