packaging: further improvements to new src/bin packaging

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1078058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2011-03-04 17:07:12 +00:00
parent ebf368ca62
commit d4fed74993
1 changed files with 29 additions and 84 deletions

View File

@ -756,72 +756,7 @@
</target> </target>
<!-- make a distribution --> <!-- make a distribution -->
<target name="package" depends="create-package"/> <target name="package" depends="package-src,create-package"/>
<target name="create-package"
description="Packages the Solr Distribution files and Documentation."
depends="dist, example, javadoc, dist-src, dist-javadoc">
<copy failonerror="false" todir="${build.docs}">
<fileset dir="site" />
</copy>
<delete file="${dist}/${fullnamever}.tgz" failonerror="false" />
<delete file="${dist}/${fullnamever}.zip" failonerror="false" />
<tar destfile="${dist}/${fullnamever}.tgz" compression="gzip" longfile="gnu">
<tarfileset dir="."
prefix="${fullnamever}"
includes="LICENSE.txt NOTICE.txt *.txt *.xml lucene-libs/** lib/** src/** example/** client/** contrib/"
excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/example/lib/** contrib/clustering/lib/downloads/** contrib/analysis-extras/lib/** contrib/uima/lib/**" />
<tarfileset dir="."
prefix="${fullnamever}"
includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
<tarfileset dir="."
mode="755"
prefix="${fullnamever}"
includes="**/*.sh **/bin/ src/scripts/" />
<tarfileset dir="."
prefix="${fullnamever}"
includes="dist/**"
excludes="*.tgz *.zip *.md5 **/*src*.jar **/*docs*.jar" />
<tarfileset dir="${build.docs}"
prefix="${fullnamever}/docs/" />
<tarfileset dir="../lucene"
prefix="lucene"
excludes="**/build/" />
<tarfileset dir="../modules"
prefix="modules"
excludes="**/build/" />
</tar>
<solr-checksum file="${dist}/${fullnamever}.tgz"/>
<gunzip src="${dist}/${fullnamever}.tgz" dest="${dest}/${fullnamever}.tar"/>
<untar src="${dest}/${fullnamever}.tar" dest="${dest}"/>
<fixcrlf srcdir="${dest}/${fullnamever}"
eol="crlf"
includes="**/*.txt **/*.xml **/*.java **/*.html **/*.csv **/*.css **/*.properties **/*.jsp **/*.xsl **/*.py **/*.rb **/*.js **/*.json **/*.pl"
/>
<zip destfile="${dist}/${fullnamever}.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" />
<zipfileset dir="../lucene"
prefix="lucene"
excludes="**/build/" />
<zipfileset dir="../modules"
prefix="modules"
excludes="**/build/" />
</zip>
<solr-checksum file="${dist}/${fullnamever}.zip"/>
</target>
<!-- copied from lucene build.xml --> <!-- copied from lucene build.xml -->
<patternset id="src.dist.patterns" <patternset id="src.dist.patterns"
@ -829,12 +764,17 @@
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/" excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/"
/> />
<target name="package-src" <target name="package-src"
description="Packages the Solr Source Distribution" description="Packages the Solr Source Distribution"
depends="dist"> depends="dist">
<mkdir dir="${dest}" /> <delete includeemptydirs="true">
<fileset dir="${example}/work" includes="**/*"/>
</delete>
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${dest}/${fullnamever}" includes="**/*"/>
</delete>
<delete file="${dist}/${fullnamever}-src.tgz" failonerror="false" /> <delete file="${dist}/${fullnamever}-src.tgz" failonerror="false" />
<delete file="${dist}/${fullnamever}-src.zip" failonerror="false" /> <delete file="${dist}/${fullnamever}-src.zip" failonerror="false" />
@ -846,7 +786,7 @@
<tarfileset dir="." <tarfileset dir="."
prefix="${fullnamever}/solr" prefix="${fullnamever}/solr"
includes="LICENSE.txt NOTICE.txt *.txt *.xml lib/** src/** example/** client/** contrib/" includes="LICENSE.txt NOTICE.txt *.txt *.xml lib/** src/** example/** client/** contrib/"
excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/lib/downloads/**" /> excludes="${dist}/** 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="." <tarfileset dir="."
prefix="${fullnamever}/solr" prefix="${fullnamever}/solr"
includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" /> includes="src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
@ -885,10 +825,7 @@
</target> </target>
<target name="create-package"
<target name="package-bin"
description="Packages the Solr Binary Distribution" description="Packages the Solr Binary Distribution"
depends="dist, example"> depends="dist, example">
@ -896,14 +833,22 @@
<fileset dir="site" /> <fileset dir="site" />
</copy> </copy>
<delete file="${dist}/${fullnamever}-bin.tgz" failonerror="false" /> <delete includeemptydirs="true">
<delete file="${dist}/${fullnamever}-bin.zip" failonerror="false" /> <fileset dir="${example}/work" includes="**/*"/>
</delete>
<tar destfile="${dist}/${fullnamever}-bin.tgz" compression="gzip" longfile="gnu"> <delete includeemptydirs="true" failonerror="false">
<fileset dir="${dest}/${fullnamever}" includes="**/*"/>
</delete>
<delete file="${dist}/${fullnamever}.tgz" failonerror="false" />
<delete file="${dist}/${fullnamever}.zip" failonerror="false" />
<tar destfile="${dist}/${fullnamever}.tgz" compression="gzip" longfile="gnu">
<tarfileset dir="." <tarfileset dir="."
prefix="${fullnamever}" prefix="${fullnamever}"
includes="LICENSE.txt NOTICE.txt *.txt example/** client/** contrib/dataimporthandler/lib/ contrib/extraction/lib/ contrib/clustering/lib/" includes="LICENSE.txt NOTICE.txt *.txt example/** client/** contrib/**/lib/ **/README.txt **/CHANGES.txt"
excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python contrib/**/build/ **/*.iml **/*.ipr **/*.iws contrib/clustering/example/lib/** contrib/clustering/lib/downloads/** contrib/analysis-extras/lib/** contrib/uima/lib/**" /> excludes="${dist}/** lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/** src/site/build/** **/target/** client/ruby/flare/** client/python/** client/javascript/** contrib/**/build/** **/*.iml **/*.ipr **/*.iws" />
<tarfileset dir="." <tarfileset dir="."
mode="755" mode="755"
prefix="${fullnamever}" prefix="${fullnamever}"
@ -911,21 +856,21 @@
<tarfileset dir="." <tarfileset dir="."
prefix="${fullnamever}" prefix="${fullnamever}"
includes="dist/**" includes="dist/**"
excludes="*.tgz *.zip *.md5 **/*src*.jar **/*docs*.jar" /> excludes="**/*.tgz **/*.zip **/*.md5 **/*src*.jar **/*docs*.jar" />
<tarfileset dir="${build.docs}" <tarfileset dir="${build.docs}"
prefix="${fullnamever}/docs/" /> prefix="${fullnamever}/docs/" />
</tar> </tar>
<solr-checksum file="${dist}/${fullnamever}-bin.tgz"/> <solr-checksum file="${dist}/${fullnamever}.tgz"/>
<gunzip src="${dist}/${fullnamever}-bin.tgz" dest="${dest}/${fullnamever}-bin.tar"/> <gunzip src="${dist}/${fullnamever}.tgz" dest="${dest}/${fullnamever}.tar"/>
<untar src="${dest}/${fullnamever}-bin.tar" dest="${dest}"/> <untar src="${dest}/${fullnamever}.tar" dest="${dest}"/>
<fixcrlf srcdir="${dest}/${fullnamever}" <fixcrlf srcdir="${dest}/${fullnamever}"
eol="crlf" eol="crlf"
includes="**/*.txt **/*.xml **/*.java **/*.html **/*.csv **/*.css **/*.properties **/*.jsp **/*.xsl **/*.py **/*.rb **/*.js **/*.json **/*.pl" includes="**/*.txt **/*.xml **/*.java **/*.html **/*.csv **/*.css **/*.properties **/*.jsp **/*.xsl **/*.py **/*.rb **/*.js **/*.json **/*.pl"
/> />
<zip destfile="${dist}/${fullnamever}-bin.zip"> <zip destfile="${dist}/${fullnamever}.zip">
<zipfileset dir="${dest}/${fullnamever}" <zipfileset dir="${dest}/${fullnamever}"
prefix="${fullnamever}" prefix="${fullnamever}"
excludes="**/*.sh **/bin/ src/scripts/" /> excludes="**/*.sh **/bin/ src/scripts/" />
@ -934,7 +879,7 @@
includes="**/*.sh **/bin/ src/scripts/" includes="**/*.sh **/bin/ src/scripts/"
filemode="755" /> filemode="755" />
</zip> </zip>
<solr-checksum file="${dist}/${fullnamever}-bin.zip"/> <solr-checksum file="${dist}/${fullnamever}.zip"/>
</target> </target>