forked from collectd/jcollectd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
146 lines (125 loc) · 4.54 KB
/
build.xml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<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="1.0.0"/>
<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,git.revision" >
<jar jarfile="${target}/lib/jcollectd-em-${repository.version}.jar">
<!-- do not include the examples in the jar -->
<fileset dir="${target}/classes"
excludes="**/*Test.class;*.xml" />
<fileset dir="src/main/resources"/>
<!-- do not include the examples in the jar -->
<!-- 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 © 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>
<available file=".git" type="dir" property="git.present"/>
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
</project>