Skip to content

Moved lucene.java.tests-and-randomization.gradle and more scripts to java #14897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 6, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@
* limitations under the License.
*/

import org.apache.lucene.gradle.plugins.globals.LuceneBuildGlobalsExtension

if (project != project.rootProject) {
throw new GradleException("Applicable to rootProject only: " + project.path)
}

configure(rootProject) {
def urlVersion = rootProject.ext.baseVersion.replace('.', '_')
LuceneBuildGlobalsExtension buildGlobals = rootProject.extensions.getByType(LuceneBuildGlobalsExtension)
def urlVersion = buildGlobals.baseVersion.replace('.', '_')

Provider<String> luceneJavadocUrl = buildOptions.addOption("lucene.javadoc.url",
"External Javadoc URL for documentation generator.", provider {
if (project.version != project.baseVersion) {
if (buildGlobals.snapshotBuild) {
// non-release build does not cross-link between modules.
return null
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.util.ast.Document;
import com.vladsch.flexmark.util.data.MutableDataSet;
import com.vladsch.flexmark.util.sequence.Escaping;
import groovy.text.SimpleTemplateEngine;
import groovy.text.SimpleTemplateEngine
import org.apache.lucene.gradle.plugins.globals.LuceneBuildGlobalsExtension

configure(project(':lucene:documentation')) {
tasks.register("markdownToHtml", Copy, {
Expand Down Expand Up @@ -59,6 +60,13 @@ configure(project(':lucene:documentation')) {
// list all properties used by the template here to allow uptodate checks to be correct:
inputs.property('version', project.version)

def buildGlobals = project.extensions.getByType(LuceneBuildGlobalsExtension)

binding.put("project", [
"version": project.version,
"majorVersion": buildGlobals.majorVersion
])

binding.put('defaultCodecPackage', providers.provider {
// static Codec defaultCodec = LOADER . lookup ( "LuceneXXX" ) ;
def regex = ~/\bdefaultCodec\s*=\s*LOADER\s*\.\s*lookup\s*\(\s*"([^"]+)"\s*\)\s*;/
Expand Down Expand Up @@ -156,9 +164,7 @@ class MarkdownTemplateTask extends DefaultTask {
@TaskAction
void transform() {
def engine = new SimpleTemplateEngine();
def resolvedBinding = binding.get() + [
project : project
]
def resolvedBinding = new HashMap(binding.get())
String markdown = templateFile.withReader('UTF-8') {
engine.createTemplate(it).make(resolvedBinding).toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.gradle.internal.jvm.Jvm
import org.apache.lucene.gradle.plugins.java.RenderJavadocTaskBase

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down Expand Up @@ -269,7 +270,7 @@ class OfflineLink implements Serializable {
}

@CacheableTask
class RenderJavadocTask extends DefaultTask {
abstract class RenderJavadocTask extends RenderJavadocTaskBase {
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
@IgnoreEmptyDirectories
Expand Down Expand Up @@ -329,11 +330,6 @@ class RenderJavadocTask extends DefaultTask {
@Optional
ListProperty<String> extraOpts = project.objects.listProperty(String)

@Optional
@Input
final Property<String> executable = project.objects.property(String).convention(
project.provider { Jvm.current().javadocExecutable.toString() })

@InputDirectory
@PathSensitive(PathSensitivity.RELATIVE)
@IgnoreEmptyDirectories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ import org.apache.lucene.gradle.plugins.spotless.GoogleJavaFormatPlugin
import org.apache.lucene.gradle.plugins.java.JavaFolderLayoutPlugin
import org.apache.lucene.gradle.plugins.java.JavacConfigurationPlugin
import org.apache.lucene.gradle.plugins.java.JarManifestConfigurationPlugin
import org.apache.lucene.gradle.plugins.java.TestsAndRandomizationPlugin
import org.apache.lucene.gradle.plugins.java.TestsBeastingPlugin
import org.apache.lucene.gradle.plugins.java.AlternativeJdkSupportPlugin

allprojects { project ->
if (['src/java', 'src/test'].any {path ->
project.file(path).exists()
}) {
plugins.apply("java-library")

plugins.apply(AlternativeJdkSupportPlugin)
plugins.apply(JavaFolderLayoutPlugin)
plugins.apply(JavacConfigurationPlugin)
plugins.apply(JarManifestConfigurationPlugin)

plugins.apply("lucene.java.tests-and-randomization")
plugins.apply(TestsAndRandomizationPlugin)
plugins.apply(TestsBeastingPlugin)
plugins.apply("lucene.java.per-project-test-summary")

plugins.apply("lucene.validation.forbidden-apis")
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import java.util.regex.Pattern
import org.apache.lucene.gradle.ErrorReportingTestListener
import org.apache.lucene.gradle.plugins.java.ErrorReportingTestListener

// Display all failed tests at the end of the build.

Expand Down
Loading
Loading