LUCENE-8224: Allow releases to be built with ant 1.10

Also adds a check to common-build.xml to fail early with ant 1.10.2, which
has a bug that prevents lucene from building.
This commit is contained in:
Alan Woodward 2018-03-26 12:00:12 +01:00
parent b0f677c383
commit f2e3b109e6
3 changed files with 18 additions and 4 deletions

View File

@ -286,9 +286,17 @@ def parse_config():
def check_cmdline_tools(): # Fail fast if there are cmdline tool problems
if os.system('git --version >/dev/null 2>/dev/null'):
raise RuntimeError('"git --version" returned a non-zero exit code.')
check_ant()
def check_ant():
antVersion = os.popen('ant -version').read().strip()
if not antVersion.startswith('Apache Ant(TM) version 1.8') and not antVersion.startswith('Apache Ant(TM) version 1.9'):
raise RuntimeError('ant version is not 1.8.X: "%s"' % antVersion)
if (antVersion.startswith('Apache Ant(TM) version 1.8')):
return
if (antVersion.startswith('Apache Ant(TM) version 1.9')):
return
if (antVersion.startswith('Apache Ant(TM) version 1.10')):
return
raise RuntimeError('Unsupported ant version (must be 1.8 - 1.10): "%s"' % antVersion)
def main():
check_cmdline_tools()

View File

@ -190,8 +190,8 @@ def checkJARMetaData(desc, jarFile, gitRevision, version):
'Implementation-Vendor: The Apache Software Foundation',
# Make sure 1.8 compiler was used to build release bits:
'X-Compile-Source-JDK: 8',
# Make sure 1.8 or 1.9 ant was used to build release bits: (this will match 1.8.x, 1.9.x)
('Ant-Version: Apache Ant 1.8', 'Ant-Version: Apache Ant 1.9'),
# Make sure 1.8, 1.9 or 1.10 ant was used to build release bits: (this will match 1.8.x, 1.9.x, 1.10.x)
('Ant-Version: Apache Ant 1.8', 'Ant-Version: Apache Ant 1.9', 'Ant-Version: Apache Ant 1.10'),
# Make sure .class files are 1.8 format:
'X-Compile-Target-JDK: 8',
'Specification-Version: %s' % version,

View File

@ -283,6 +283,12 @@
</condition>
</fail>
<fail message="Cannot run with ANT version 1.0.2 - see https://issues.apache.org/jira/browse/LUCENE-8189">
<condition>
<antversion exactly="1.10.2"/>
</condition>
</fail>
<fail message="Minimum supported Java version is 1.8.">
<condition>
<not><hasmethod classname="java.util.Arrays" method="parallelSort"/></not>