mirror of https://github.com/apache/lucene.git
LUCENE-4180: Bump Constants.LUCENE_MAIN_VERSION before beta release
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1361857 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
decfcdbbbb
commit
dc27d24e0b
|
@ -117,9 +117,14 @@ public final class Constants {
|
||||||
Package pkg = LucenePackage.get();
|
Package pkg = LucenePackage.get();
|
||||||
String v = (pkg == null) ? null : pkg.getImplementationVersion();
|
String v = (pkg == null) ? null : pkg.getImplementationVersion();
|
||||||
if (v == null) {
|
if (v == null) {
|
||||||
v = LUCENE_MAIN_VERSION + "-SNAPSHOT";
|
String parts[] = LUCENE_MAIN_VERSION.split("\\.");
|
||||||
} else if (!v.startsWith(LUCENE_MAIN_VERSION)) {
|
if (parts.length == 4) {
|
||||||
v = LUCENE_MAIN_VERSION + "-SNAPSHOT " + v;
|
// alpha/beta
|
||||||
|
assert parts[2].equals("0");
|
||||||
|
v = parts[0] + "." + parts[1] + "-SNAPSHOT";
|
||||||
|
} else {
|
||||||
|
v = LUCENE_MAIN_VERSION + "-SNAPSHOT";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
LUCENE_VERSION = ident(v);
|
LUCENE_VERSION = ident(v);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,9 +119,19 @@ public class TestCheckIndex extends LuceneTestCase {
|
||||||
// common-build.xml sets lucene.version
|
// common-build.xml sets lucene.version
|
||||||
final String version = System.getProperty("lucene.version");
|
final String version = System.getProperty("lucene.version");
|
||||||
assertNotNull( "null version", version);
|
assertNotNull( "null version", version);
|
||||||
|
final String constantVersion;
|
||||||
|
String parts[] = Constants.LUCENE_MAIN_VERSION.split("\\.");
|
||||||
|
if (parts.length == 4) {
|
||||||
|
// alpha/beta version: pull the real portion
|
||||||
|
assert parts[2].equals("0");
|
||||||
|
constantVersion = parts[0] + "." + parts[1];
|
||||||
|
} else {
|
||||||
|
// normal version
|
||||||
|
constantVersion = Constants.LUCENE_MAIN_VERSION;
|
||||||
|
}
|
||||||
assertTrue("Invalid version: "+version,
|
assertTrue("Invalid version: "+version,
|
||||||
version.equals(Constants.LUCENE_MAIN_VERSION+"-SNAPSHOT") ||
|
version.equals(constantVersion+"-SNAPSHOT") ||
|
||||||
version.equals(Constants.LUCENE_MAIN_VERSION));
|
version.equals(constantVersion));
|
||||||
assertTrue(Constants.LUCENE_VERSION + " should start with: "+version,
|
assertTrue(Constants.LUCENE_VERSION + " should start with: "+version,
|
||||||
Constants.LUCENE_VERSION.startsWith(version));
|
Constants.LUCENE_VERSION.startsWith(version));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue