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.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1531750 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2013-10-13 21:04:31 +00:00
parent 13ed98be82
commit 7dc46c9f2d
7 changed files with 69 additions and 9 deletions

View File

@ -188,7 +188,8 @@ Build
* LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary * LUCENE-5273: Binary artifacts in Lucene and Solr convenience binary
distributions accompanying a release, including on Maven Central, 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 Tests

View File

@ -465,8 +465,14 @@
</target> </target>
<target name="create-package" <target name="create-package"
description="Packages the Solr Binary Distribution" description="Packages the Solr Binary Distribution">
depends="init-dist, dist, example, documentation"> <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}"/> <mkdir dir="${dest}/${fullnamever}"/>
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${example}/solr-webapp" includes="**/*"/> <fileset dir="${example}/solr-webapp" includes="**/*"/>

View File

@ -160,8 +160,24 @@
<property name="solr.deps.compiled" value="true"/> <property name="solr.deps.compiled" value="true"/>
</target> </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> <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=","> <pathconvert property="relative.solr.lucene.libs" pathsep=",">
<path refid="solr.lucene.libs"/> <path refid="solr.lucene.libs"/>
<fileset file="${lucene-core.jar}"/> <fileset file="${lucene-core.jar}"/>

View File

@ -49,7 +49,23 @@
code in the analysis-extras contrib, they must remain here in order to code in the analysis-extras contrib, they must remain here in order to
populate the Solr distribution 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=","> <pathconvert property="relative.analysis.extras.lucene.libs" pathsep=",">
<path refid="analysis.extras.lucene.libs"/> <path refid="analysis.extras.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/> <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>

View File

@ -35,7 +35,18 @@
<path refid="solr.base.classpath"/> <path refid="solr.base.classpath"/>
</path> </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=","> <pathconvert property="relative.uima.lucene.libs" pathsep=",">
<path refid="uima.lucene.libs"/> <path refid="uima.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/> <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>

View File

@ -70,8 +70,18 @@
<solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/> <solr-jarify basedir="${javadoc.dir}/${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential> </sequential>
</target> </target>
<target name="module-jars-to-solr"
<target name="module-jars-to-solr" depends="-unpack-lucene-tgz"> 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=","> <pathconvert property="relative.solr.test.framework.lucene.libs" pathsep=",">
<path refid="solr.test.framework.lucene.libs"/> <path refid="solr.test.framework.lucene.libs"/>
<globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/> <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>

View File

@ -42,7 +42,7 @@
<target name="dist" <target name="dist"
description="Creates the Solr WAR Distribution file." 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" <build-manifest title="Apache Solr Search Server"
implementation.title="org.apache.solr" implementation.title="org.apache.solr"
spec.version="${spec.version}"/> spec.version="${spec.version}"/>