Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6de003e940
Fetching contributors…

Cannot retrieve contributors at this time

file 126 lines (108 sloc) 3.8 kb
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
<project name="jcollectd" default="test" basedir=".">
  <description>Java collectd</description>
  <property name="src.main" location="src/main/java" />
  <property name="src.test" location="src/test/java" />
  <property name="target" location="target" />
  <property name="version" value="0.2.0-dev"/>
  <property name="dist.name" value="jcollectd-${version}"/>
  <property name="dist" value="${target}/${dist.name}"/>

  <property name="debug" value="true" />
  <available property="junit" classname="junit.framework.Test"/>

  <path id="alljars">
     <fileset dir="${target}" includes="lib/collectd.jar"/>
  </path>

  <target name="init">
    <mkdir dir="${target}/classes"/>
    <mkdir dir="${target}/lib"/>
  </target>

  <target name="compile-tests" depends="init,compile" if="junit">
    <javac destdir="${target}/classes"
           debug="${debug}"
           source="1.5" target="1.5"
           classpath="${target}/classes">
      <src path="${src.test}"/>
    </javac>
  </target>

  <target name="compile" depends="init">
    <javac destdir="${target}/classes"
           debug="${debug}"
           source="1.5" target="1.5">
      <src path="${src.main}"/>
    </javac>
  </target>

  <target name="jar" depends="compile">
    <jar jarfile="${target}/lib/collectd.jar">
      <fileset dir="${target}/classes"
              excludes="**/*Test.class" />
      <fileset dir="src/main/resources"/>
      <fileset dir="." includes="etc/*.xml"/>
      <manifest>
        <attribute name="Main-Class"
                   value="org.collectd.mx.MBeanReceiver"/>
        <attribute name="Premain-Class"
                   value="org.collectd.mx.RemoteMBeanSender"/>
      </manifest>
    </jar>
  </target>

  <target name="test" depends="compile-tests,jar" if="junit">
    <property name="testresults"
              location="${target}/testresults"/>

    <mkdir dir="${testresults}"/>

    <junit printsummary="yes" fork="yes"
           haltonfailure="yes" showoutput="true">

      <classpath>
        <path refid="alljars"/>
        <path location="${target}/classes"/>
      </classpath>

      <formatter type="xml"/>

      <batchtest fork="yes" todir="${testresults}">
        <fileset dir="${src.test}">
          <include name="**/*Test.java"/>
        </fileset>
      </batchtest>
    </junit>
  </target>

  <target name="clean">
    <delete dir="${target}" />
  </target>

  <target name="javadoc">
    <mkdir dir="${target}/javadoc"/>
    <javadoc packagenames="org.collectd.*"
             useexternalfile="yes"
             sourcepath="src/main/java"
             destdir="${target}/javadoc"
             author="false"
             version="false"
             windowtitle="Java collectd API"
             doctitle="Jcollectd">
      <group title="Jcollectd" packages="org.collectd" />
     <bottom>Copyright &#169; 2009 <![CDATA[<a target="_top" href="http://www.hyperic.com/">Hyperic, Inc.</a>]]>. All Rights Reserved.</bottom>
    </javadoc>
  </target>

  <target name="dist" depends="jar,javadoc">
    <mkdir dir="${dist}"/>

    <copy toDir="${dist}" filtering="on">
      <fileset dir=".">
        <include name="build.xml"/>
        <include name="LICENSE"/>
        <include name="README*"/>
        <include name="etc/*.xml"/>
        <include name="src/**/*.*"/>
      </fileset>
      <fileset dir="${target}">
        <include name="javadoc/**"/>
        <include name="lib/**"/>
      </fileset>
    </copy>

   <tar destfile="${target}/${dist.name}.tar.gz"
        basedir="${target}"
        includes="${dist.name}/**"
        longfile="gnu"
        compression="gzip"/>
  </target>

  <target name="markdown">
    <exec executable="markdown" dir="." output="${target}/README.html">
      <arg value="README.markdown"/>
    </exec>
  </target>
</project>
Something went wrong with that request. Please try again.