LUCENE-9871: clean up some old cruft and shuffle files around. Correct inputs/outputs on check broken links so that it's incremental.

This commit is contained in:
Dawid Weiss 2021-03-30 10:55:19 +02:00
parent 974e4bc5e8
commit 3115797463
12 changed files with 64 additions and 71 deletions

View File

@ -28,7 +28,7 @@ plugins {
id 'com.diffplug.spotless' version "5.8.2" apply false
}
apply from: file('gradle/defaults.gradle')
apply from: file('gradle/globals.gradle')
// General metadata.
@ -107,7 +107,7 @@ ext {
// if the build file is incorrectly written and evaluates something
// eagerly).
apply from: file('gradle/generate-defaults.gradle')
apply from: file('gradle/generation/local-settings.gradle')
// Ant-compatibility layer: apply folder layout early so that
// evaluation of other scripts doesn't need to be deferred.
@ -115,16 +115,16 @@ apply from: file('gradle/ant-compat/folder-layout.gradle')
// Set up defaults and configure aspects for certain modules or functionality
// (java, tests)
apply from: file('gradle/defaults-java.gradle')
apply from: file('gradle/java/javac.gradle')
apply from: file('gradle/testing/defaults-tests.gradle')
apply from: file('gradle/testing/randomization.gradle')
apply from: file('gradle/testing/fail-on-no-tests.gradle')
apply from: file('gradle/testing/alternative-jdk-support.gradle')
apply from: file('gradle/jar-manifest.gradle')
apply from: file('gradle/java/jar-manifest.gradle')
// Publishing and releasing
apply from: file('gradle/maven/defaults-maven.gradle')
apply from: file('gradle/releasing.gradle')
apply from: file('gradle/publishing/defaults-maven.gradle')
apply from: file('gradle/publishing/distribution.gradle')
// IDE support, settings and specials.
apply from: file('gradle/ide/intellij-idea.gradle')
@ -143,7 +143,6 @@ apply from: file('gradle/validation/rat-sources.gradle')
apply from: file('gradle/validation/owasp-dependency-check.gradle')
apply from: file('gradle/validation/ecj-lint.gradle')
apply from: file('gradle/validation/gradlew-scripts-tweaked.gradle')
apply from: file('gradle/validation/check-broken-links.gradle')
apply from: file('gradle/validation/spotless.gradle')
@ -163,7 +162,7 @@ apply from: file('gradle/datasets/external-datasets.gradle')
apply from: file('gradle/native/disable-native.gradle')
// Additional development aids.
apply from: file('gradle/maven/maven-local.gradle')
apply from: file('gradle/publishing/maven-local.gradle')
apply from: file('gradle/testing/per-project-summary.gradle')
apply from: file('gradle/testing/slowest-tests-at-end.gradle')
apply from: file('gradle/testing/failed-tests-at-end.gradle')
@ -181,6 +180,7 @@ apply from: file('gradle/documentation/documentation.gradle')
apply from: file('gradle/documentation/changes-to-html.gradle')
apply from: file('gradle/documentation/markdown.gradle')
apply from: file('gradle/documentation/render-javadoc.gradle')
apply from: file('gradle/documentation/check-broken-links.gradle')
apply from: file('gradle/hacks/gradle-archives.gradle')
apply from: file('gradle/hacks/wipe-temp.gradle')

View File

@ -15,36 +15,38 @@
* limitations under the License.
*/
configure(rootProject) {
task checkBrokenLinks {
group 'Verification'
description 'Check broken links in the entire documentation'
dependsOn ':lucene:documentation:checkBrokenLinks'
}
}
def resources = scriptResources(buildscript)
configure(project(':lucene:documentation')) {
task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')
task checkBrokenLinks(type: CheckBrokenLinksTask) {
group 'Verification'
description 'Check broken links in the entire documentation'
dependsOn 'documentation'
validationScript = file("${resources}/checkJavadocLinks.py")
docsDir.fileProvider(provider { -> file(project.docroot) })
output = project.file("${buildDir}/check-broken-links-output.txt")
}
check.dependsOn checkBrokenLinks
}
class CheckBrokenLinksTask extends DefaultTask {
// wraps input directory location in DirectoryProperty so as to lazily evaluate 'docroot' property
// (see gradle/documentation/documentation.gradle)
@InputDirectory
final DirectoryProperty docsDir = project.objects.directoryProperty()
.fileProvider(project.providers.provider { project.docroot })
@InputFile
File script = project.rootProject.file("dev-tools/scripts/checkJavadocLinks.py")
File validationScript
@OutputFile
File output
@TaskAction
def check() {
def outputFile = project.file("${getTemporaryDir()}/check-broken-links-output.txt")
def result
outputFile.withOutputStream { output ->
output.withOutputStream { output ->
result = project.exec {
executable project.externalTool("python3")
ignoreExitValue = true
@ -52,14 +54,14 @@ class CheckBrokenLinksTask extends DefaultTask {
errorOutput = output
args = [
"-B",
script.absolutePath,
validationScript.absolutePath,
docsDir.get().getAsFile()
]
}
}
if (result.getExitValue() != 0) {
throw new GradleException("Broken links check failed. Command output at: ${outputFile}")
throw new GradleException("Broken links check failed. Command output at: ${output}")
}
}
}

View File

@ -23,13 +23,6 @@ allprojects {
// Repositories to fetch dependencies from.
repositories {
mavenCentral()
if (System.getProperty("skip.lucene") as Boolean) {
maven {
name "ApacheSnapshots"
url 'https://repository.apache.org/content/repositories/snapshots/'
}
}
}
// Artifacts will have names after full gradle project path

View File

@ -190,8 +190,8 @@ class ValidateSourcePatternsTask extends DefaultTask {
def validSPINameJavadocTag = ~$/(?s)\s*\*\s*@lucene\.spi\s+\{@value #NAME\}/$;
def isLicense = { matcher, ratDocument ->
licenseMatcher.reset();
return lineSplitter.split(matcher.group(1)).any{ licenseMatcher.match(ratDocument, it) };
licenseMatcher.reset()
return lineSplitter.split(matcher.group(1)).any { licenseMatcher.match(ratDocument, it) }
}
def checkLicenseHeaderPrecedes = { f, description, contentPattern, commentPattern, text, ratDocument ->
@ -213,7 +213,7 @@ class ValidateSourcePatternsTask extends DefaultTask {
def checkMockitoAssume = { f, text ->
if (text.contains("mockito") && !text.contains("assumeWorkingMockito()")) {
reportViolation(f, 'File uses Mockito but has no assumeWorkingMockito() call');
reportViolation(f, 'File uses Mockito but has no assumeWorkingMockito() call')
}
}

View File

@ -19,40 +19,38 @@ rootProject.name = "lucene-root"
includeBuild("dev-tools/missing-doclet")
if (!(System.getProperty("skip.lucene") as Boolean)) {
include "lucene:analysis:common"
include "lucene:analysis:icu"
include "lucene:analysis:kuromoji"
include "lucene:analysis:morfologik"
include "lucene:analysis:nori"
include "lucene:analysis:opennlp"
include "lucene:analysis:phonetic"
include "lucene:analysis:smartcn"
include "lucene:analysis:stempel"
include "lucene:backward-codecs"
include "lucene:benchmark"
include "lucene:classification"
include "lucene:codecs"
include "lucene:core"
include "lucene:demo"
include "lucene:expressions"
include "lucene:facet"
include "lucene:grouping"
include "lucene:highlighter"
include "lucene:join"
include "lucene:luke"
include "lucene:memory"
include "lucene:misc"
include "lucene:misc:native"
include "lucene:monitor"
include "lucene:queries"
include "lucene:queryparser"
include "lucene:replicator"
include "lucene:sandbox"
include "lucene:spatial-extras"
include "lucene:spatial3d"
include "lucene:suggest"
include "lucene:test-framework"
include "lucene:documentation"
include "lucene:packaging"
}
include "lucene:analysis:common"
include "lucene:analysis:icu"
include "lucene:analysis:kuromoji"
include "lucene:analysis:morfologik"
include "lucene:analysis:nori"
include "lucene:analysis:opennlp"
include "lucene:analysis:phonetic"
include "lucene:analysis:smartcn"
include "lucene:analysis:stempel"
include "lucene:backward-codecs"
include "lucene:benchmark"
include "lucene:classification"
include "lucene:codecs"
include "lucene:core"
include "lucene:demo"
include "lucene:expressions"
include "lucene:facet"
include "lucene:grouping"
include "lucene:highlighter"
include "lucene:join"
include "lucene:luke"
include "lucene:memory"
include "lucene:misc"
include "lucene:misc:native"
include "lucene:monitor"
include "lucene:queries"
include "lucene:queryparser"
include "lucene:replicator"
include "lucene:sandbox"
include "lucene:spatial-extras"
include "lucene:spatial3d"
include "lucene:suggest"
include "lucene:test-framework"
include "lucene:documentation"
include "lucene:packaging"