Ignore the `-snapshot` suffix when comparing the Lucene version in the build and the docs. (#27927)

Currently if the Lucene version is `X.Y.Z-snapshot-{gitrev}`, then we will
expect the docs to have `X.Y.Z-snapshot` as a Lucene version. I would like
to change it to `X.Y.Z` so that this doesn't need changing when we move from a
snapshot to a final release.
This commit is contained in:
Adrien Grand 2018-01-15 18:34:38 +01:00 committed by GitHub
parent 77a7e2480b
commit 05e851f0b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -76,10 +76,8 @@ task verifyDocsLuceneVersion {
throw new GradleException('Could not find lucene version in docs version file') throw new GradleException('Could not find lucene version in docs version file')
} }
String expectedLuceneVersion = VersionProperties.lucene String expectedLuceneVersion = VersionProperties.lucene
if (expectedLuceneVersion.contains('-snapshot-')) { // remove potential -snapshot-{gitrev} suffix
expectedLuceneVersion = expectedLuceneVersion.substring(0, expectedLuceneVersion.lastIndexOf('-')) expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
expectedLuceneVersion = expectedLuceneVersion.toUpperCase(Locale.ROOT)
}
if (docsLuceneVersion != expectedLuceneVersion) { if (docsLuceneVersion != expectedLuceneVersion) {
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]") throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
} }