Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-1818 Add deps-test-compile task for building plugins

Julien Niochef062d2b540b6
diff --git a/CHANGES.txt b/CHANGES.txt
index 5b3373175..1a9b5fc28 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,8 @@ Nutch Change Log
Nutch Current Development
+* NUTCH-1818 Add deps-test-compile task for building plugins (jnioche)
+
* NUTCH-1817 Remove pom.xml from source (jnioche)
* NUTCH-926 Redirections from META tag don't get filtered (snagel)
diff --git a/src/plugin/build-plugin.xml b/src/plugin/build-plugin.xml
index 1656b5d56..542b5a88c 100755
--- a/src/plugin/build-plugin.xml
+++ b/src/plugin/build-plugin.xml
@@ -110,6 +110,12 @@
!-->
<target name="deps-test"/>
+ <!--
+ ! Used to compile test for plugin runtime dependencies
+ ! (to be overridden by plugins)
+ !-->
+ <target name="deps-test-compile"/>
+
<!-- ====================================================== -->
<!-- Compile the Java files -->
<!-- ====================================================== -->
@@ -177,7 +183,7 @@
<!-- ================================================================== -->
<!-- Compile test code -->
<!-- ================================================================== -->
- <target name="compile-test" depends="compile" if="test.available">
+ <target name="compile-test" depends="compile, deps-test-compile" if="test.available">
<javac
encoding="${build.encoding}"
srcdir="${src.test}"
diff --git a/src/plugin/urlfilter-automaton/build.xml b/src/plugin/urlfilter-automaton/build.xml
index 7de9e0b4d..78557fc76 100644
--- a/src/plugin/urlfilter-automaton/build.xml
+++ b/src/plugin/urlfilter-automaton/build.xml
@@ -32,6 +32,11 @@
<pathelement location="${nutch.root}/build/lib-regex-filter/test"/>
</path>
+ <!-- Compile test classes for dependencies -->
+ <target name="deps-test-compile">
+ <ant target="compile-test" inheritall="false" dir="../lib-regex-filter"/>
+ </target>
+
<!-- Deploy Unit test dependencies -->
<target name="deps-test">
<ant target="deploy" inheritall="false" dir="../lib-regex-filter"/>
diff --git a/src/plugin/urlfilter-regex/build.xml b/src/plugin/urlfilter-regex/build.xml
index c622d068f..5b80d0835 100644
--- a/src/plugin/urlfilter-regex/build.xml
+++ b/src/plugin/urlfilter-regex/build.xml
@@ -32,6 +32,11 @@
<pathelement location="${nutch.root}/build/lib-regex-filter/test"/>
</path>
+ <!-- Compile test classes for dependencies -->
+ <target name="deps-test-compile">
+ <ant target="compile-test" inheritall="false" dir="../lib-regex-filter"/>
+ </target>
+
<!-- Deploy Unit test dependencies -->
<target name="deps-test">
<ant target="deploy" inheritall="false" dir="../lib-regex-filter"/>