Skip to content

Apache Lucene open-source search software

LUCENE-3406: Add ant target 'package-local-src-tgz' to Lucene and Solr to package sources from the local working copy.

Steven Rowe584adbc613a7
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 0be936905fe..f4325c4c688 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -623,6 +623,13 @@ Test Cases
* LUCENE-3327: Fix AIOOBE when TestFSTs is run with
-Dtests.verbose=true (James Dyer via Mike McCandless)
+Build
+
+* LUCENE-3406: Add ant target 'package-local-src-tgz' to Lucene and Solr
+ to package sources from the local working copy.
+ (Seung-Yeoul Yang via Steve Rowe)
+
+
======================= Lucene 3.3.0 =======================
Changes in backwards compatibility policy
diff --git a/lucene/build.xml b/lucene/build.xml
index a096d9906a8..c38c85e60d3 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -381,6 +381,22 @@
<make-checksums file="${source.package.file}"/>
</target>
+ <!-- ================================================================== -->
+ <!-- Packages the sources from local working copy with tar-gzip -->
+ <!-- ================================================================== -->
+ <target name="package-local-src-tgz" depends="init, init-dist"
+ description="--> Packages the Lucene source from the local working copy">
+ <mkdir dir="${common.dir}/build"/>
+ <property name="source.package.file"
+ value="${common.dir}/build/lucene-${version}-src.tgz"/>
+ <delete file="${source.package.file}"/>
+ <tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
+ <tarfileset prefix="lucene-${version}" dir=".">
+ <patternset refid="lucene.local.src.package.patterns"/>
+ </tarfileset>
+ </tar>
+ </target>
+
<!-- ================================================================== -->
<!-- same as package-tgz-src. it is just here for compatibility. -->
<!-- ================================================================== -->
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index f2d67b4d47b..90af8d37953 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -209,6 +209,11 @@
<propertyref regex=".*\.compiled$$"/>
</propertyset>
+ <patternset id="lucene.local.src.package.patterns"
+ includes="src/,index.html,*build*.xml,docs/,*.txt,contrib/,lib/,backwards/"
+ excludes="**/pom.xml,**/*.iml,src/site/build/"
+ />
+
<target name="clean"
description="Removes contents of build and dist directories">
<delete dir="${build.dir}"/>
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index bd1a287c959..d36f9a5bc4d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -301,7 +301,7 @@ Other Changes
* SOLR-2654: The same Directory instance is now always used across a SolrCore so that
it's easier to add other DirectoryFactory's without static caching hacks.
(Mark Miller)
-
+
Documentation
----------------------
@@ -481,6 +481,10 @@ Build
modules' build.xml files.
(Steve Rowe, Robert Muir)
+* LUCENE-3406: Add ant target 'package-local-src-tgz' to Lucene and Solr
+ to package sources from the local working copy.
+ (Seung-Yeoul Yang via Steve Rowe)
+
Documentation
----------------------
diff --git a/solr/build.xml b/solr/build.xml
index 4d27e17d8d7..34ad93c26ac 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -304,7 +304,35 @@
</tar>
<make-checksums file="${source.package.file}"/>
</target>
-
+
+ <target name="package-local-src-tgz"
+ description="Packages the Solr and Lucene sources from the local working copy">
+ <mkdir dir="${common-solr.dir}/build"/>
+ <property name="source.package.file"
+ value="${common-solr.dir}/build/${fullnamever}-src.tgz"/>
+ <delete file="${source.package.file}" failonerror="false" />
+
+ <tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
+ <tarfileset dir="../modules" prefix="${fullnamever}/modules" excludes="**/build/" />
+ <tarfileset dir=".." prefix="${fullnamever}" includes="*.txt *.xml dev-tools/" />
+ <tarfileset dir="." prefix="${fullnamever}" includes="LICENSE.txt NOTICE.txt"/>
+ <tarfileset dir="." prefix="${fullnamever}/solr"
+ excludes="build ${package.dir}/** ${dist}/**
+ example/webapps/*.war example/exampledocs/post.jar
+ lib/README.committers.txt **/data/ **/logs/*
+ **/*.sh **/bin/ src/scripts/ site-src/build/
+ .idea/ **/*.iml **/pom.xml" />
+ <tarfileset dir="." prefix="${fullnamever}/solr"
+ includes="core/src/test-files/solr/lib/classes/empty-file-main-lib.txt" />
+ <tarfileset dir="." filemode="755" prefix="${fullnamever}/solr"
+ includes="**/*.sh **/bin/ core/src/scripts/"
+ excludes="build/**"/>
+ <tarfileset dir="../lucene" prefix="${fullnamever}/lucene">
+ <patternset refid="lucene.local.src.package.patterns"/>
+ </tarfileset>
+ </tar>
+ </target>
+
<target name="create-package"
description="Packages the Solr Binary Distribution"
depends="init-dist, dist, example, javadocs">