Skip to content

Apache Lucene open-source search software

LUCENE-5193: add jar-src to build.xml

Shai Erera99fdfb3d6381
diff --git a/build.xml b/build.xml
index 1696c0f6f8d..a660e87c051 100644
--- a/build.xml
+++ b/build.xml
@@ -125,6 +125,13 @@
</subant>
</target>
+ <target name="jar-src" description="Build Lucene and Solr Source Jar files">
+ <subant target="jar-src" inheritall="false" failonerror="true">
+ <fileset dir="lucene" includes="build.xml"/>
+ <fileset dir="solr" includes="build.xml"/>
+ </subant>
+ </target>
+
<property name="version" value="5.0-SNAPSHOT"/>
<property name="maven-build-dir" value="maven-build"/>
<property name="maven-version" value="2.2.1"/>
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 84f0e053bbf..e849b966d7c 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -284,6 +284,9 @@ Build
* SOLR-5159: Manifest includes non-parsed maven variables.
(Artem Karpenko via Steve Rowe)
+* LUCENE-5193: Add jar-src as top-level target to generate all Lucene and Solr
+ *-src.jar. (Steve Rowe, Shai Erera)
+
======================= Lucene 4.4.0 =======================
Changes in backwards compatibility policy
diff --git a/lucene/analysis/build.xml b/lucene/analysis/build.xml
index cd3ed55a914..87a9ab7bcd5 100644
--- a/lucene/analysis/build.xml
+++ b/lucene/analysis/build.xml
@@ -107,6 +107,9 @@
<target name="jar">
<forall-analyzers target="jar-core"/>
</target>
+ <target name="jar-src">
+ <forall-analyzers target="jar-src"/>
+ </target>
<target name="jar-core" depends="jar"/>
<target name="build-artifacts-and-tests" depends="default,compile-test" />
diff --git a/lucene/build.xml b/lucene/build.xml
index 5c419a4f079..2034c6343c3 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -597,6 +597,12 @@
<modules-crawl target="jar-core"/>
</target>
+ <target name="jar-src" description="create source jars for all modules">
+ <ant dir="${common.dir}/core" target="jar-src" inheritAll="false" />
+ <ant dir="${common.dir}/test-framework" target="jar-src" inheritAll="false" />
+ <modules-crawl target="jar-src"/>
+ </target>
+
<target name="get-jenkins-line-docs" unless="enwiki.exists">
<sequential>
<!-- TODO: can get .lzma instead (it's ~17% smaller) but there's no builtin ant support...? -->
diff --git a/solr/build.xml b/solr/build.xml
index 996fbc010a9..5be4bad1f6f 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -176,6 +176,14 @@
<target name="jar" depends="jar-core,jar-solrj,jar-solr-test-framework,jar-contrib"
description="Jar solr core, solrj, solr-test-framework, and all contribs"/>
+ <target name="jar-src"
+ description="Create source jars for solr core, solrj, solr-test-framework, and all contribs">
+ <ant dir="core" target="jar-src" inheritAll="false"/>
+ <ant dir="solrj" target="jar-src" inheritAll="false"/>
+ <ant dir="test-framework" target="jar-src" inheritAll="false"/>
+ <contrib-crawl target="jar-src"/>
+ </target>
+
<!-- Solr core targets -->
<target name="test-solr-core" description="Test solr core">
<ant dir="core" target="test" inheritAll="false">
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 3eaf3b3a705..1e427c5d15b 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -297,8 +297,13 @@
]]></script>
</target>
- <target name="jar-src" depends="init">
- <solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar"/>
+ <target name="jar-src">
+ <sequential>
+ <mkdir dir="${build.dir}"/>
+ <solr-jarify basedir="${src.dir}" destfile="${build.dir}/${final.name}-src.jar">
+ <fileset dir="${resources.dir}" erroronmissingdir="no"/>
+ </solr-jarify>
+ </sequential>
</target>
<target name="m2-deploy-solr-parent-pom" depends="filter-pom-templates"