Skip to content

Apache Lucene open-source search software

LUCENE-5273: Fix slowdown when running 'ant example': unless called from the 'create-package' target, the 'lucene-jars-to-solr' and 'module-jars-to-solr' targets no longer depend on '-unpack-lucene-tgz', pulling lucene-*.jar from lucene/build/*/ instead.

Steven Rowe7dc46c9f2d78
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 781505e645f..7d4b7461df0 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -188,7 +188,8 @@ Build
* LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary
distributions accompanying a release, including on Maven Central,
- should be identical across all distributions. (Steve Rowe, Uwe Schindler)
+ should be identical across all distributions. (Steve Rowe, Uwe Schindler,
+ Shalin Shekhar Mangar)
Tests
diff --git a/solr/build.xml b/solr/build.xml
index 61ba97c9677..85d49505fcf 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -465,8 +465,14 @@
</target>
<target name="create-package"
- description="Packages the Solr Binary Distribution"
- depends="init-dist, dist, example, documentation">
+ description="Packages the Solr Binary Distribution">
+ <antcall inheritall="true">
+ <param name="called.from.create-package" value="true"/>
+ <target name="init-dist"/>
+ <target name="dist"/>
+ <target name="example"/>
+ <target name="documentation"/>
+ </antcall>
<mkdir dir="${dest}/${fullnamever}"/>
<delete includeemptydirs="true">
<fileset dir="${example}/solr-webapp" includes="**/*"/>
diff --git a/solr/common-build.xml b/solr/common-build.xml
index a5087540995..26f84c7dee1 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -160,8 +160,24 @@
<property name="solr.deps.compiled" value="true"/>
</target>
- <target name="lucene-jars-to-solr" depends="-unpack-lucene-tgz">
+ <target name="lucene-jars-to-solr"
+ depends="-lucene-jars-to-solr-not-for-package,-lucene-jars-to-solr-package"/>
+
+ <target name="-lucene-jars-to-solr-not-for-package" unless="called.from.create-package">
+ <sequential>
+ <antcall target="prep-lucene-jars" inheritall="true"/>
+ <property name="solr.deps.compiled" value="true"/>
+ <copy todir="${lucene-libs}" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <path refid="solr.lucene.libs" />
+ <!-- NOTE: lucene-core is not already included in "solr.lucene.libs" because of its use in classpaths. -->
+ <fileset file="${lucene-core.jar}" />
+ </copy>
+ </sequential>
+ </target>
+
+ <target name="-lucene-jars-to-solr-package" if="called.from.create-package">
<sequential>
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
<pathconvert property="relative.solr.lucene.libs" pathsep=",">
<path refid="solr.lucene.libs"/>
<fileset file="${lucene-core.jar}"/>
diff --git a/solr/contrib/analysis-extras/build.xml b/solr/contrib/analysis-extras/build.xml
index 666abab9ead..1c6945aaf6f 100644
--- a/solr/contrib/analysis-extras/build.xml
+++ b/solr/contrib/analysis-extras/build.xml
@@ -49,7 +49,23 @@
code in the analysis-extras contrib, they must remain here in order to
populate the Solr distribution
-->
- <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
+ <target name="module-jars-to-solr"
+ depends="-module-jars-to-solr-not-for-package,-module-jars-to-solr-package"/>
+ <target name="-module-jars-to-solr-not-for-package" unless="called.from.create-package">
+ <antcall inheritall="true">
+ <target name="jar-analyzers-icu"/>
+ <target name="jar-analyzers-smartcn"/>
+ <target name="jar-analyzers-stempel"/>
+ <target name="jar-analyzers-morfologik"/>
+ </antcall>
+ <property name="analyzers-icu.uptodate" value="true"/> <!-- compile-time dependency -->
+ <mkdir dir="${build.dir}/lucene-libs"/>
+ <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <path refid="analysis.extras.lucene.libs" />
+ </copy>
+ </target>
+ <target name="-module-jars-to-solr-package" if="called.from.create-package">
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
<pathconvert property="relative.analysis.extras.lucene.libs" pathsep=",">
<path refid="analysis.extras.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
diff --git a/solr/contrib/uima/build.xml b/solr/contrib/uima/build.xml
index 22a06301c20..ee564221148 100644
--- a/solr/contrib/uima/build.xml
+++ b/solr/contrib/uima/build.xml
@@ -35,7 +35,18 @@
<path refid="solr.base.classpath"/>
</path>
- <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
+ <target name="module-jars-to-solr"
+ depends="-module-jars-to-solr-not-for-package,-module-jars-to-solr-package"/>
+ <target name="-module-jars-to-solr-not-for-package" unless="called.from.create-package">
+ <antcall target="jar-analyzers-uima" inheritall="true"/>
+ <property name="analyzers-uima.uptodate" value="true"/>
+ <mkdir dir="${build.dir}/lucene-libs"/>
+ <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <fileset file="${analyzers-uima.jar}"/>
+ </copy>
+ </target>
+ <target name="-module-jars-to-solr-package" if="called.from.create-package">
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
<pathconvert property="relative.uima.lucene.libs" pathsep=",">
<path refid="uima.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
diff --git a/solr/test-framework/build.xml b/solr/test-framework/build.xml
index b117d8b0242..02c613dbffb 100644
--- a/solr/test-framework/build.xml
+++ b/solr/test-framework/build.xml
@@ -70,8 +70,18 @@
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
-
- <target name="module-jars-to-solr" depends="-unpack-lucene-tgz">
+ <target name="module-jars-to-solr"
+ depends="-module-jars-to-solr-not-for-package,-module-jars-to-solr-package"/>
+ <target name="-module-jars-to-solr-not-for-package" unless="called.from.create-package">
+ <antcall target="jar-test-framework" inheritall="true"/>
+ <property name="test-framework.uptodate" value="true"/>
+ <mkdir dir="${build.dir}/lucene-libs"/>
+ <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+ <path refid="solr.test.framework.lucene.libs" />
+ </copy>
+ </target>
+ <target name="-module-jars-to-solr-package" if="called.from.create-package">
+ <antcall target="-unpack-lucene-tgz" inheritall="true"/>
<pathconvert property="relative.solr.test.framework.lucene.libs" pathsep=",">
<path refid="solr.test.framework.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
diff --git a/solr/webapp/build.xml b/solr/webapp/build.xml
index e98e036c817..6a519b7143b 100644
--- a/solr/webapp/build.xml
+++ b/solr/webapp/build.xml
@@ -42,7 +42,7 @@
<target name="dist"
description="Creates the Solr WAR Distribution file."
- depends="test, init-dist, dist-core, dist-solrj, -unpack-lucene-tgz, lucene-jars-to-solr">
+ depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr">
<build-manifest title="Apache Solr Search Server"
implementation.title="org.apache.solr"
spec.version="${spec.version}"/>