LUCENE-6938: Convert build to work with Git rather than SVN. (Mark Miller

via Dawid Weiss).

Conflicts:
	.gitignore
	lucene/build.xml
	solr/build.xml
This commit is contained in:
Dawid Weiss 2016-01-23 02:46:55 +01:00
parent 8aefec9db0
commit 63e9df41d4
4 changed files with 39 additions and 75 deletions

3
.gitignore vendored
View File

@ -47,3 +47,6 @@ solr/contrib/dataimporthandler/test-lib/
solr/contrib/morphlines-core/test-lib/
solr/core/test-lib/
solr/server/solr-webapp
solr/server/start.jar

View File

@ -336,25 +336,25 @@
</target>
<!-- ================================================================== -->
<!-- Packages the sources from "svn export" with tar-gzip -->
<!-- Packages the sources with tar-gzip -->
<!-- ================================================================== -->
<target name="package-tgz-src" depends="init-dist"
description="--> Generates the Lucene source distribution from 'svn export' as .tgz">
description="--> Generates the Lucene source distribution as .tgz">
<property name="source.package.file"
value="${dist.dir}/lucene-${version}-src.tgz"/>
<delete file="${source.package.file}"/>
<svn-export-source source.dir="."/>
<export-source source.dir="."/>
<!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->
<delete dir="${svn.export.dir}/tools/javadoc/java7"/>
<delete dir="${src.export.dir}/tools/javadoc/java7"/>
<!-- Exclude clover license files incompatible with the ASL -->
<delete dir="${svn.export.dir}/tools/clover"/>
<delete dir="${src.export.dir}/tools/clover"/>
<build-changes changes.src.file="${svn.export.dir}/CHANGES.txt"
changes.target.dir="${svn.export.dir}/docs/changes"
<build-changes changes.src.file="${src.export.dir}/CHANGES.txt"
changes.target.dir="${src.export.dir}/docs/changes"
changes.product="LUCENE"/>
<tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset prefix="lucene-${version}" dir="${svn.export.dir}"/>
<tarfileset prefix="lucene-${version}" dir="${src.export.dir}"/>
</tar>
<make-checksums file="${source.package.file}"/>
</target>

View File

@ -238,14 +238,7 @@
<property name="manifest.file" location="${build.dir}/MANIFEST.MF"/>
<!--
we attempt to exec svnversion to get details build information
for jar manifests. this property can be set at runtime to an
explicit path as needed, or ant will just try to find it in the
default PATH. (this is useful for Hudson)
-->
<property name="svnversion.exe" value="svnversion" />
<property name="svn.exe" value="svn" />
<property name="git.exe" value="git" />
<property name="perl.exe" value="perl" />
<property name="python.exe" value="python" />
@ -633,14 +626,12 @@
<attribute name="manifest.file" default="${manifest.file}"/>
<element name="additional-manifest-attributes" optional="true"/>
<sequential>
<local name="-svnversion-raw"/>
<local name="svnversion"/>
<!-- If possible, include the svnversion -->
<exec dir="." executable="${svnversion.exe}" outputproperty="-svnversion-raw" failifexecutionfails="false"/>
<condition property="svnversion" value="${-svnversion-raw}" else="unknown">
<matches pattern="^\s*[\d:MSP]+\s*$" string="${-svnversion-raw}" casesensitive="true"/>
</condition>
<exec dir="." executable="${git.exe}" outputproperty="checkoutid" failifexecutionfails="false">
<arg value="log"/>
<arg value="--format='%H'"/>
<arg value="-n"/>
<arg value="1"/>
</exec>
<manifest file="@{manifest.file}">
<!--
@ -672,7 +663,7 @@
<attribute name="Implementation-Title" value="@{implementation.title}"/>
<!-- impl version can be any string -->
<attribute name="Implementation-Version"
value="${version} ${svnversion} - ${user.name} - ${DSTAMP} ${TSTAMP}"/>
value="${version} ${checkoutid} - ${user.name} - ${DSTAMP} ${TSTAMP}"/>
<attribute name="Implementation-Vendor"
value="The Apache Software Foundation"/>
<attribute name="X-Compile-Source-JDK" value="${javac.source}"/>
@ -1560,7 +1551,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
$ ant -Dclover.license.path=/path/to/clover.license -Drun.clover=true ...
Apache Lucene/Solr source checkouts from SVN already contain the
Apache Lucene/Solr source checkouts from Git already contain the
file, but source distributions cannot because of legal reasons.
#########################################################################
@ -2256,51 +2247,21 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
<target name="validate">
</target>
<property name="svn.export.dir" location="${build.dir}/svn-export"/>
<macrodef name="svn-export-source"
description="Runs 'svn export' with the same URL and revision as the current working copy.">
<property name="src.export.dir" location="${build.dir}/src-export"/>
<macrodef name="export-source"
description="Exports the source to src.export.dir.">
<attribute name="source.dir"/>
<sequential>
<delete dir="${svn.export.dir}" includeemptydirs="true" failonerror="false"/>
<get-svn-info directory="@{source.dir}"/>
<exec dir="@{source.dir}" executable="${svn.exe}" failonerror="true">
<arg value="export"/>
<arg value="--native-eol"/>
<arg value="LF"/>
<arg value="-r"/>
<arg value="${svn.Revision}"/>
<arg value="${svn.URL}"/>
<arg value="${svn.export.dir}"/>
<delete dir="${src.export.dir}" includeemptydirs="true" failonerror="false"/>
<exec dir="@{source.dir}" executable="${git.exe}" failonerror="true">
<arg value="checkout-index"/>
<arg value="-a"/>
<arg value="-f"/>
<arg value="--prefix=${src.export.dir}/"/>
</exec>
</sequential>
</macrodef>
<macrodef name="get-svn-info"
description="Populates properties svn.URL and svn.Revision using 'svn info'.">
<attribute name="directory"/>
<sequential>
<exec dir="@{directory}" executable="${svnversion.exe}" outputproperty="svn.ver"/>
<fail message="A subversion checkout is required for this target">
<condition>
<matches pattern="(exported|unversioned.*)" string="${svn.ver}" casesensitive="false"/>
</condition>
</fail>
<exec dir="@{directory}" executable="${svn.exe}" 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>
</sequential>
</macrodef>
<macrodef name="make-checksums" description="Macro for building checksum files">
<attribute name="file"/>
<sequential>

View File

@ -448,36 +448,36 @@
dest="${package.dir}/KEYS"/>
</target>
<!-- Makes a tarball from running "svn export" at the root level. -->
<!-- Makes a tarball of the source. -->
<!-- Copies NOTICE.txt and LICENSE.txt from solr/ to the root level. -->
<target name="package-src-tgz" depends="init-dist"
description="Packages the Solr Source Distribution">
<property name="source.package.file"
value="${package.dir}/${fullnamever}-src.tgz"/>
<delete file="${source.package.file}" failonerror="false" />
<svn-export-source source.dir=".."/>
<export-source source.dir=".."/>
<!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->
<delete dir="${svn.export.dir}/lucene/tools/javadoc/java7"/>
<delete dir="${src.export.dir}/lucene/tools/javadoc/java7"/>
<!-- Exclude clover license files incompatible with the ASL -->
<delete dir="${svn.export.dir}/lucene/tools/clover"/>
<delete dir="${src.export.dir}/lucene/tools/clover"/>
<build-changes changes.src.file="${svn.export.dir}/solr/CHANGES.txt"
changes.target.dir="${svn.export.dir}/solr/docs/changes"
<build-changes changes.src.file="${src.export.dir}/solr/CHANGES.txt"
changes.target.dir="${src.export.dir}/solr/docs/changes"
changes.product="SOLR"/>
<tar destfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset dir="${svn.export.dir}/lucene"
<tarfileset dir="${src.export.dir}/lucene"
includes="CHANGES.txt"
fullpath="${fullnamever}/solr/LUCENE_CHANGES.txt" />
<tarfileset dir="${svn.export.dir}"
<tarfileset dir="${src.export.dir}"
prefix="${fullnamever}"
excludes="solr/example/**/*.sh solr/example/**/bin/ solr/scripts/**"/>
<tarfileset dir="${svn.export.dir}"
<tarfileset dir="${src.export.dir}"
prefix="${fullnamever}"
filemode="755"
includes="solr/example/**/*.sh solr/example/**/bin/ solr/scripts/**"/>
<tarfileset dir="${svn.export.dir}/solr" prefix="${fullnamever}"
<tarfileset dir="${src.export.dir}/solr" prefix="${fullnamever}"
includes="NOTICE.txt,LICENSE.txt"/>
</tar>
<make-checksums file="${source.package.file}"/>