Skip to content

Commit

Permalink
NO JIRA: start validateRefGuideFiles gradle task (apache#1068)
Browse files Browse the repository at this point in the history
Also 9.1-->9.3 for lucene-javadocs in solr-ref-guide/antora.yml to match branch_9x and branch_9_1 commits.
  • Loading branch information
cpoerschke authored Oct 19, 2022
1 parent c80cf5b commit b8e2ca4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ apply from: file('gradle/validation/validate-log-calls.gradle')
apply from: file('gradle/validation/check-broken-links.gradle')

apply from: file('gradle/validation/solr.config-file-sanity.gradle')
apply from: file('gradle/validation/solr.ref-guide-files.gradle')

apply from: file('gradle/validation/spotless.gradle')

Expand Down
1 change: 1 addition & 0 deletions gradle/validation/precommit.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ configure(rootProject) {

// Solr validation tasks.
dependsOn ":solr:validateConfigFileSanity"
dependsOn ":solr:validateRefGuideFiles"

// Attach all these tasks from all projects that have them.
// This uses lazy collections as they may not yet be defined.
Expand Down
31 changes: 31 additions & 0 deletions gradle/validation/solr.ref-guide-files.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

configure(project(":solr")) {
task validateRefGuideFiles() {
doFirst {
def (major, minor, patch) = rootProject.luceneBaseVersionProvider.get().tokenize('.')
def linkVersion = "${major}_${minor}_${patch}"

def antora_yml = file("solr-ref-guide/antora.yml")
def content = antora_yml.getText("UTF-8")
if (!content.contains("lucene-javadocs: 'https://lucene.apache.org/core/${linkVersion}'")) {
throw new GradleException("${antora_yml.absolutePath} lucene-javadocs does not link to the correct lucene version (${linkVersion})")
}
}
}
}
2 changes: 1 addition & 1 deletion solr/solr-ref-guide/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ asciidoc:
# 'patch-version' is the 'z' part of x.y.z semantic version
page-solr-javadocs: 'https://solr.apache.org/docs/10_0_0'
solr-javadocs: 'https://solr.apache.org/docs/10_0_0'
lucene-javadocs: 'https://lucene.apache.org/core/9_1_0'
lucene-javadocs: 'https://lucene.apache.org/core/9_3_0'
java-javadocs: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/
# Some constructed links may be 404 TODO to check
solr-docs-version: '10.0'
Expand Down

0 comments on commit b8e2ca4

Please sign in to comment.