summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Hudson <nick.hudson@isode.com>2013-10-18 15:07:53 (GMT)
committerNick Hudson <nick.hudson@isode.com>2013-10-30 14:30:24 (GMT)
commit14a773c38050d4af9c34c24e426b7a5460ad9735 (patch)
tree5af61e194487903f9266c88dcfe83eb5d31e3231 /build.xml
parentb2f5e0d7c7409ef78ff83708e9ba068f6f0ad535 (diff)
downloadstroke-14a773c38050d4af9c34c24e426b7a5460ad9735.zip
stroke-14a773c38050d4af9c34c24e426b7a5460ad9735.tar.bz2
Re-implement DNS lookup to use dnsjava rather than JNDI
There are limitations when using JNDI for DNS lookups, including that it does not properly handle the situation when resolv.conf contains IPv6 addresses (Isode bug #44832) - see e.g. http://java.net/jira/browse/JITSI-295 JNDI is also not readily available on Android, which makes it slightly more awkward to use Stroke on that platform. This patch changes the PlatformDomainName classes so that they use classes from dnsjava rather than JNDI. The patch also updates the build scripts so that dnsjava.jar is fetched (if necessary) and included in the build. Indentation in build.xml has been tidied up Test-information: Ran unit tests - ok Ran MLC - works OK and no longer throws NumberFormatExceptions when resolve.conf contains "nameserver 2001:470:f052::2" Change-Id: Iacf1105c52c281f9e59b60ea6caa011914b588dc
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml79
1 files changed, 40 insertions, 39 deletions
diff --git a/build.xml b/build.xml
index 7fe424c..6c4058f 100644
--- a/build.xml
+++ b/build.xml
@@ -1,5 +1,5 @@
<!--
- * Copyright (c) 2010, Isode Limited, London, England.
+ * Copyright (c) 2010-2013, Isode Limited, London, England.
* All rights reserved.
-->
<project name="Stroke" default="dist" basedir=".">
@@ -20,16 +20,17 @@
<property name="stax2-dir" value="../third-party/stax2"/>
<property name="jzlib-dir" value="../third-party/jzlib"/>
<property name="icu4j-dir" value="../third-party/icu4j"/>
+ <property name="dnsjava-dir" value="../third-party/dnsjava"/>
<property name="cobertura.dir" value="instrumented"/>
<property name="coveragereport.dir" value="coverage"/>
<path id="cobertura.classpath">
- <pathelement path="${cobertura-jar}"/>
- <pathelement path="${jakarta-oro-jar}"/>
- <pathelement path="${log4j-jar}"/>
- <pathelement path="${asm-jar}"/>
- <pathelement path="${asm-tree-jar}"/>
+ <pathelement path="${cobertura-jar}"/>
+ <pathelement path="${jakarta-oro-jar}"/>
+ <pathelement path="${log4j-jar}"/>
+ <pathelement path="${asm-jar}"/>
+ <pathelement path="${asm-tree-jar}"/>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
@@ -38,6 +39,7 @@
<fileset dir="${stax2-dir}" includes="stax2-api.jar"/>
<fileset dir="${jzlib-dir}" includes="jzlib.jar"/>
<fileset dir="${icu4j-dir}" includes="icu4j.jar"/>
+ <fileset dir="${dnsjava-dir}" includes="dnsjava.jar"/>
</path>
<target name="init">
<tstamp/>
@@ -92,7 +94,7 @@
</target>
-<target name="compile-tests" depends="dist"
+ <target name="compile-tests" depends="dist"
description="compile the test sources " >
<javac srcdir="${src.tests}" destdir="${src.tests}"
debug="${compile.debug}"
@@ -120,37 +122,36 @@
<delete dir="${test.results}"/>
<mkdir dir="${test.results}"/>
<junit fork="yes">
- <formatter type="xml"/>
- <classpath>
- <pathelement location="${cobertura.dir}"/>
- <path refid="cobertura.classpath"/>
- </classpath>
- <classpath>
- <pathelement location="${JUNIT_JAR}"/>
- <pathelement location="${jar}"/>
- <pathelement location="${src.tests}"/>
- <path refid="classpath"/>
- </classpath>
- <batchtest todir="${test.results}">
- <fileset dir="${src.tests}">
- <include name="**/*Test.java"/>
- <!--<exclude name="**/AllTests.java"/>-->
- </fileset>
- </batchtest>
+ <formatter type="xml"/>
+ <classpath>
+ <pathelement location="${cobertura.dir}"/>
+ <path refid="cobertura.classpath"/>
+ </classpath>
+ <classpath>
+ <pathelement location="${JUNIT_JAR}"/>
+ <pathelement location="${jar}"/>
+ <pathelement location="${src.tests}"/>
+ <path refid="classpath"/>
+ </classpath>
+ <batchtest todir="${test.results}">
+ <fileset dir="${src.tests}">
+ <include name="**/*Test.java"/>
+ <!--<exclude name="**/AllTests.java"/>-->
+ </fileset>
+ </batchtest>
</junit>
-
</target>
<target name="coverage" if="cobertura-jar" depends="instrument, run-tests">
<delete dir="${coveragereport.dir}"/>
<mkdir dir="${coveragereport.dir}"/>
<cobertura-report format="xml" destdir="${coveragereport.dir}">
- <fileset dir="${src}">
- <include name="**/*.java"/>
- </fileset>
- <fileset dir="${src.tests}">
- <include name="**/*.java"/>
- </fileset>
+ <fileset dir="${src}">
+ <include name="**/*.java"/>
+ </fileset>
+ <fileset dir="${src.tests}">
+ <include name="**/*.java"/>
+ </fileset>
</cobertura-report>
</target>
@@ -190,7 +191,7 @@
</target>
<target name="clean"
- description="clean up" >
+ description="clean up" >
<delete dir="${build}"/>
<delete dir="${test.results}"/>
<delete dir="${dist}"/>
@@ -210,18 +211,18 @@
<!--<classpath>
<fileset dir="${xpp-dir}" includes="xpp.jar"/>
</classpath>-->
- <link href="http://docs.oracle.com/javase/6/docs/api/"/>
+ <link href="http://docs.oracle.com/javase/6/docs/api/"/>
</javadoc>
</target>
<target name="run" description="Run the demo" depends="dist">
- <java fork="true" classname="${main-class}">
- <classpath>
- <path refid="classpath"/>
- <path location="${jar}"/>
- </classpath>
- </java>
+ <java fork="true" classname="${main-class}">
+ <classpath>
+ <path refid="classpath"/>
+ <path location="${jar}"/>
+ </classpath>
+ </java>
</target>
</project>