summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2015-07-17 13:27:26 (GMT)
committerNick Hudson <nick.hudson@isode.com>2015-07-20 16:22:40 (GMT)
commit43b51821ff8d03aa55209c66ea3e26080cf3cb8c (patch)
tree8830eaa8f9f56531506ae126711f4397446def82 /build.xml
parentb429b47cf98881d9335ca41c93afc5f7fe4f7705 (diff)
downloadstroke-43b51821ff8d03aa55209c66ea3e26080cf3cb8c.zip
stroke-43b51821ff8d03aa55209c66ea3e26080cf3cb8c.tar.bz2
Get make and make test to rebuild all dependent classes
When 'make' and 'make test' (or 'ant' and 'ant test') were run only the .java files that were directly modifed were compiled. This could cause problems if you changed a method signature (such as changing Request.send()'s return type from void to String). Classes that called that method would not be updated, and have out of date refences to the old method signature, leading to NoSuchMethodError. This patch modifies the build.xml to add depend tasks to the compile and compile-test targets. These run before the javac task is run and delete all classes files who's corresponding java file has been modified or are a class that depends on one of these modified classes. As the class files have now been deleted javac will then compile them giving us the result we want. In the compile-test case all classes are deleted if stroke.jar has been modified. FogBugz: Bug: Release-notes: Manual: Test-information: After applying patch I modified Request.send()'s return type to String and then ran 'make' and 'make test'. All the classes that depend on request were rebuilt and all the tests passed correctly (previously we would get tests failing due to NoSuchMethodError). I then change Request.send() back and ran 'make test' only, in this case it automatically rebuild all the java classes affected by the change and then ran the tests which all passed. Change-Id: I330e7a48b1fc8065091b42068adc6e6624eb2e00 Reviewer:
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/build.xml b/build.xml
index c56aaa8..18f72cc 100644
--- a/build.xml
+++ b/build.xml
@@ -49,6 +49,10 @@
<target name="-compile-with-examples" depends="init"
description="compile the source, including examples "
unless="noexamples">
+ <depend
+ srcdir="${src}"
+ destdir="${build}"
+ closure="yes"/>
<javac srcdir="${src}" destdir="${build}" classpathref="classpath"
debug="${compile.debug}"
source="1.6"
@@ -60,6 +64,10 @@
<target name="-compile-without-examples" depends="init"
description="compile the source, excluding examples "
if="noexamples">
+ <depend
+ srcdir="${src}"
+ destdir="${build}"
+ closure="yes"/>
<javac srcdir="${src}" destdir="${build}" classpathref="classpath"
debug="${compile.debug}"
source="1.6"
@@ -96,6 +104,11 @@
<target name="compile-tests" depends="dist"
description="compile the test sources " >
+ <depend
+ srcdir="${src.tests}"
+ classpath="${jar}"
+ destdir="${src.tests}"
+ closure="yes"/>
<javac srcdir="${src.tests}" destdir="${src.tests}"
debug="${compile.debug}"
source="1.6"