File: build.xml

package info (click to toggle)
dnsjava 2.1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,580 kB
  • sloc: java: 24,727; xml: 365; makefile: 34
file content (179 lines) | stat: -rw-r--r-- 6,488 bytes parent folder | download | duplicates (2)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<project name="dnsjava" default="all" basedir=".">
    <property name="build_dir" value="${basedir}"/>
    <property name="src_dir" value="${basedir}"/>
    <property name="doc_dir" value="${basedir}/doc"/>
    <property name="dist_dir" value="${basedir}"/>
    <property name="tests_dir" value="${basedir}/tests"/>
    <property name="reports_dir" value="${basedir}/reports"/>
    <property name="version" value="2.1.8"/>
    <property name="jarname" value="dnsjava-${version}.jar"/>
    <property name="zipname" value="dnsjava-${version}.zip"/>
    <property name="targzname" value="dnsjava-${version}.tar.gz"/>

    <property name="j2se.javadoc"
      value="http://download.oracle.com/javase/1.4.2/docs/api/"/>

    <target name="all" description="Compile and Jar" depends="jar">
    </target>

    <target name="compile" description="Compile everything">
	<javac destdir="${build_dir}" debug="true" target="1.4" source="1.4">
	    <src path="${src_dir}"/>
	    <exclude name="tests/**"/>
	</javac>
    </target>

    <target name="spi" description="Compile the Name Service Provider code">
	<javac destdir="${build_dir}" debug="true" target="1.4" source="1.4">
	    <src path="${src_dir}"/>
	    <include name="org/xbill/DNS/spi/*.java"/>
	</javac>
    </target>

    <target name="jar" description="Makes dnsjava.jar" depends="compile">
	<jar jarfile="${dist_dir}/${jarname}"
		basedir="${build_dir}" includes="**/*.class **/*.properties">
	    <exclude name="org/xbill/DNS/tests/*.class"/>
	    <exclude name="tests/**"/>
	    <manifest>
		<attribute name="Implementation-Title" value="dnsjava"/>
		<attribute name="Implementation-Version" value="${version}"/>
	    </manifest>
	    <metainf dir="org/xbill/DNS/spi/">
		<include name="services/*"/>
	    </metainf>
	</jar>
    </target>
	
	<target name="bundle" description="Creates an OSGi bundle" depends="jar">
		<get src="http://www.aqute.biz/repo/biz/aQute/bnd/0.0.384/bnd-0.0.384.jar"
			dest="${build_dir}/bnd.jar"/>
		<taskdef resource="aQute/bnd/ant/taskdef.properties"
			classpath="${build_dir}/bnd.jar"/> 
		<echo file="${dist_dir}/dnsjava-${version}.bnd" append="false">
			Bundle-Version: ${version}
			Bundle-Name: dnsjava is an implementation of DNS in Java
			Bundle-SymbolicName: org.xbill.dns
			Export-Package: org.xbill.DNS;version=${version},org.xbill.DNS.spi;version=${version},org.xbill.DNS.utils;version=${version},org.xbill.DNS.windows;version=${version}
			Bundle-Vendor: dnsjava.org
			Bundle-RequiredExecutionEnvironment: J2SE-1.4
			Import-Package: !org.xbill.DNS*,!sun.*,*
		</echo>
		<bndwrap
			definitions="${dist_dir}"
			jars="${dist_dir}/${jarname}"
			output="${dist_dir}/org.xbill.dns_${version}.jar"/>
		<delete file="${dist_dir}/dnsjava-${version}.bnd"/>
	</target>

    <target name="clean" description="Remove old class files">
	<delete>
	    <fileset dir="${build_dir}" includes="**/*.class"/>
	    <fileset dir="${build_dir}" includes="*.bnd *.jar *.zip *.tar.gz jcoverage.ser"/>
	</delete>
    </target>

    <target name="docs" description="Makes Javadoc documentation">
	<javadoc destdir="${doc_dir}"
		 sourcepath="${src_dir}"
		 packagenames="org.xbill.DNS,org.xbill.DNS.utils,org.xbill.DNS.spi"
		 windowtitle="dnsjava documentation">

	    <link href="${j2se.javadoc}"/>
	</javadoc>
    </target>

    <target name="docsclean" description="Remove old documentation">
	<delete dir="${doc_dir}"/>
    </target>

    <target name="reportsclean" description="Remove old reports">
	<delete dir="${reports_dir}"/>
    </target>

    <property name="source_excludes"
	      value="**/*.class,${jarname},${zipname},${targzname}" />

    <target name="sourcedist" description="Builds source distributions"
	    depends="compile,docs">
	<zip destfile="${dist_dir}/${zipname}">
	    <zipfileset dir="${src_dir}" prefix="dnsjava-${version}"
			excludes="${source_excludes}" />
	</zip>
	<tar destfile="${dist_dir}/${targzname}" compression="gzip">
	    <tarfileset dir="${src_dir}" prefix="dnsjava-${version}"
			excludes="${source_excludes}" />
	</tar>
    </target>

    <target name="compile_tests" depends="compile">
	<javac destdir="${tests_dir}" debug="true" target="1.4" source="1.4">
	    <src path="${tests_dir}"/>
	    <exclude name="org/xbill/DNS/DNSSECWithLunaProviderTest**"/>
	</javac>
    </target>

    <target name="run_tests">
      <path id="tests_classpath">
	<path location="${basedir}"/>
	<path location="${tests_dir}"/>
      </path>
      <antcall target="_run_tests">
	<param name="classpath_name" value="tests_classpath"/>
      </antcall>
    </target>

    <target name="_run_tests" depends="compile_tests">
      <junit fork="yes" forkmode="perTest" dir="${basedir}"
             haltonerror="on" haltonfailure="on">
	<classpath>
          <path location="${basedir}"/>
          <path location="${tests_dir}"/>
	</classpath>
	<formatter type="plain" usefile="no"/>
	<test name="${testcase}" if="testcase"/>
	<batchtest unless="testcase">
	  <fileset dir="${tests_dir}">
	  <include name="**/*Test.class"/>
	</fileset>
	</batchtest>
      </junit>
    </target>
    
    <target name="coverage_report" depends="clean,compile_tests" if="jcoverage_dir">
      <taskdef resource="tasks.properties">
	<classpath>
		<path location="${jcoverage_dir}/jcoverage.jar"/>
		<path location="${jcoverage_dir}/lib/log4j/1.2.8/*.jar"/>
		<path location="${jcoverage_dir}/log4j.jar"/>
		<path location="${jcoverage_dir}/bcel.jar"/>
		<path location="${jcoverage_dir}/oro.jar"/>
		<path location="${jcoverage_dir}/gnu.getopt.jar"/>
	</classpath>
      </taskdef>
      <instrument todir="${basedir}/iclasses">
	<fileset dir="${basedir}">
	  <include name="**/*.class"/>
	  <exclude name="iclasses/**"/>
	  <exclude name="tests/**"/>
	</fileset>
	<ignore regex="org.xbill.DNS.Tokenizer$*"/>
      </instrument>
      <path id="itests_classpath">
	<path location="${basedir}/iclasses"/>
	<path location="${tests_dir}"/>
	<path location="${jcoverage_dir}/jcoverage.jar"/>
	<path location="${jcoverage_dir}/lib/log4j/1.2.8/*.jar"/>
	<path location="${jcoverage_dir}/log4j.jar"/>
	<path location="${jcoverage_dir}/bcel.jar"/>
	<path location="${jcoverage_dir}/oro.jar"/>
	<path location="${jcoverage_dir}/gnu.getopt.jar"/>
      </path>
      <antcall target="_run_tests">
	<param name="classpath_name" value="itests_classpath"/>
      </antcall>
      <report srcdir="${basedir}" destdir="${reports_dir}/coverage"/>
      <delete dir="${basedir}/iclasses"/>
    </target>

</project>