LUCENE-2973: Use 'svn export' for Solr's package-src and Lucene's dist-src targets; stop producing .zip versions of Lucene/Solr source packages.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1083213 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2011-03-19 16:34:19 +00:00
parent 576084d69a
commit d2a6250ef9
2 changed files with 80 additions and 123 deletions

View File

@ -45,10 +45,6 @@
<pathelement path="${java.class.path}"/> <pathelement path="${java.class.path}"/>
</path> </path>
<patternset id="src.dist.patterns"
includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/,backwards/"
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/"
/>
<patternset id="binary.build.dist.patterns" <patternset id="binary.build.dist.patterns"
includes="${final.name}*.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar" includes="${final.name}*.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
/> />
@ -339,57 +335,60 @@
<mkdir dir="${dist.dir}"/> <mkdir dir="${dist.dir}"/>
<mkdir dir="${maven.dist.dir}"/> <mkdir dir="${maven.dist.dir}"/>
</target> </target>
<!-- ================================================================== -->
<!-- Packages the sources with zip -->
<!-- ================================================================== --> <property name="svn.export.dir" location="${build.dir}/svn-export"/>
<!-- -->
<!-- ================================================================== -->
<target name="package-zip-src" depends="init, init-dist"
description="--> Generates the Lucene sources as .zip">
<zip destfile="${dist.dir}/lucene-${version}-src.zip">
<zipfileset prefix="lucene-${version}" dir=".">
<patternset refid="src.dist.patterns"/>
</zipfileset>
</zip>
<lucene-checksum file="${dist.dir}/lucene-${version}-src.zip"/>
</target>
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- Packages the sources with tar-gzip --> <!-- Packages the sources from "svn export" with tar-gzip -->
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- --> <target name="package-tgz-src" depends="init, init-dist, svn-export-source"
<!-- ================================================================== -->
<target name="package-tgz-src" depends="init, init-dist"
description="--> Generates the Lucene distribution as .tar.gz"> description="--> Generates the Lucene distribution as .tar.gz">
<property name="source.package.file"
<delete file="${build.dir}/lucene-${version}-src.tar"/> value="${dist.dir}/lucene-${version}-src.tar.gz"/>
<delete file="${dist.dir}/lucene-${version}-src.tar.gz"/> <delete file="${source.package.file}"/>
<tar tarfile="${build.dir}/lucene-${version}-src.tar" longfile="gnu"> <tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset prefix="lucene-${version}" dir="."> <tarfileset prefix="lucene-${version}" dir="${svn.export.dir}"/>
<patternset refid="src.dist.patterns"/>
</tarfileset>
</tar> </tar>
<lucene-checksum file="${source.package.file}"/>
<gzip zipfile="${dist.dir}/lucene-${version}-src.tar.gz"
src="${build.dir}/lucene-${version}-src.tar"
/>
<lucene-checksum file="${dist.dir}/lucene-${version}-src.tar.gz"/>
</target> </target>
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- Packages the sources with zip and tar-gzip --> <!-- Runs "svn export" in build/svn-export/ with the same URL -->
<!-- and revision as the current working copy. -->
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- --> <target name="svn-export-source" depends="get-svn-info">
<!-- ================================================================== --> <delete dir="${svn.export.dir}" includeemptydirs="true" failonerror="false"/>
<target name="package-all-src" depends="package-zip-src, package-tgz-src" <mkdir dir="${build.dir}"/>
description="--> Generates the .tar.gz and .zip source distributions"/> <exec dir="." executable="svn" failonerror="true">
<arg line="export -r ${svn.Revision} ${svn.URL} ${svn.export.dir}"/>
</exec>
</target>
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- same as package-all-src. it is just here for compatibility. --> <!-- Populates properties svn.URL and svn.Revision using "svn info". -->
<!-- ================================================================== --> <!-- ================================================================== -->
<!-- --> <target name="get-svn-info">
<exec dir="." executable="svn" outputproperty="svn.info" failonerror="true">
<arg value="info"/>
</exec>
<loadproperties>
<propertyresource name="svn.info"/>
<filterchain>
<linecontainsregexp>
<regexp pattern="(URL|Revision):"/>
</linecontainsregexp>
<replacestring from=": " to="="/>
<prefixlines prefix="svn."/>
</filterchain>
</loadproperties>
</target>
<!-- ================================================================== --> <!-- ================================================================== -->
<target name="dist-src" depends="package-all-src"/> <!-- same as package-tgz-src. it is just here for compatibility. -->
<!-- ================================================================== -->
<target name="dist-src" depends="package-tgz-src"/>
<target name="dist-all" depends="dist, dist-src"/> <target name="dist-all" depends="dist, dist-src"/>

View File

@ -739,91 +739,50 @@
<!-- make a distribution --> <!-- make a distribution -->
<target name="package" depends="package-src,create-package"/> <target name="package" depends="package-src,create-package"/>
<!-- copied from lucene build.xml --> <property name="svn.export.dir" location="${dest}/svn-export"/>
<patternset id="src.dist.patterns"
includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/,backwards/"
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/"
/>
<target name="package-src" <!-- Makes a tarball from running "svn export" at the root level. -->
description="Packages the Solr Source Distribution" <!-- Copies NOTICE.txt and LICENSE.txt from solr/ to the root level. -->
depends="dist"> <target name="package-src" depends="svn-export-source"
description="Packages the Solr Source Distribution">
<mkdir dir="${package.dir}"/> <mkdir dir="${package.dir}"/>
<property name="source.package.file"
<delete includeemptydirs="true"> value="${package.dir}/${fullnamever}-src.tgz"/>
<fileset dir="${example}/work" includes="**/*"/> <delete file="${source.package.file}" failonerror="false" />
</delete> <tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset dir="${svn.export.dir}" prefix="${fullnamever}"/>
<delete includeemptydirs="true" failonerror="false"> <tarfileset dir="${svn.export.dir}/solr" prefix="${fullnamever}"
<fileset dir="${dest}/${fullnamever}" includes="**/*"/> includes="NOTICE.txt,LICENSE.txt"/>
</delete>
<delete file="${package.dir}/${fullnamever}-src.tgz" failonerror="false" />
<delete file="${package.dir}/${fullnamever}-src.zip" failonerror="false" />
<tar destfile="${package.dir}/${fullnamever}-src.tgz" compression="gzip" longfile="gnu">
<tarfileset dir=".."
prefix="${fullnamever}"
includes="*.txt *.xml dev-tools/" />
<tarfileset dir="."
prefix="${fullnamever}"
includes="LICENSE.txt NOTICE.txt"/>
<tarfileset dir="."
prefix="${fullnamever}/solr"
includes="LICENSE.txt NOTICE.txt *.txt *.xml lib/** src/** example/** client/** contrib/ site/"
excludes="${package.dir}/** ${dist}/** **/lucene-libs/** example/webapps/*.war example/exampledocs/post.jar lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/python client/javascript contrib/**/build/ **/*.iml **/*.ipr **/*.iws" />
<tarfileset dir="."
prefix="${fullnamever}/solr"
includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
<tarfileset dir="."
mode="755"
prefix="${fullnamever}/solr"
includes="**/*.sh **/bin/ src/scripts/" />
<tarfileset dir="../lucene" prefix="${fullnamever}/lucene">
<patternset refid="src.dist.patterns"/>
</tarfileset>
<tarfileset dir="../modules"
prefix="${fullnamever}/modules"
excludes="**/build/" />
</tar> </tar>
<solr-checksum file="${package.dir}/${fullnamever}-src.tgz"/> <solr-checksum file="${source.package.file}"/>
<gunzip src="${package.dir}/${fullnamever}-src.tgz" dest="${dest}/${fullnamever}-src.tar"/>
<untar src="${dest}/${fullnamever}-src.tar" dest="${dest}"/>
<!--
This is a list of text file patterns to convert to CRLF line-ending style.
Shell scripts and files included in shell scripts should not be converted.
NB: The line-ending conversion process will mangle non-UTF8-encoded files.
-->
<fixcrlf srcdir="${dest}/${fullnamever}"
encoding="UTF-8"
eol="crlf"
includes="**/*.alg **/*.cgi **/*.cpp **/*.css **/*.csv **/*.dtd **/*.erb
**/*.fcgi **/.htaccess **/*.htm **/*.html **/*.incl **/*.java
**/*.javacc **/*.jflex **/*.jflex-macro **/*.jj **/*.js
**/*.json **/*.jsp **/*LICENSE **/*.pl **/*.pom
**/*pom.xml.template **/*.properties **/*.py **/*.rake
**/Rakefile **/*.rb **/*.rbbi **/README **/README.* **/*.rhtml
**/*.rslp **/*.rxml **/*.script **/*.svg **/*.tsv **/*.txt
**/UPGRADING **/USAGE **/*.uxf **/*.vm **/*.xcat **/*.xml
**/*.xsl **/*.xslt **/*.yml"
excludes="**/stopwordsWrongEncoding.txt **/gb18030-example.xml"
/>
<zip destfile="${package.dir}/${fullnamever}-src.zip">
<zipfileset dir="${dest}/${fullnamever}"
prefix="${fullnamever}"
excludes="**/*.sh **/bin/ src/scripts/" />
<zipfileset dir="${dest}/${fullnamever}"
prefix="${fullnamever}"
includes="**/*.sh **/bin/ src/scripts/"
filemode="755" />
</zip>
<solr-checksum file="${package.dir}/${fullnamever}-src.zip"/>
</target> </target>
<!-- Runs "svn export" in build/svn-export/ with the same root-level URL -->
<!-- and revision as the current working copy. -->
<target name="svn-export-source" depends="get-svn-info">
<delete dir="${svn.export.dir}" includeemptydirs="true" failonerror="false"/>
<mkdir dir="${dest}"/>
<exec dir="." executable="svn" failonerror="true">
<arg line="checkout -r ${svn.Revision} ${svn.URL} ${svn.export.dir}"/>
</exec>
</target>
<!-- Populates properties svn.URL and svn.Revision using "svn info" -->
<target name="get-svn-info">
<exec dir=".." executable="svn" outputproperty="svn.info" failonerror="true">
<arg value="info"/>
</exec>
<loadproperties>
<propertyresource name="svn.info"/>
<filterchain>
<linecontainsregexp>
<regexp pattern="(URL|Revision):"/>
</linecontainsregexp>
<replacestring from=": " to="="/>
<prefixlines prefix="svn."/>
</filterchain>
</loadproperties>
</target>
<target name="create-package" <target name="create-package"
description="Packages the Solr Binary Distribution" description="Packages the Solr Binary Distribution"
@ -917,7 +876,6 @@
<sign-artifact input.file="${package.dir}/${fullnamever}.tgz" output.file="${package.dir}/${fullnamever}.tgz.asc" gpg.passphrase="${gpg.passphrase}"/> <sign-artifact input.file="${package.dir}/${fullnamever}.tgz" output.file="${package.dir}/${fullnamever}.tgz.asc" gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact input.file="${package.dir}/${fullnamever}.zip" output.file="${package.dir}/${fullnamever}.zip.asc" gpg.passphrase="${gpg.passphrase}"/> <sign-artifact input.file="${package.dir}/${fullnamever}.zip" output.file="${package.dir}/${fullnamever}.zip.asc" gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact input.file="${package.dir}/${fullnamever}-src.tgz" output.file="${package.dir}/${fullnamever}-src.tgz.asc" gpg.passphrase="${gpg.passphrase}"/> <sign-artifact input.file="${package.dir}/${fullnamever}-src.tgz" output.file="${package.dir}/${fullnamever}-src.tgz.asc" gpg.passphrase="${gpg.passphrase}"/>
<sign-artifact input.file="${package.dir}/${fullnamever}-src.zip" output.file="${package.dir}/${fullnamever}-src.zip.asc" gpg.passphrase="${gpg.passphrase}"/>
<!-- Maven artifacts --> <!-- Maven artifacts -->
<sign-maven-dependency-artifacts artifact.id="solr-commons-csv" gpg.passphrase="${gpg.passphrase}"/> <sign-maven-dependency-artifacts artifact.id="solr-commons-csv" gpg.passphrase="${gpg.passphrase}"/>