LUCENE-5898: Remove remaining hardcoded versions from build files; add a new version.properties file

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1619906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-08-22 19:14:11 +00:00
parent bcddb85bca
commit 0cb726bba3
4 changed files with 36 additions and 24 deletions

View File

@ -24,6 +24,9 @@
<property file="${basedir}/build.properties"/> <property file="${basedir}/build.properties"/>
<property file="lucene/build.properties"/><!-- hack for Lucene users, clones Lucene's common-build.xml --> <property file="lucene/build.properties"/><!-- hack for Lucene users, clones Lucene's common-build.xml -->
<!-- include version number from property file (includes "version.*" properties) -->
<loadproperties srcFile="lucene/version.properties"/>
<target name="-projecthelp"> <target name="-projecthelp">
<java fork="false" classname="org.apache.tools.ant.Main" taskname="-"> <java fork="false" classname="org.apache.tools.ant.Main" taskname="-">
<arg value="-projecthelp"/> <arg value="-projecthelp"/>
@ -144,7 +147,6 @@
</subant> </subant>
</target> </target>
<property name="version" value="5.0.0-SNAPSHOT"/>
<property name="maven-build-dir" value="maven-build"/> <property name="maven-build-dir" value="maven-build"/>
<property name="maven-version" value="2.2.1"/> <property name="maven-version" value="2.2.1"/>
@ -287,11 +289,19 @@
</condition> </condition>
<!-- Define ${idea.jdk} if it's not yet defined - otherwise literal "${idea.jdk}" is substituted --> <!-- Define ${idea.jdk} if it's not yet defined - otherwise literal "${idea.jdk}" is substituted -->
<property name="idea.jdk" value=""/> <property name="idea.jdk" value=""/>
<copy todir="."> <!-- delete those files first, so they are regenerated by the filtering below
(add more files with dynamic properties like versions here): -->
<delete dir=".idea" includes="misc.xml workspace.xml"/>
<!-- Copy files with filtering: -->
<copy todir="." overwrite="false" encoding="UTF-8">
<fileset dir="dev-tools/idea"/> <fileset dir="dev-tools/idea"/>
<filterset begintoken="subst.=&quot;" endtoken="&quot;"> <filterset begintoken="subst.=&quot;" endtoken="&quot;">
<filter token="idea.jdk" value="${idea.jdk}"/> <filter token="idea.jdk" value="${idea.jdk}"/>
</filterset> </filterset>
<filterset>
<filter token="version" value="${version}"/>
<filter token="version.base" value="${version.base}"/>
</filterset>
</copy> </copy>
<antcall target="-post-idea-instructions"/> <antcall target="-post-idea-instructions"/>
</target> </target>
@ -359,7 +369,7 @@ File | Project Structure | Platform Settings | SDKs):
<property name="python32.exe" value="python3.2" /> <property name="python32.exe" value="python3.2" />
<property name="fakeRelease" location="lucene/build/fakeRelease"/> <property name="fakeRelease" location="lucene/build/fakeRelease"/>
<property name="fakeReleaseTmp" location="lucene/build/fakeReleaseTmp"/> <property name="fakeReleaseTmp" location="lucene/build/fakeReleaseTmp"/>
<property name="fakeReleaseVersion" value="5.0.0"/> <!-- *not* -SNAPSHOT, the real version --> <property name="fakeReleaseVersion" value="${version.base}"/>
<property name="smokeTestRelease.testArgs" value=""/> <property name="smokeTestRelease.testArgs" value=""/>
<target name="-load-env"> <target name="-load-env">

View File

@ -8,7 +8,7 @@
<module name="lucene-core-tests" /> <module name="lucene-core-tests" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/lucene/core" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/lucene/core" />
<option name="VM_PARAMETERS" value="-Xmx256m -ea -Dversion.base=5.0.0 -DtempDir=temp" /> <option name="VM_PARAMETERS" value="-Xmx256m -ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Module analyzers-common" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Module analyzers-common" type="JUnit" factoryName="JUnit">
@ -183,28 +183,28 @@
<module name="solr-core-tests" /> <module name="solr-core-tests" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/solr-core" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/solr-core" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=5.0.0 -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" /> <option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=@version.base@ -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Solrj" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Solrj" type="JUnit" factoryName="JUnit">
<module name="solrj-tests" /> <module name="solrj-tests" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/solr-solrj" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/solr-solrj" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=5.0.0 -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" /> <option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=@version.base@ -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Solr analysis-extras contrib" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Solr analysis-extras contrib" type="JUnit" factoryName="JUnit">
<module name="analysis-extras" /> <module name="analysis-extras" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-analysis-extras" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-analysis-extras" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=5.0.0 -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" /> <option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=@version.base@ -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Solr clustering contrib" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Solr clustering contrib" type="JUnit" factoryName="JUnit">
<module name="clustering" /> <module name="clustering" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-clustering" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-clustering" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=5.0.0 -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" /> <option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=@version.base@ -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Solr dataimporthandler contrib" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Solr dataimporthandler contrib" type="JUnit" factoryName="JUnit">
@ -260,7 +260,7 @@
<module name="uima" /> <module name="uima" />
<option name="TEST_OBJECT" value="package" /> <option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-uima" /> <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/solr-uima" />
<option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=5.0.0 -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" /> <option name="VM_PARAMETERS" value="-ea -Dtests.luceneMatchVersion=@version.base@ -DtempDir=temp -Djetty.testMode=1 -Djetty.insecurerandom=1 -Dsolr.directoryFactory=org.apache.solr.core.MockDirectoryFactory" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option> <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration> </configuration>
<configuration default="false" name="Solr velocity contrib" type="JUnit" factoryName="JUnit"> <configuration default="false" name="Solr velocity contrib" type="JUnit" factoryName="JUnit">

View File

@ -26,13 +26,6 @@
for standalone use. for standalone use.
</description> </description>
<!-- !!! RELEASE MANAGER: Change version numbers only here: !!! -->
<!-- The base version of the next release (including bugfix number, e.g., x.y.z+): -->
<property name="version.base" value="5.0.0"/>
<!-- !!! RELEASE MANAGER: Don't change anything after this line! !!! -->
<dirname file="${ant.file.common}" property="common.dir"/> <dirname file="${ant.file.common}" property="common.dir"/>
<property name="dev-tools.dir" location="${common.dir}/../dev-tools"/> <property name="dev-tools.dir" location="${common.dir}/../dev-tools"/>
<property name="prettify.dir" location="${common.dir}/tools/prettify"/> <property name="prettify.dir" location="${common.dir}/tools/prettify"/>
@ -57,16 +50,15 @@
<property name="Name" value="Lucene"/> <property name="Name" value="Lucene"/>
<property name="name" value="${ant.project.name}"/> <property name="name" value="${ant.project.name}"/>
<!--TODO: remove once Jenkins jobs are updated:--><property name="dev.version.suffix" value="SNAPSHOT"/> <!-- include version number from property file (includes "version.*" properties) -->
<loadproperties srcFile="${common.dir}/version.properties"/>
<!-- Suffix of the version, by default SNAPSHOT: -->
<property name="version.suffix" value="${dev.version.suffix}"/>
<property name="version" value="${version.base}-${version.suffix}"/>
<!-- must be in format x.y with only digits, so we use version.base: --> <fail message="'version.base' property must be 'x.y.z' (major, minor, bugfix) or 'x.y.z.1/2' (+ prerelease) and numeric only: ${version.base}">
<property name="spec.version" value="${version.base}"/> <condition>
<not><matches pattern="^\d+\.\d+\.\d+(|\.1|\.2)$" casesensitive="true" string="${version.base}"/></not>
</condition>
</fail>
<fail message="If you pass -Dversion=... to set a release version, it must match &quot;${version.base}&quot;, optionally followed by a suffix (e.g., &quot;-SNAPSHOT&quot;)."> <fail message="If you pass -Dversion=... to set a release version, it must match &quot;${version.base}&quot;, optionally followed by a suffix (e.g., &quot;-SNAPSHOT&quot;).">
<condition> <condition>
<not><matches pattern="^\Q${version.base}\E(|\-.*)$" casesensitive="true" string="${version}"/></not> <not><matches pattern="^\Q${version.base}\E(|\-.*)$" casesensitive="true" string="${version}"/></not>

10
lucene/version.properties Normal file
View File

@ -0,0 +1,10 @@
# This file contains some version properties as used by various build files.
# RELEAE MANAGER must change this file after creating a release and
# enter new base version (format "x.y.z", no prefix/appendix):
version.base=5.0.0
# Other version property defaults, don't change:
version.suffix=SNAPSHOT
version=${version.base}-${version.suffix}
spec.version=${version.base}