Update Gradle to 8.12 (#16884)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
Andriy Redko 2025-01-10 12:39:17 -05:00 committed by GitHub
parent f6dc4a691d
commit 9bb1fbe2d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
115 changed files with 519 additions and 350 deletions

View File

@ -127,8 +127,8 @@ subprojects {
name = 'Snapshots'
url = 'https://aws.oss.sonatype.org/content/repositories/snapshots'
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
username = "$System.env.SONATYPE_USERNAME"
password = "$System.env.SONATYPE_PASSWORD"
}
}
}
@ -420,7 +420,7 @@ allprojects {
gradle.projectsEvaluated {
allprojects {
project.tasks.withType(JavaForkOptions) {
maxHeapSize project.property('options.forkOptions.memoryMaximumSize')
maxHeapSize = project.property('options.forkOptions.memoryMaximumSize')
}
if (project.path == ':test:framework') {
@ -736,7 +736,7 @@ tasks.named(JavaBasePlugin.CHECK_TASK_NAME) {
}
tasks.register('checkCompatibility', CheckCompatibilityTask) {
description('Checks the compatibility with child components')
description = 'Checks the compatibility with child components'
}
allprojects { project ->

View File

@ -106,7 +106,7 @@ dependencies {
api "org.apache.commons:commons-compress:${props.getProperty('commonscompress')}"
api 'org.apache.ant:ant:1.10.14'
api 'com.netflix.nebula:gradle-extra-configurations-plugin:10.0.0'
api 'com.netflix.nebula:nebula-publishing-plugin:21.0.0'
api 'com.netflix.nebula:nebula-publishing-plugin:21.1.0'
api 'com.netflix.nebula:gradle-info-plugin:12.1.6'
api 'org.apache.rat:apache-rat:0.15'
api "commons-io:commons-io:${props.getProperty('commonsio')}"

View File

@ -30,6 +30,7 @@
package org.opensearch.gradle
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileTree
import org.gradle.api.file.SourceDirectorySet
@ -39,6 +40,8 @@ import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.TaskAction
import javax.inject.Inject
import java.nio.file.Files
import java.nio.file.attribute.PosixFilePermissions
@ -58,8 +61,12 @@ class NoticeTask extends DefaultTask {
/** Directories to include notices from */
private List<File> licensesDirs = new ArrayList<>()
NoticeTask() {
description = 'Create a notice file from dependencies'
private final Project project
@Inject
NoticeTask(Project project) {
this.project = project
this.description = 'Create a notice file from dependencies'
// Default licenses directory is ${projectDir}/licenses (if it exists)
File licensesDir = new File(project.projectDir, 'licenses')
if (licensesDir.exists()) {
@ -161,11 +168,12 @@ class NoticeTask extends DefaultTask {
@Optional
FileCollection getNoticeFiles() {
FileTree tree
def p = project
licensesDirs.each { dir ->
if (tree == null) {
tree = project.fileTree(dir)
tree = p.fileTree(dir)
} else {
tree += project.fileTree(dir)
tree += p.fileTree(dir)
}
}

View File

@ -160,14 +160,14 @@ class PluginBuildPlugin implements Plugin<Project> {
archiveBaseName = archiveBaseName.get() + "-client"
}
// always configure publishing for client jars
project.publishing.publications.nebula(MavenPublication).artifactId(extension.name + "-client")
project.publishing.publications.nebula(MavenPublication).artifactId = extension.name + "-client"
final BasePluginExtension base = project.getExtensions().findByType(BasePluginExtension.class)
project.tasks.withType(GenerateMavenPom.class).configureEach { GenerateMavenPom generatePOMTask ->
generatePOMTask.destination = "${project.buildDir}/distributions/${base.archivesName}-client-${project.versions.opensearch}.pom"
}
} else {
if (project.plugins.hasPlugin(MavenPublishPlugin)) {
project.publishing.publications.nebula(MavenPublication).artifactId(extension.name)
project.publishing.publications.nebula(MavenPublication).artifactId = extension.name
}
}
}

View File

@ -32,6 +32,7 @@ import org.apache.rat.anttasks.Report
import org.apache.rat.anttasks.SubstringLicenseMatcher
import org.apache.rat.license.SimpleLicenseFamily
import org.opensearch.gradle.AntTask
import org.gradle.api.Project
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
@ -41,6 +42,8 @@ import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.SkipWhenEmpty
import javax.inject.Inject
import java.nio.file.Files
/**
@ -65,14 +68,18 @@ class LicenseHeadersTask extends AntTask {
@Input
List<String> excludes = []
private final Project project
/**
* Additional license families that may be found. The key is the license category name (5 characters),
* followed by the family name and the value list of patterns to search for.
*/
protected Map<String, String> additionalLicenses = new HashMap<>()
LicenseHeadersTask() {
description = "Checks sources for missing, incorrect, or unacceptable license headers"
@Inject
LicenseHeadersTask(Project project) {
this.project = project
this.description = "Checks sources for missing, incorrect, or unacceptable license headers"
}
/**

View File

@ -30,12 +30,16 @@
package org.opensearch.gradle.test
import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.Project
import org.gradle.api.GradleException
import org.gradle.api.tasks.Exec
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskProvider
import org.opensearch.gradle.AntTask
import org.opensearch.gradle.LoggedExec
import javax.inject.Inject
/**
* A fixture for integration tests which runs in a separate process launched by Ant.
*/
@ -90,9 +94,12 @@ class AntFixture extends AntTask implements Fixture {
}
private final TaskProvider stopTask
private final Project project
AntFixture() {
stopTask = createStopTask()
@Inject
AntFixture(Project project) {
this.project = project
this.stopTask = createStopTask()
finalizedBy(stopTask)
}

View File

@ -32,6 +32,7 @@
package org.opensearch.gradle;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.TaskAction;
@ -48,6 +49,12 @@ public class EmptyDirTask extends DefaultTask {
private File dir;
private int dirMode = 0755;
private final Project project;
@Inject
public EmptyDirTask(Project project) {
this.project = project;
}
/**
* Creates an empty directory with the configured permissions.
@ -84,7 +91,7 @@ public class EmptyDirTask extends DefaultTask {
* @param dir The path of the directory to create. Takes a String and coerces it to a file.
*/
public void setDir(String dir) {
this.dir = getProject().file(dir);
this.dir = project.file(dir);
}
@Input

View File

@ -33,6 +33,7 @@ package org.opensearch.gradle;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
@ -42,6 +43,8 @@ import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.StopExecutionException;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@ -67,8 +70,9 @@ public class ExportOpenSearchBuildResourcesTask extends DefaultTask {
private DirectoryProperty outputDir;
public ExportOpenSearchBuildResourcesTask() {
outputDir = getProject().getObjects().directoryProperty();
@Inject
public ExportOpenSearchBuildResourcesTask(Project project) {
outputDir = project.getObjects().directoryProperty();
}
@OutputDirectory

View File

@ -70,6 +70,7 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
private static final Logger LOGGER = Logging.getLogger(LoggedExec.class);
private Consumer<Logger> outputLogger;
private FileSystemOperations fileSystemOperations;
private final Project project;
interface InjectedExecOps {
@Inject
@ -77,8 +78,9 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
}
@Inject
public LoggedExec(FileSystemOperations fileSystemOperations) {
public LoggedExec(FileSystemOperations fileSystemOperations, Project project) {
this.fileSystemOperations = fileSystemOperations;
this.project = project;
if (getLogger().isInfoEnabled() == false) {
setIgnoreExitValue(true);
setSpoolOutput(false);
@ -111,7 +113,7 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
public void setSpoolOutput(boolean spoolOutput) {
final OutputStream out;
if (spoolOutput) {
File spoolFile = new File(getProject().getBuildDir() + "/buffered-output/" + this.getName());
File spoolFile = new File(project.getBuildDir() + "/buffered-output/" + this.getName());
out = new LazyFileOutputStream(spoolFile);
outputLogger = logger -> {
try {

View File

@ -34,6 +34,7 @@ package org.opensearch.gradle.docker;
import org.opensearch.gradle.LoggedExec;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.file.DirectoryProperty;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.logging.Logger;
@ -60,18 +61,22 @@ public class DockerBuildTask extends DefaultTask {
private static final Logger LOGGER = Logging.getLogger(DockerBuildTask.class);
private final WorkerExecutor workerExecutor;
private final RegularFileProperty markerFile = getProject().getObjects().fileProperty();
private final DirectoryProperty dockerContext = getProject().getObjects().directoryProperty();
private final RegularFileProperty markerFile;
private final DirectoryProperty dockerContext;
private String[] tags;
private boolean pull = true;
private boolean noCache = true;
private String[] baseImages;
private final Project project;
@Inject
public DockerBuildTask(WorkerExecutor workerExecutor) {
public DockerBuildTask(WorkerExecutor workerExecutor, Project project) {
this.workerExecutor = workerExecutor;
this.markerFile.set(getProject().getLayout().getBuildDirectory().file("markers/" + this.getName() + ".marker"));
this.project = project;
this.markerFile = project.getObjects().fileProperty();
this.dockerContext = project.getObjects().directoryProperty();
this.markerFile.set(project.getLayout().getBuildDirectory().file("markers/" + this.getName() + ".marker"));
}
@TaskAction

View File

@ -36,6 +36,7 @@ import org.opensearch.gradle.precommit.LicenseAnalyzer.LicenseInfo;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
@ -48,6 +49,8 @@ import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@ -127,7 +130,7 @@ public class DependencyLicensesTask extends DefaultTask {
/**
* The directory to find the license and sha files in.
*/
private File licensesDir = new File(getProject().getProjectDir(), "licenses");
private File licensesDir;
/**
* A map of patterns to prefix, used to find the LICENSE and NOTICE file.
@ -139,6 +142,14 @@ public class DependencyLicensesTask extends DefaultTask {
*/
private Set<String> ignoreShas = new HashSet<>();
private final Project project;
@Inject
public DependencyLicensesTask(Project project) {
this.project = project;
this.licensesDir = new File(project.getProjectDir(), "licenses");
}
/**
* Add a mapping from a regex pattern for the jar name, to a prefix to find
* the LICENSE and NOTICE file for that jar.
@ -161,7 +172,7 @@ public class DependencyLicensesTask extends DefaultTask {
@InputFiles
public Property<FileCollection> getDependencies() {
if (dependenciesProvider == null) {
dependenciesProvider = getProject().getObjects().property(FileCollection.class);
dependenciesProvider = project.getObjects().property(FileCollection.class);
}
return dependenciesProvider;
}
@ -250,7 +261,7 @@ public class DependencyLicensesTask extends DefaultTask {
// by this output but when successful we can safely mark the task as up-to-date.
@OutputDirectory
public File getOutputMarker() {
return new File(getProject().getBuildDir(), "dependencyLicense");
return new File(project.getBuildDir(), "dependencyLicense");
}
private void failIfAnyMissing(String item, Boolean exists, String type) {

View File

@ -35,6 +35,7 @@ import org.apache.tools.ant.taskdefs.condition.Os;
import org.opensearch.gradle.util.GradleUtils;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTree;
import org.gradle.api.tasks.IgnoreEmptyDirectories;
@ -48,6 +49,8 @@ import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
@ -71,10 +74,14 @@ public class FilePermissionsTask extends DefaultTask {
// exclude sh files that might have the executable bit set
.exclude("**/*.sh");
private File outputMarker = new File(getProject().getBuildDir(), "markers/filePermissions");
private final File outputMarker;
private final Project project;
public FilePermissionsTask() {
@Inject
public FilePermissionsTask(Project project) {
setDescription("Checks java source files for correct file permissions");
this.project = project;
this.outputMarker = new File(project.getBuildDir(), "markers/filePermissions");
}
private static boolean isExecutableFile(File file) {
@ -98,11 +105,11 @@ public class FilePermissionsTask extends DefaultTask {
@IgnoreEmptyDirectories
@PathSensitive(PathSensitivity.RELATIVE)
public FileCollection getFiles() {
return GradleUtils.getJavaSourceSets(getProject())
return GradleUtils.getJavaSourceSets(project)
.stream()
.map(sourceSet -> sourceSet.getAllSource().matching(filesFilter))
.reduce(FileTree::plus)
.orElse(getProject().files().getAsFileTree());
.orElse(project.files().getAsFileTree());
}
@TaskAction

View File

@ -34,6 +34,7 @@ package org.opensearch.gradle.precommit;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTree;
import org.gradle.api.plugins.JavaPluginExtension;
@ -48,6 +49,8 @@ import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
@ -89,8 +92,10 @@ public class ForbiddenPatternsTask extends DefaultTask {
* The rules: a map from the rule name, to a rule regex pattern.
*/
private final Map<String, String> patterns = new HashMap<>();
private final Project project;
public ForbiddenPatternsTask() {
@Inject
public ForbiddenPatternsTask(Project project) {
setDescription("Checks source files for invalid patterns like nocommits or tabs");
getInputs().property("excludes", filesFilter.getExcludes());
getInputs().property("rules", patterns);
@ -99,6 +104,8 @@ public class ForbiddenPatternsTask extends DefaultTask {
patterns.put("nocommit", "nocommit|NOCOMMIT");
patterns.put("nocommit should be all lowercase or all uppercase", "((?i)nocommit)(?<!(nocommit|NOCOMMIT))");
patterns.put("tab", "\t");
this.project = project;
}
@InputFiles
@ -106,13 +113,13 @@ public class ForbiddenPatternsTask extends DefaultTask {
@IgnoreEmptyDirectories
@PathSensitive(PathSensitivity.RELATIVE)
public FileCollection getFiles() {
return getProject().getExtensions()
return project.getExtensions()
.getByType(JavaPluginExtension.class)
.getSourceSets()
.stream()
.map(sourceSet -> sourceSet.getAllSource().matching(filesFilter))
.reduce(FileTree::plus)
.orElse(getProject().files().getAsFileTree());
.orElse(project.files().getAsFileTree());
}
@TaskAction
@ -131,7 +138,7 @@ public class ForbiddenPatternsTask extends DefaultTask {
.boxed()
.collect(Collectors.toList());
String path = getProject().getRootProject().getProjectDir().toURI().relativize(f.toURI()).toString();
String path = project.getRootProject().getProjectDir().toURI().relativize(f.toURI()).toString();
failures.addAll(
invalidLines.stream()
.map(l -> new AbstractMap.SimpleEntry<>(l + 1, lines.get(l)))
@ -155,7 +162,7 @@ public class ForbiddenPatternsTask extends DefaultTask {
@OutputFile
public File getOutputMarker() {
return new File(getProject().getBuildDir(), "markers/" + getName());
return new File(project.getBuildDir(), "markers/" + getName());
}
@Input

View File

@ -33,11 +33,14 @@
package org.opensearch.gradle.precommit;
import org.opensearch.gradle.LoggedExec;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.CompileClasspath;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.File;
/**
@ -47,14 +50,18 @@ import java.io.File;
public class JarHellTask extends PrecommitTask {
private FileCollection classpath;
private final Project project;
public JarHellTask() {
@Inject
public JarHellTask(Project project) {
super(project);
setDescription("Runs CheckJarHell on the configured classpath");
this.project = project;
}
@TaskAction
public void runJarHellCheck() {
LoggedExec.javaexec(getProject(), spec -> {
LoggedExec.javaexec(project, spec -> {
spec.environment("CLASSPATH", getClasspath().getAsPath());
spec.getMainClass().set("org.opensearch.bootstrap.JarHell");
});

View File

@ -33,6 +33,7 @@
package org.opensearch.gradle.precommit;
import org.opensearch.gradle.LoggedExec;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.CacheableTask;
@ -45,6 +46,8 @@ import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.File;
/**
@ -54,14 +57,18 @@ import java.io.File;
public class LoggerUsageTask extends PrecommitTask {
private FileCollection classpath;
private final Project project;
public LoggerUsageTask() {
@Inject
public LoggerUsageTask(Project project) {
super(project);
setDescription("Runs LoggerUsageCheck on output directories of all source sets");
this.project = project;
}
@TaskAction
public void runLoggerUsageTask() {
LoggedExec.javaexec(getProject(), spec -> {
LoggedExec.javaexec(project, spec -> {
spec.getMainClass().set("org.opensearch.test.loggerusage.OpenSearchLoggerUsageChecker");
spec.classpath(getClasspath());
getClassDirectories().forEach(spec::args);
@ -82,7 +89,7 @@ public class LoggerUsageTask extends PrecommitTask {
@SkipWhenEmpty
@IgnoreEmptyDirectories
public FileCollection getClassDirectories() {
return getProject().getExtensions()
return project.getExtensions()
.getByType(JavaPluginExtension.class)
.getSourceSets()
.stream()
@ -93,7 +100,7 @@ public class LoggerUsageTask extends PrecommitTask {
)
.map(sourceSet -> sourceSet.getOutput().getClassesDirs())
.reduce(FileCollection::plus)
.orElse(getProject().files())
.orElse(project.files())
.filter(File::exists);
}

View File

@ -35,10 +35,13 @@ package org.opensearch.gradle.precommit;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.FileReader;
import java.util.Collection;
import java.util.function.Consumer;
@ -46,10 +49,16 @@ import java.util.function.Predicate;
public class PomValidationTask extends PrecommitTask {
private final RegularFileProperty pomFile = getProject().getObjects().fileProperty();
private final RegularFileProperty pomFile;
private boolean foundError;
@Inject
public PomValidationTask(Project project) {
super(project);
this.pomFile = project.getObjects().fileProperty();
}
@InputFile
public RegularFileProperty getPomFile() {
return pomFile;

View File

@ -32,19 +32,28 @@
package org.opensearch.gradle.precommit;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
public class PrecommitTask extends DefaultTask {
private final Project project;
@Inject
public PrecommitTask(Project project) {
this.project = project;
}
@OutputFile
public File getSuccessMarker() {
return new File(getProject().getBuildDir(), "markers/" + this.getName());
return new File(project.getBuildDir(), "markers/" + this.getName());
}
@TaskAction

View File

@ -38,6 +38,7 @@ import org.opensearch.gradle.util.GradleUtils;
import org.opensearch.gradle.util.Util;
import org.gradle.api.DefaultTask;
import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTree;
@ -85,12 +86,15 @@ public class TestingConventionsTasks extends DefaultTask {
private Map<String, File> testClassNames;
private final NamedDomainObjectContainer<TestingConventionRule> naming;
private final Project project;
public TestingConventionsTasks() {
@Inject
public TestingConventionsTasks(Project project) {
setDescription("Tests various testing conventions");
// Run only after everything is compiled
GradleUtils.getJavaSourceSets(getProject()).all(sourceSet -> dependsOn(sourceSet.getOutput().getClassesDirs()));
naming = getProject().container(TestingConventionRule.class);
GradleUtils.getJavaSourceSets(project).all(sourceSet -> dependsOn(sourceSet.getOutput().getClassesDirs()));
this.naming = project.container(TestingConventionRule.class);
this.project = project;
}
@Inject
@ -100,38 +104,34 @@ public class TestingConventionsTasks extends DefaultTask {
@Input
public Map<String, Set<File>> getClassFilesPerEnabledTask() {
return getProject().getTasks()
.withType(Test.class)
.stream()
.filter(Task::getEnabled)
.collect(Collectors.toMap(Task::getPath, task -> {
// See please https://docs.gradle.org/8.1/userguide/upgrading_version_8.html#test_task_default_classpath
final JvmTestSuite jvmTestSuite = JvmTestSuiteHelper.getDefaultTestSuite(getProject()).orElse(null);
if (jvmTestSuite != null) {
final PatternFilterable patternSet = getPatternSetFactory().create()
.include(task.getIncludes())
.exclude(task.getExcludes());
return project.getTasks().withType(Test.class).stream().filter(Task::getEnabled).collect(Collectors.toMap(Task::getPath, task -> {
// See please https://docs.gradle.org/8.1/userguide/upgrading_version_8.html#test_task_default_classpath
final JvmTestSuite jvmTestSuite = JvmTestSuiteHelper.getDefaultTestSuite(project).orElse(null);
if (jvmTestSuite != null) {
final PatternFilterable patternSet = getPatternSetFactory().create()
.include(task.getIncludes())
.exclude(task.getExcludes());
final Set<File> files = jvmTestSuite.getSources()
.getOutput()
.getClassesDirs()
.getAsFileTree()
.matching(patternSet)
.getFiles();
final Set<File> files = jvmTestSuite.getSources()
.getOutput()
.getClassesDirs()
.getAsFileTree()
.matching(patternSet)
.getFiles();
if (!files.isEmpty()) {
return files;
}
if (!files.isEmpty()) {
return files;
}
}
return task.getCandidateClassFiles().getFiles();
}));
return task.getCandidateClassFiles().getFiles();
}));
}
@Input
public Map<String, File> getTestClassNames() {
if (testClassNames == null) {
testClassNames = Util.getJavaTestSourceSet(getProject())
testClassNames = Util.getJavaTestSourceSet(project)
.get()
.getOutput()
.getClassesDirs()
@ -151,7 +151,7 @@ public class TestingConventionsTasks extends DefaultTask {
@OutputFile
public File getSuccessMarker() {
return new File(getProject().getBuildDir(), "markers/" + getName());
return new File(project.getBuildDir(), "markers/" + getName());
}
public void naming(Closure<?> action) {
@ -160,7 +160,7 @@ public class TestingConventionsTasks extends DefaultTask {
@Input
public Set<String> getMainClassNamedLikeTests() {
SourceSetContainer javaSourceSets = GradleUtils.getJavaSourceSets(getProject());
SourceSetContainer javaSourceSets = GradleUtils.getJavaSourceSets(project);
if (javaSourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME) == null) {
// some test projects don't have a main source set
return Collections.emptySet();
@ -195,7 +195,7 @@ public class TestingConventionsTasks extends DefaultTask {
.stream()
.collect(Collectors.toMap(Map.Entry::getValue, entry -> loadClassWithoutInitializing(entry.getKey(), isolatedClassLoader)));
final FileTree allTestClassFiles = getProject().files(
final FileTree allTestClassFiles = project.files(
classes.values()
.stream()
.filter(isStaticClass.negate())
@ -207,7 +207,7 @@ public class TestingConventionsTasks extends DefaultTask {
final Map<String, Set<File>> classFilesPerTask = getClassFilesPerEnabledTask();
final Set<File> testSourceSetFiles = Util.getJavaTestSourceSet(getProject()).get().getRuntimeClasspath().getFiles();
final Set<File> testSourceSetFiles = Util.getJavaTestSourceSet(project).get().getRuntimeClasspath().getFiles();
final Map<String, Set<Class<?>>> testClassesPerTask = classFilesPerTask.entrySet()
.stream()
.filter(entry -> testSourceSetFiles.containsAll(entry.getValue()))
@ -398,7 +398,7 @@ public class TestingConventionsTasks extends DefaultTask {
@Classpath
public FileCollection getTestsClassPath() {
return Util.getJavaTestSourceSet(getProject()).get().getRuntimeClasspath();
return Util.getJavaTestSourceSet(project).get().getRuntimeClasspath();
}
private Map<String, File> walkPathAndLoadClasses(File testRoot) {

View File

@ -40,6 +40,7 @@ import org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin;
import org.opensearch.gradle.util.GradleUtils;
import org.gradle.api.DefaultTask;
import org.gradle.api.JavaVersion;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.file.FileCollection;
@ -107,7 +108,15 @@ public class ThirdPartyAuditTask extends DefaultTask {
private FileCollection jdkJarHellClasspath;
private final Property<JavaVersion> targetCompatibility = getProject().getObjects().property(JavaVersion.class);
private final Project project;
private final Property<JavaVersion> targetCompatibility;
@Inject
public ThirdPartyAuditTask(Project project) {
this.project = project;
this.targetCompatibility = project.getObjects().property(JavaVersion.class);
}
public boolean jarHellEnabled = true;
@ -124,7 +133,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
@InputFiles
@PathSensitive(PathSensitivity.NAME_ONLY)
public Configuration getForbiddenAPIsConfiguration() {
return getProject().getConfigurations().getByName("forbiddenApisCliJar");
return project.getConfigurations().getByName("forbiddenApisCliJar");
}
@InputFile
@ -149,12 +158,12 @@ public class ThirdPartyAuditTask extends DefaultTask {
@Internal
public File getJarExpandDir() {
return new File(new File(getProject().getBuildDir(), "precommit/thirdPartyAudit"), getName());
return new File(new File(project.getBuildDir(), "precommit/thirdPartyAudit"), getName());
}
@OutputFile
public File getSuccessMarker() {
return new File(getProject().getBuildDir(), "markers/" + getName());
return new File(project.getBuildDir(), "markers/" + getName());
}
// We use compile classpath normalization here because class implementation changes are irrelevant for the purposes of jdk jar hell.
@ -213,10 +222,10 @@ public class ThirdPartyAuditTask extends DefaultTask {
// err on the side of scanning these to make sure we don't miss anything
Spec<Dependency> reallyThirdParty = dep -> dep.getGroup() != null && dep.getGroup().startsWith("org.opensearch") == false;
Set<File> jars = GradleUtils.getFiles(getProject(), getRuntimeConfiguration(), reallyThirdParty).getFiles();
Set<File> jars = GradleUtils.getFiles(project, getRuntimeConfiguration(), reallyThirdParty).getFiles();
Set<File> compileOnlyConfiguration = GradleUtils.getFiles(
getProject(),
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME),
project,
project.getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME),
reallyThirdParty
).getFiles();
// don't scan provided dependencies that we already scanned, e.x. don't scan cores dependencies for every plugin
@ -310,14 +319,14 @@ public class ThirdPartyAuditTask extends DefaultTask {
Set<File> extractedJars = new TreeSet<>();
File jarExpandDir = getJarExpandDir();
// We need to clean up to make sure old dependencies don't linger
getProject().delete(jarExpandDir);
project.delete(jarExpandDir);
jars.forEach(jar -> {
String jarPrefix = jar.getName().replace(".jar", "");
File jarSubDir = new File(jarExpandDir, jarPrefix);
extractedJars.add(jarSubDir);
FileTree jarFiles = getProject().zipTree(jar);
getProject().copy(spec -> {
FileTree jarFiles = project.zipTree(jar);
project.copy(spec -> {
spec.from(jarFiles);
spec.into(jarSubDir);
// exclude classes from multi release jars
@ -336,8 +345,8 @@ public class ThirdPartyAuditTask extends DefaultTask {
IntStream.rangeClosed(
Integer.parseInt(JavaVersion.VERSION_1_9.getMajorVersion()),
Integer.parseInt(targetCompatibility.get().getMajorVersion())
).forEach(majorVersion -> getProject().copy(spec -> {
spec.from(getProject().zipTree(jar));
).forEach(majorVersion -> project.copy(spec -> {
spec.from(project.zipTree(jar));
spec.into(jarSubDir);
String metaInfPrefix = "META-INF/versions/" + majorVersion;
spec.include(metaInfPrefix + "/**");
@ -376,7 +385,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
private String runForbiddenAPIsCli() throws IOException {
ByteArrayOutputStream errorOut = new ByteArrayOutputStream();
InjectedExecOps execOps = getProject().getObjects().newInstance(InjectedExecOps.class);
InjectedExecOps execOps = project.getObjects().newInstance(InjectedExecOps.class);
ExecResult result = execOps.getExecOps().javaexec(spec -> {
if (javaHome != null) {
spec.setExecutable(javaHome + "/bin/java");
@ -384,7 +393,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
spec.classpath(
getForbiddenAPIsConfiguration(),
getRuntimeConfiguration(),
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
project.getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
);
spec.jvmArgs("-Xmx1g");
spec.jvmArgs(LoggedExec.shortLivedArgs());
@ -416,12 +425,12 @@ public class ThirdPartyAuditTask extends DefaultTask {
*/
private Set<String> runJdkJarHellCheck(Set<File> jars) throws IOException {
ByteArrayOutputStream standardOut = new ByteArrayOutputStream();
InjectedExecOps execOps = getProject().getObjects().newInstance(InjectedExecOps.class);
InjectedExecOps execOps = project.getObjects().newInstance(InjectedExecOps.class);
ExecResult execResult = execOps.getExecOps().javaexec(spec -> {
spec.classpath(
jdkJarHellClasspath,
getRuntimeConfiguration(),
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
project.getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
);
spec.getMainClass().set(JDK_JAR_HELL_MAIN_CLASS);
spec.args(jars);
@ -442,9 +451,9 @@ public class ThirdPartyAuditTask extends DefaultTask {
}
private Configuration getRuntimeConfiguration() {
Configuration runtime = getProject().getConfigurations().findByName("runtimeClasspath");
Configuration runtime = project.getConfigurations().findByName("runtimeClasspath");
if (runtime == null) {
return getProject().getConfigurations().getByName("testCompileClasspath");
return project.getConfigurations().getByName("testCompileClasspath");
}
return runtime;
}

View File

@ -192,6 +192,10 @@ public class ErrorReportingTestListener implements TestOutputListener, TestListe
public String getMessage() {
return message;
}
public long getLogTime() {
return System.currentTimeMillis();
}
});
}
}

View File

@ -34,9 +34,12 @@ package org.opensearch.gradle.test;
import org.opensearch.gradle.vagrant.VagrantMachine;
import org.opensearch.gradle.vagrant.VagrantShellTask;
import org.gradle.api.Project;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.options.Option;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -49,6 +52,13 @@ public class GradleDistroTestTask extends VagrantShellTask {
private String taskName;
private String testClass;
private List<String> extraArgs = new ArrayList<>();
private final Project project;
@Inject
public GradleDistroTestTask(Project project) {
super(project);
this.project = project;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
@ -84,17 +94,15 @@ public class GradleDistroTestTask extends VagrantShellTask {
}
private List<String> getScript(boolean isWindows) {
String cacheDir = getProject().getBuildDir() + "/gradle-cache";
String cacheDir = project.getBuildDir() + "/gradle-cache";
StringBuilder line = new StringBuilder();
line.append(isWindows ? "& .\\gradlew " : "./gradlew ");
line.append(taskName);
line.append(" --project-cache-dir ");
line.append(
isWindows ? VagrantMachine.convertWindowsPath(getProject(), cacheDir) : VagrantMachine.convertLinuxPath(getProject(), cacheDir)
);
line.append(isWindows ? VagrantMachine.convertWindowsPath(project, cacheDir) : VagrantMachine.convertLinuxPath(project, cacheDir));
line.append(" -S");
line.append(" --parallel");
line.append(" -D'org.gradle.logging.level'=" + getProject().getGradle().getStartParameter().getLogLevel());
line.append(" -D'org.gradle.logging.level'=" + project.getGradle().getStartParameter().getLogLevel());
if (testClass != null) {
line.append(" --tests=");
line.append(testClass);

View File

@ -35,9 +35,12 @@ package org.opensearch.gradle.test;
import groovy.lang.Closure;
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.tasks.CacheableTask;
import javax.inject.Inject;
/**
* Sub typed version of {@link StandaloneRestIntegTestTask} that is used to differentiate between plain standalone
* integ test tasks based on {@link StandaloneRestIntegTestTask} and
@ -45,11 +48,19 @@ import org.gradle.api.tasks.CacheableTask;
*/
@CacheableTask
public abstract class RestIntegTestTask extends StandaloneRestIntegTestTask implements TestSuiteConventionMappings {
private final Project project;
@Inject
public RestIntegTestTask(Project project) {
super(project);
this.project = project;
}
@SuppressWarnings("rawtypes")
@Override
public Task configure(Closure closure) {
final Task t = super.configure(closure);
applyConventionMapping(getProject(), getConventionMapping());
applyConventionMapping(project, getConventionMapping());
return t;
}
}

View File

@ -55,7 +55,7 @@ public class RestTestBasePlugin implements Plugin<Project> {
.getExtensions()
.getByName(TestClustersPlugin.EXTENSION_NAME);
OpenSearchCluster cluster = testClusters.maybeCreate(restIntegTestTask.getName());
restIntegTestTask.useCluster(cluster);
restIntegTestTask.useCluster(project, cluster);
restIntegTestTask.include("**/*IT.class");
restIntegTestTask.systemProperty("tests.rest.load_packaged", Boolean.FALSE.toString());
if (System.getProperty(TESTS_REST_CLUSTER) == null) {

View File

@ -10,17 +10,27 @@ package org.opensearch.gradle.test;
import groovy.lang.Closure;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.testing.Test;
import javax.inject.Inject;
@CacheableTask
public abstract class TestTask extends Test implements TestSuiteConventionMappings {
private final Project project;
@Inject
public TestTask(Project project) {
this.project = project;
}
@SuppressWarnings("rawtypes")
@Override
public Task configure(Closure closure) {
final Task t = super.configure(closure);
applyConventionMapping(getProject(), getConventionMapping());
applyConventionMapping(project, getConventionMapping());
return t;
}
}

View File

@ -74,16 +74,20 @@ import java.util.stream.Collectors;
*/
public class CopyRestApiTask extends DefaultTask {
private static final String REST_API_PREFIX = "rest-api-spec/api";
final ListProperty<String> includeCore = getProject().getObjects().listProperty(String.class);
final ListProperty<String> includeCore;
String sourceSetName;
boolean skipHasRestTestCheck;
Configuration coreConfig;
Configuration additionalConfig;
private final Project project;
private final PatternFilterable corePatternSet;
public CopyRestApiTask() {
corePatternSet = getPatternSetFactory().create();
@Inject
public CopyRestApiTask(Project project) {
this.project = project;
this.corePatternSet = getPatternSetFactory().create();
this.includeCore = project.getObjects().listProperty(String.class);
}
@Inject
@ -133,8 +137,8 @@ public class CopyRestApiTask extends DefaultTask {
}
ConfigurableFileCollection fileCollection = additionalConfig == null
? getProject().files(coreFileTree)
: getProject().files(coreFileTree, additionalConfig.getAsFileTree());
? project.files(coreFileTree)
: project.files(coreFileTree, additionalConfig.getAsFileTree());
// if project has rest tests or the includes are explicitly configured execute the task, else NO-SOURCE due to the null input
return projectHasYamlRestTests || includeCore.get().isEmpty() == false ? fileCollection.getAsFileTree() : null;
@ -210,7 +214,7 @@ public class CopyRestApiTask extends DefaultTask {
.anyMatch(p -> p.getFileName().toString().endsWith("yml"));
}
} catch (IOException e) {
throw new IllegalStateException(String.format("Error determining if this project [%s] has rest tests.", getProject()), e);
throw new IllegalStateException(String.format("Error determining if this project [%s] has rest tests.", project), e);
}
return false;
}
@ -240,7 +244,6 @@ public class CopyRestApiTask extends DefaultTask {
}
private Optional<SourceSet> getSourceSet() {
Project project = getProject();
return project.getExtensions().findByType(JavaPluginExtension.class) == null
? Optional.empty()
: Optional.ofNullable(GradleUtils.getJavaSourceSets(project).findByName(getSourceSetName()));

View File

@ -71,16 +71,20 @@ import java.util.stream.Collectors;
*/
public class CopyRestTestsTask extends DefaultTask {
private static final String REST_TEST_PREFIX = "rest-api-spec/test";
final ListProperty<String> includeCore = getProject().getObjects().listProperty(String.class);
final ListProperty<String> includeCore;
String sourceSetName;
Configuration coreConfig;
Configuration additionalConfig;
private final Project project;
private final PatternFilterable corePatternSet;
public CopyRestTestsTask() {
corePatternSet = getPatternSetFactory().create();
@Inject
public CopyRestTestsTask(Project project) {
this.project = project;
this.corePatternSet = getPatternSetFactory().create();
this.includeCore = project.getObjects().listProperty(String.class);
}
@Inject
@ -123,8 +127,8 @@ public class CopyRestTestsTask extends DefaultTask {
}
}
ConfigurableFileCollection fileCollection = additionalConfig == null
? getProject().files(coreFileTree)
: getProject().files(coreFileTree, additionalConfig.getAsFileTree());
? project.files(coreFileTree)
: project.files(coreFileTree, additionalConfig.getAsFileTree());
// copy tests only if explicitly requested
return includeCore.get().isEmpty() == false || additionalConfig != null ? fileCollection.getAsFileTree() : null;
@ -178,7 +182,6 @@ public class CopyRestTestsTask extends DefaultTask {
}
private Optional<SourceSet> getSourceSet() {
Project project = getProject();
return project.getExtensions().findByType(JavaPluginExtension.class) == null
? Optional.empty()
: Optional.ofNullable(GradleUtils.getJavaSourceSets(project).findByName(getSourceSetName()));

View File

@ -36,6 +36,7 @@ import groovy.lang.Closure;
import org.opensearch.gradle.FileSystemOperationsAware;
import org.opensearch.gradle.test.Fixture;
import org.opensearch.gradle.util.GradleUtils;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.provider.Provider;
import org.gradle.api.services.internal.BuildServiceProvider;
@ -48,6 +49,8 @@ import org.gradle.api.tasks.testing.Test;
import org.gradle.internal.resources.ResourceLock;
import org.gradle.internal.resources.SharedResource;
import javax.inject.Inject;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.ArrayList;
@ -67,7 +70,8 @@ public abstract class StandaloneRestIntegTestTask extends Test implements TestCl
private Collection<OpenSearchCluster> clusters = new HashSet<>();
private Closure<Void> beforeStart;
public StandaloneRestIntegTestTask() {
@Inject
public StandaloneRestIntegTestTask(Project project) {
this.getOutputs()
.doNotCacheIf(
"Caching disabled for this task since it uses a cluster shared by other tasks",
@ -77,7 +81,7 @@ public abstract class StandaloneRestIntegTestTask extends Test implements TestCl
* avoid any undesired behavior we simply disable the cache if we detect that this task uses a cluster shared between
* multiple tasks.
*/
t -> getProject().getTasks()
t -> project.getTasks()
.withType(StandaloneRestIntegTestTask.class)
.stream()
.filter(task -> task != this)

View File

@ -31,6 +31,7 @@
package org.opensearch.gradle.testclusters;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.tasks.Nested;
@ -43,8 +44,13 @@ public interface TestClustersAware extends Task {
@Nested
Collection<OpenSearchCluster> getClusters();
@Deprecated(forRemoval = true)
default void useCluster(OpenSearchCluster cluster) {
if (cluster.getPath().equals(getProject().getPath()) == false) {
useCluster(getProject(), cluster);
}
default void useCluster(Project project, OpenSearchCluster cluster) {
if (cluster.getPath().equals(project.getPath()) == false) {
throw new TestClustersException("Task " + getPath() + " can't use test cluster from" + " another project " + cluster);
}

View File

@ -249,7 +249,7 @@ public class TestFixturesPlugin implements Plugin<Project> {
task.doFirst(new Action<Task>() {
@Override
public void execute(Task theTask) {
TestFixtureExtension extension = theTask.getProject().getExtensions().getByType(TestFixtureExtension.class);
TestFixtureExtension extension = fixtureProject.getExtensions().getByType(TestFixtureExtension.class);
fixtureProject.getExtensions()
.getByType(ComposeExtension.class)

View File

@ -33,9 +33,12 @@
package org.opensearch.gradle.vagrant;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.TaskAction;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -55,13 +58,16 @@ public abstract class VagrantShellTask extends DefaultTask {
private final VagrantExtension extension;
private final VagrantMachine service;
private UnaryOperator<String> progressHandler = UnaryOperator.identity();
private final Project project;
public VagrantShellTask() {
extension = getProject().getExtensions().findByType(VagrantExtension.class);
if (extension == null) {
@Inject
public VagrantShellTask(Project project) {
this.project = project;
this.extension = project.getExtensions().findByType(VagrantExtension.class);
if (this.extension == null) {
throw new IllegalStateException("opensearch.vagrant-base must be applied to create " + getClass().getName());
}
service = getProject().getExtensions().getByType(VagrantMachine.class);
this.service = project.getExtensions().getByType(VagrantMachine.class);
}
@Input
@ -81,14 +87,14 @@ public abstract class VagrantShellTask extends DefaultTask {
@TaskAction
public void runScript() {
String rootDir = getProject().getRootDir().toString();
String rootDir = project.getRootDir().toString();
if (extension.isWindowsVM()) {
service.execute(spec -> {
spec.setCommand("winrm");
List<String> script = new ArrayList<>();
script.add("try {");
script.add("cd " + convertWindowsPath(getProject(), rootDir));
script.add("cd " + convertWindowsPath(project, rootDir));
extension.getVmEnv().forEach((k, v) -> script.add("$Env:" + k + " = \"" + v + "\""));
script.addAll(getWindowsScript().stream().map(s -> " " + s).collect(Collectors.toList()));
script.addAll(
@ -111,7 +117,7 @@ public abstract class VagrantShellTask extends DefaultTask {
List<String> script = new ArrayList<>();
script.add("sudo bash -c '"); // start inline bash script
script.add("pwd");
script.add("cd " + convertLinuxPath(getProject(), rootDir));
script.add("cd " + convertLinuxPath(project, rootDir));
extension.getVmEnv().forEach((k, v) -> script.add("export " + k + "=" + v));
script.addAll(getLinuxScript());
script.add("'"); // end inline bash script

View File

@ -33,9 +33,9 @@ group = 'org.opensearch.plugin'
apply plugin: 'opensearch.opensearchplugin'
opensearchplugin {
name 'client-benchmark-noop-api'
description 'Stubbed out OpenSearch actions that can be used for client-side benchmarking'
classname 'org.opensearch.plugin.noop.NoopPlugin'
name = 'client-benchmark-noop-api'
description = 'Stubbed out OpenSearch actions that can be used for client-side benchmarking'
classname = 'org.opensearch.plugin.noop.NoopPlugin'
}
// Not published so no need to assemble

View File

@ -150,7 +150,7 @@ void copyModule(TaskProvider<Sync> copyTask, Project module) {
dependsOn moduleConfig
from({ zipTree(moduleConfig.singleFile) }) {
includeEmptyDirs false
includeEmptyDirs = false
// these are handled separately in the log4j config tasks below
exclude '*/config/log4j2.properties'

View File

@ -178,7 +178,7 @@ tasks.named("preProcessFixture").configure {
}
doLast {
// tests expect to have an empty repo
project.delete(
delete(
"${buildDir}/repo"
)
createAndSetWritable(
@ -273,8 +273,8 @@ subprojects { Project subProject ->
}
artifacts.add('default', file(tarFile)) {
type 'tar'
name artifactName
type = 'tar'
name = artifactName
builtBy exportTaskName
}

View File

@ -111,21 +111,21 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
OS.current().equals(OS.WINDOWS) == false
}
dependsOn "process'${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
packageName "opensearch"
packageName = "opensearch"
if (type == 'deb') {
if (architecture == 'x64') {
arch('amd64')
arch = 'amd64'
} else {
assert architecture == 'arm64' : architecture
arch('arm64')
arch = 'arm64'
}
} else {
assert type == 'rpm' : type
if (architecture == 'x64') {
arch('x86_64')
arch = 'x86_64'
} else {
assert architecture == 'arm64' : architecture
arch('aarch64')
arch = 'aarch64'
}
}
// Follow opensearch's file naming convention
@ -224,8 +224,8 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
}
into('/etc')
permissionGroup 'opensearch'
includeEmptyDirs true
createDirectoryEntry true
includeEmptyDirs = true
createDirectoryEntry = true
include("opensearch") // empty dir, just to add directory entry
include("opensearch/jvm.options.d") // empty dir, just to add directory entry
}
@ -238,8 +238,8 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
unix 0660
}
permissionGroup 'opensearch'
includeEmptyDirs true
createDirectoryEntry true
includeEmptyDirs = true
createDirectoryEntry = true
fileType CONFIG | NOREPLACE
}
String envFile = expansionsForDistribution(type, jdk)['path.env']
@ -298,8 +298,8 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
into(file.parent) {
from "${packagingFiles}/${file.parent}"
include file.name
includeEmptyDirs true
createDirectoryEntry true
includeEmptyDirs = true
createDirectoryEntry = true
user u
permissionGroup g
dirPermissions {
@ -320,13 +320,13 @@ apply plugin: 'com.netflix.nebula.ospackage-base'
// this is package indepdendent configuration
ospackage {
maintainer 'OpenSearch Team <opensearch@amazon.com>'
summary 'Distributed RESTful search engine built for the cloud'
packageDescription '''
maintainer ='OpenSearch Team <opensearch@amazon.com>'
summary = 'Distributed RESTful search engine built for the cloud'
packageDescription = '''
Reference documentation can be found at
https://github.com/opensearch-project/OpenSearch
'''.stripIndent().trim()
url 'https://github.com/opensearch-project/OpenSearch'
url = 'https://github.com/opensearch-project/OpenSearch'
// signing setup
if (project.hasProperty('signing.password') && BuildParams.isSnapshotBuild() == false) {
@ -340,10 +340,10 @@ ospackage {
// version found on oldest supported distro, centos-6
requires('coreutils', '8.4', GREATER | EQUAL)
fileMode 0644
dirMode 0755
user 'root'
permissionGroup 'root'
fileMode = 0644
dirMode = 0755
user = 'root'
permissionGroup = 'root'
into '/usr/share/opensearch'
}
@ -357,7 +357,7 @@ Closure commonDebConfig(boolean jdk, String architecture) {
customFields['License'] = 'ASL-2.0'
archiveVersion = project.version.replace('-', '~')
packageGroup 'web'
packageGroup = 'web'
// versions found on oldest supported distro, centos-6
requires('bash', '4.1', GREATER | EQUAL)
@ -394,24 +394,24 @@ Closure commonRpmConfig(boolean jdk, String architecture) {
return {
configure(commonPackageConfig('rpm', jdk, architecture))
license 'ASL-2.0'
license = 'ASL-2.0'
packageGroup 'Application/Internet'
packageGroup = 'Application/Internet'
requires '/bin/bash'
obsoletes packageName, '7.0.0', Flags.LESS
prefix '/usr'
packager 'OpenSearch'
packager = 'OpenSearch'
archiveVersion = project.version.replace('-', '_')
release = '1'
os 'LINUX'
distribution 'OpenSearch'
vendor 'OpenSearch'
os = 'LINUX'
distribution = 'OpenSearch'
vendor = 'OpenSearch'
// TODO ospackage doesn't support icon but we used to have one
// without this the rpm will have parent dirs of any files we copy in, eg /etc/opensearch
addParentDirs false
addParentDirs = false
}
}

View File

@ -3,8 +3,8 @@ plugins {
}
base {
group 'org.opensearch'
version '1.0.0-SNAPSHOT'
group = 'org.opensearch'
version = '1.0.0-SNAPSHOT'
}
repositories {

View File

@ -2,8 +2,8 @@ plugins {
id 'java-library'
}
group 'org.opensearch'
version '1.0.0-SNAPSHOT'
group = 'org.opensearch'
version = '1.0.0-SNAPSHOT'
tasks.withType(JavaCompile) {
options.compilerArgs += ["--release", targetCompatibility.toString()]

View File

@ -16,7 +16,7 @@ import org.jetbrains.gradle.ext.JUnit
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
url = "https://plugins.gradle.org/m2/"
}
}
dependencies {

View File

@ -64,8 +64,8 @@ allprojects {
tasks.register('missingJavadoc', MissingJavadocTask) {
description "This task validates and generates Javadoc API documentation for the main source code."
group "documentation"
description = "This task validates and generates Javadoc API documentation for the main source code."
group = "documentation"
taskResources = resources
dependsOn sourceSets.main.compileClasspath
@ -227,11 +227,18 @@ class MissingJavadocTask extends DefaultTask {
@PathSensitive(PathSensitivity.RELATIVE)
def taskResources
Project project
// See please https://docs.gradle.org/8.11/userguide/service_injection.html#execoperations
interface InjectedExecOps {
@Inject ExecOperations getExecOps()
}
@Inject
MissingJavadocTask(Project project) {
this.project = project
}
/** Utility method to recursively collect all tasks with same name like this one that we depend on */
private Set findRenderTasksInDependencies() {
Set found = []
@ -350,7 +357,7 @@ class MissingJavadocTask extends DefaultTask {
// force locale to be "en_US" (fix for: https://bugs.openjdk.java.net/browse/JDK-8222793)
args += [ "-J-Duser.language=en", "-J-Duser.country=US" ]
ignoreExitValue true
ignoreExitValue = true
}
}

View File

@ -11,7 +11,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=89d4e70e4e84e2d2dfbb63e4daa53e21b25017cc70c37e4eea31ee51fb15098a
distributionSha256Sum=7ebdac923867a3cec0098302416d1e3c6c0c729fc4e2e05c10637a8af33a76c5

View File

@ -92,7 +92,7 @@ if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
}
tasks.register('roundableSimdTest', Test) {
group 'verification'
group = 'verification'
include '**/RoundableTests.class'
systemProperty 'opensearch.experimental.feature.simd.rounding.enabled', 'forced'
}

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'Adds aggregations whose input are a list of numeric fields and output includes a matrix.'
classname 'org.opensearch.search.aggregations.matrix.MatrixAggregationModulePlugin'
description = 'Adds aggregations whose input are a list of numeric fields and output includes a matrix.'
classname = 'org.opensearch.search.aggregations.matrix.MatrixAggregationModulePlugin'
hasClientJar = true
}

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Adds "built in" analyzers to OpenSearch.'
classname 'org.opensearch.analysis.common.CommonAnalysisModulePlugin'
description = 'Adds "built in" analyzers to OpenSearch.'
classname = 'org.opensearch.analysis.common.CommonAnalysisModulePlugin'
extendedPlugins = ['lang-painless']
}

View File

@ -35,7 +35,7 @@ configure(subprojects.findAll { it.parent.path == project.path }) {
opensearchplugin {
// for local OpenSearch plugins, the name of the plugin is the same as the directory
name project.name
name = project.name
}
if (project.file('src/main/packaging').exists()) {

View File

@ -9,8 +9,8 @@
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Module for caches which are optional and do not require additional security permission'
classname 'org.opensearch.cache.common.tier.TieredSpilloverCachePlugin'
description = 'Module for caches which are optional and do not require additional security permission'
classname = 'org.opensearch.cache.common.tier.TieredSpilloverCachePlugin'
}
test {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Plugin for geospatial features in OpenSearch. Registering the geo_shape and aggregations on GeoShape and GeoPoint'
classname 'org.opensearch.geo.GeoModulePlugin'
description = 'Plugin for geospatial features in OpenSearch. Registering the geo_shape and aggregations on GeoShape and GeoPoint'
classname = 'org.opensearch.geo.GeoModulePlugin'
}
restResources {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Module for ingest processors that do not require additional security permissions or have large dependencies and resources'
classname 'org.opensearch.ingest.common.IngestCommonModulePlugin'
description = 'Module for ingest processors that do not require additional security permissions or have large dependencies and resources'
classname = 'org.opensearch.ingest.common.IngestCommonModulePlugin'
extendedPlugins = ['lang-painless']
}

View File

@ -34,8 +34,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Ingest processor that uses looksup geo data based on ip adresses using the Maxmind geo database'
classname 'org.opensearch.ingest.geoip.IngestGeoIpModulePlugin'
description = 'Ingest processor that uses looksup geo data based on ip adresses using the Maxmind geo database'
classname = 'org.opensearch.ingest.geoip.IngestGeoIpModulePlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'Ingest processor that extracts information from a user agent'
classname 'org.opensearch.ingest.useragent.IngestUserAgentModulePlugin'
description = 'Ingest processor that extracts information from a user agent'
classname = 'org.opensearch.ingest.useragent.IngestUserAgentModulePlugin'
}
restResources {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Lucene expressions integration for OpenSearch'
classname 'org.opensearch.script.expression.ExpressionModulePlugin'
description = 'Lucene expressions integration for OpenSearch'
classname = 'org.opensearch.script.expression.ExpressionModulePlugin'
}
dependencies {

View File

@ -32,8 +32,8 @@ apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Mustache scripting integration for OpenSearch'
classname 'org.opensearch.script.mustache.MustacheModulePlugin'
description = 'Mustache scripting integration for OpenSearch'
classname = 'org.opensearch.script.mustache.MustacheModulePlugin'
hasClientJar = true // For the template apis and query
}

View File

@ -36,8 +36,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'An easy, safe and fast scripting language for OpenSearch'
classname 'org.opensearch.painless.PainlessModulePlugin'
description = 'An easy, safe and fast scripting language for OpenSearch'
classname = 'org.opensearch.painless.PainlessModulePlugin'
}
ext {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.java-rest-test'
opensearchplugin {
description 'Adds advanced field mappers'
classname 'org.opensearch.index.mapper.MapperExtrasModulePlugin'
description = 'Adds advanced field mappers'
classname = 'org.opensearch.index.mapper.MapperExtrasModulePlugin'
hasClientJar = true
}

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.java-rest-test'
opensearchplugin {
description 'Plugin exposing APIs for OpenSearch Dashboards system indices'
classname 'org.opensearch.dashboards.OpenSearchDashboardsModulePlugin'
description = 'Plugin exposing APIs for OpenSearch Dashboards system indices'
classname = 'org.opensearch.dashboards.OpenSearchDashboardsModulePlugin'
}
dependencies {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'This module adds the support parent-child queries and aggregations'
classname 'org.opensearch.join.ParentJoinModulePlugin'
description = 'This module adds the support parent-child queries and aggregations'
classname = 'org.opensearch.join.ParentJoinModulePlugin'
hasClientJar = true
}

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Percolator module adds capability to index queries and query these queries by specifying documents'
classname 'org.opensearch.percolator.PercolatorModulePlugin'
description = 'Percolator module adds capability to index queries and query these queries by specifying documents'
classname = 'org.opensearch.percolator.PercolatorModulePlugin'
hasClientJar = true
}

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Rank Eval module adds APIs to evaluate ranking quality.'
classname 'org.opensearch.index.rankeval.RankEvalModulePlugin'
description = 'The Rank Eval module adds APIs to evaluate ranking quality.'
classname = 'org.opensearch.index.rankeval.RankEvalModulePlugin'
hasClientJar = true
}

View File

@ -40,8 +40,8 @@ apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Reindex module adds APIs to reindex from one index to another or update documents in place.'
classname 'org.opensearch.index.reindex.ReindexModulePlugin'
description = 'The Reindex module adds APIs to reindex from one index to another or update documents in place.'
classname = 'org.opensearch.index.reindex.ReindexModulePlugin'
hasClientJar = true
}

View File

@ -37,8 +37,8 @@ apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Module for URL repository'
classname 'org.opensearch.plugin.repository.url.URLRepositoryModulePlugin'
description = 'Module for URL repository'
classname = 'org.opensearch.plugin.repository.url.URLRepositoryModulePlugin'
}
restResources {
@ -56,7 +56,7 @@ task urlFixture(type: AntFixture) {
doFirst {
repositoryDir.mkdirs()
}
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
env 'CLASSPATH', "${-> sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.opensearch.repositories.url.URLFixture', baseDir, "${repositoryDir.absolutePath}"
}

View File

@ -13,8 +13,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Module for search pipeline processors that do not require additional security permissions or have large dependencies and resources'
classname 'org.opensearch.search.pipeline.common.SearchPipelineCommonModulePlugin'
description = 'Module for search pipeline processors that do not require additional security permissions or have large dependencies and resources'
classname = 'org.opensearch.search.pipeline.common.SearchPipelineCommonModulePlugin'
extendedPlugins = ['lang-painless']
}

View File

@ -29,6 +29,6 @@
*/
opensearchplugin {
description 'Integrates OpenSearch with systemd'
classname 'org.opensearch.systemd.SystemdModulePlugin'
description = 'Integrates OpenSearch with systemd'
classname = 'org.opensearch.systemd.SystemdModulePlugin'
}

View File

@ -49,8 +49,8 @@ apply plugin: 'opensearch.publish'
* maybe figure out a way to run all tests from core with netty4/network?
*/
opensearchplugin {
description 'Netty 4 based transport implementation'
classname 'org.opensearch.transport.Netty4ModulePlugin'
description = 'Netty 4 based transport implementation'
classname = 'org.opensearch.transport.Netty4ModulePlugin'
hasClientJar = true
}

View File

@ -32,8 +32,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding ICU-related analysis components.'
classname 'org.opensearch.plugin.analysis.icu.AnalysisICUPlugin'
description = 'The ICU Analysis plugin integrates the Lucene ICU module into OpenSearch, adding ICU-related analysis components.'
classname = 'org.opensearch.plugin.analysis.icu.AnalysisICUPlugin'
hasClientJar = true
}

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into opensearch.'
classname 'org.opensearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin'
description = 'The Japanese (kuromoji) Analysis plugin integrates Lucene kuromoji analysis module into opensearch.'
classname = 'org.opensearch.plugin.analysis.kuromoji.AnalysisKuromojiPlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Korean (nori) Analysis plugin integrates Lucene nori analysis module into opensearch.'
classname 'org.opensearch.plugin.analysis.nori.AnalysisNoriPlugin'
description = 'The Korean (nori) Analysis plugin integrates Lucene nori analysis module into opensearch.'
classname = 'org.opensearch.plugin.analysis.nori.AnalysisNoriPlugin'
}
dependencies {

View File

@ -12,8 +12,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'Adds an analyzer for phone numbers to OpenSearch.'
classname 'org.opensearch.analysis.phone.PhoneNumberAnalysisPlugin'
description = 'Adds an analyzer for phone numbers to OpenSearch.'
classname = 'org.opensearch.analysis.phone.PhoneNumberAnalysisPlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Phonetic Analysis plugin integrates phonetic token filter analysis with opensearch.'
classname 'org.opensearch.plugin.analysis.AnalysisPhoneticPlugin'
description = 'The Phonetic Analysis plugin integrates phonetic token filter analysis with opensearch.'
classname = 'org.opensearch.plugin.analysis.AnalysisPhoneticPlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into opensearch.'
classname 'org.opensearch.plugin.analysis.smartcn.AnalysisSmartChinesePlugin'
description = 'Smart Chinese Analysis plugin integrates Lucene Smart Chinese analysis module into opensearch.'
classname = 'org.opensearch.plugin.analysis.smartcn.AnalysisSmartChinesePlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into opensearch.'
classname 'org.opensearch.plugin.analysis.stempel.AnalysisStempelPlugin'
description = 'The Stempel (Polish) Analysis plugin integrates Lucene stempel (polish) analysis module into opensearch.'
classname = 'org.opensearch.plugin.analysis.stempel.AnalysisStempelPlugin'
}
dependencies {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into opensearch.'
classname 'org.opensearch.plugin.analysis.ukrainian.AnalysisUkrainianPlugin'
description = 'The Ukrainian Analysis plugin integrates the Lucene UkrainianMorfologikAnalyzer into opensearch.'
classname = 'org.opensearch.plugin.analysis.ukrainian.AnalysisUkrainianPlugin'
}
dependencies {

View File

@ -39,9 +39,9 @@ configure(subprojects.findAll { it.parent.path == project.path }) {
opensearchplugin {
// for local ES plugins, the name of the plugin is the same as the directory
name project.name
name = project.name
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
}

View File

@ -14,8 +14,8 @@ import org.opensearch.gradle.info.BuildParams
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Ehcache based cache implementation.'
classname 'org.opensearch.cache.EhcacheCachePlugin'
description = 'Ehcache based cache implementation.'
classname = 'org.opensearch.cache.EhcacheCachePlugin'
}
versions << [

View File

@ -16,8 +16,8 @@ apply plugin: 'opensearch.publish'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'AWS KMS plugin to provide crypto keys'
classname 'org.opensearch.crypto.kms.CryptoKmsPlugin'
description = 'AWS KMS plugin to provide crypto keys'
classname = 'org.opensearch.crypto.kms.CryptoKmsPlugin'
}
ext {

View File

@ -35,8 +35,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism'
classname 'org.opensearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin'
description = 'The Azure Classic Discovery plugin allows to use Azure Classic API for the unicast discovery mechanism'
classname = 'org.opensearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin'
}
versions << [

View File

@ -34,8 +34,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.'
classname 'org.opensearch.discovery.ec2.Ec2DiscoveryPlugin'
description = 'The EC2 discovery plugin allows to use AWS API for the unicast discovery mechanism.'
classname = 'org.opensearch.discovery.ec2.Ec2DiscoveryPlugin'
}
dependencies {

View File

@ -76,8 +76,8 @@ yamlRestTest.enabled = false
*/
['KeyStore', 'EnvVariables', 'SystemProperties', 'ContainerCredentials', 'InstanceProfile'].forEach { action ->
AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) {
dependsOn project.sourceSets.yamlRestTest.runtimeClasspath
env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}"
dependsOn sourceSets.yamlRestTest.runtimeClasspath
env 'CLASSPATH', "${-> sourceSets.yamlRestTest.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.opensearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/yamlRestTest${action}-1/config/unicast_hosts.txt"
}
@ -85,7 +85,7 @@ yamlRestTest.enabled = false
tasks.create(name: "yamlRestTest${action}", type: RestIntegTestTask) {
dependsOn fixture
}
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
SourceSetContainer sourceSets = getExtensions().getByType(SourceSetContainer.class);
SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME)
"yamlRestTest${action}" {
setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs())

View File

@ -13,8 +13,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.'
classname 'org.opensearch.plugin.discovery.gce.GceDiscoveryPlugin'
description = 'The Google Compute Engine (GCE) Discovery plugin allows to use GCE API for the unicast discovery mechanism.'
classname = 'org.opensearch.plugin.discovery.gce.GceDiscoveryPlugin'
}
dependencies {
@ -52,9 +52,10 @@ check {
dependsOn 'qa:gce:check'
}
def name = project.name
test {
// this is needed for insecure plugins, remove if possible!
systemProperty 'tests.artifact', project.name
systemProperty 'tests.artifact', name
}
thirdPartyAudit {

View File

@ -51,8 +51,8 @@ restResources {
/** A task to start the GCEFixture which emulates a GCE service **/
task gceFixture(type: AntFixture) {
dependsOn project.sourceSets.yamlRestTest.runtimeClasspath
env 'CLASSPATH', "${-> project.sourceSets.yamlRestTest.runtimeClasspath.asPath}"
dependsOn sourceSets.yamlRestTest.runtimeClasspath
env 'CLASSPATH', "${-> sourceSets.yamlRestTest.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.opensearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/yamlRestTest-1/config/unicast_hosts.txt"
}

View File

@ -31,11 +31,11 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'custom-settings'
description 'An example plugin showing how to register custom settings'
classname 'org.opensearch.example.customsettings.ExampleCustomSettingsPlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'custom-settings'
description = 'An example plugin showing how to register custom settings'
classname = 'org.opensearch.example.customsettings.ExampleCustomSettingsPlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
testClusters.all {

View File

@ -31,9 +31,9 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'custom-significance-heuristic'
description 'An example plugin showing how to write and register a custom significance heuristic'
classname 'org.opensearch.example.customsigheuristic.CustomSignificanceHeuristicPlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'custom-significance-heuristic'
description = 'An example plugin showing how to write and register a custom significance heuristic'
classname = 'org.opensearch.example.customsigheuristic.CustomSignificanceHeuristicPlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}

View File

@ -31,11 +31,11 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'custom-suggester'
description 'An example plugin showing how to write and register a custom suggester'
classname 'org.opensearch.example.customsuggester.CustomSuggesterPlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'custom-suggester'
description = 'An example plugin showing how to write and register a custom suggester'
classname = 'org.opensearch.example.customsuggester.CustomSuggesterPlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
testClusters.all {

View File

@ -31,12 +31,12 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'painless-allowlist'
description 'An example allowlisting additional classes and methods in painless'
classname 'org.opensearch.example.painlessallowlist.MyAllowlistPlugin'
name = 'painless-allowlist'
description = 'An example allowlisting additional classes and methods in painless'
classname = 'org.opensearch.example.painlessallowlist.MyAllowlistPlugin'
extendedPlugins = ['lang-painless']
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
dependencies {

View File

@ -31,9 +31,9 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'example-rescore'
description 'An example plugin implementing rescore and verifying that plugins *can* implement rescore'
classname 'org.opensearch.example.rescore.ExampleRescorePlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'example-rescore'
description = 'An example plugin implementing rescore and verifying that plugins *can* implement rescore'
classname = 'org.opensearch.example.rescore.ExampleRescorePlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}

View File

@ -35,11 +35,11 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.java-rest-test'
opensearchplugin {
name 'rest-handler'
description 'An example plugin showing how to register a REST handler'
classname 'org.opensearch.example.resthandler.ExampleRestHandlerPlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'rest-handler'
description = 'An example plugin showing how to register a REST handler'
classname = 'org.opensearch.example.resthandler.ExampleRestHandlerPlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
// No unit tests in this example
@ -47,7 +47,7 @@ test.enabled = false
tasks.register("exampleFixture", org.opensearch.gradle.test.AntFixture) {
dependsOn sourceSets.javaRestTest.runtimeClasspath
env 'CLASSPATH', "${-> project.sourceSets.javaRestTest.runtimeClasspath.asPath}"
env 'CLASSPATH', "${-> sourceSets.javaRestTest.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.opensearch.example.resthandler.ExampleFixture', baseDir, 'TEST'
}

View File

@ -31,11 +31,11 @@ apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
name 'script-expert-scoring'
description 'An example script engine to use low level Lucene internals for expert scoring'
classname 'org.opensearch.example.expertscript.ExpertScriptPlugin'
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
name = 'script-expert-scoring'
description = 'An example script engine to use low level Lucene internals for expert scoring'
classname = 'org.opensearch.example.expertscript.ExpertScriptPlugin'
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
test.enabled = false

View File

@ -9,11 +9,11 @@
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Plugin for identity features in OpenSearch.'
classname 'org.opensearch.identity.shiro.ShiroIdentityPlugin'
name project.name
licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile rootProject.file('NOTICE.txt')
description = 'Plugin for identity features in OpenSearch.'
classname = 'org.opensearch.identity.shiro.ShiroIdentityPlugin'
name = project.name
licenseFile = rootProject.file('licenses/APACHE-LICENSE-2.0.txt')
noticeFile = rootProject.file('NOTICE.txt')
}
dependencies {

View File

@ -33,8 +33,8 @@ import org.opensearch.gradle.info.BuildParams
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'Ingest processor that uses Apache Tika to extract contents'
classname 'org.opensearch.ingest.attachment.IngestAttachmentPlugin'
description = 'Ingest processor that uses Apache Tika to extract contents'
classname = 'org.opensearch.ingest.attachment.IngestAttachmentPlugin'
}
versions << [

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.'
classname 'org.opensearch.plugin.mapper.AnnotatedTextPlugin'
description = 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.'
classname = 'org.opensearch.plugin.mapper.AnnotatedTextPlugin'
}
restResources {

View File

@ -30,8 +30,8 @@
apply plugin: 'opensearch.yaml-rest-test'
opensearchplugin {
description 'The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index.'
classname 'org.opensearch.plugin.mapper.MapperMurmur3Plugin'
description = 'The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index.'
classname = 'org.opensearch.plugin.mapper.MapperMurmur3Plugin'
}
restResources {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Mapper Size plugin allows document to record their uncompressed size at index time.'
classname 'org.opensearch.plugin.mapper.MapperSizePlugin'
description = 'The Mapper Size plugin allows document to record their uncompressed size at index time.'
classname = 'org.opensearch.plugin.mapper.MapperSizePlugin'
}
restResources {

View File

@ -39,8 +39,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Azure Repository plugin adds support for Azure storage repositories.'
classname 'org.opensearch.repositories.azure.AzureRepositoryPlugin'
description = 'The Azure Repository plugin adds support for Azure storage repositories.'
classname = 'org.opensearch.repositories.azure.AzureRepositoryPlugin'
}
dependencies {

View File

@ -43,8 +43,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The GCS repository plugin adds Google Cloud Storage support for repositories.'
classname 'org.opensearch.repositories.gcs.GoogleCloudStoragePlugin'
description = 'The GCS repository plugin adds Google Cloud Storage support for repositories.'
classname = 'org.opensearch.repositories.gcs.GoogleCloudStoragePlugin'
}
dependencies {

View File

@ -43,8 +43,8 @@ apply plugin: 'opensearch.rest-resources'
apply plugin: 'opensearch.rest-test'
opensearchplugin {
description 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.'
classname 'org.opensearch.repositories.hdfs.HdfsPlugin'
description = 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.'
classname = 'org.opensearch.repositories.hdfs.HdfsPlugin'
}
versions << [
@ -133,11 +133,11 @@ project(':test:fixtures:krb5kdc-fixture').tasks.preProcessFixture {
// Create HDFS File System Testing Fixtures for HA/Secure combinations
for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', 'secureHaHdfsFixture']) {
def tsk = project.tasks.register(fixtureName, org.opensearch.gradle.test.AntFixture) {
dependsOn project.configurations.hdfsFixture, project(':test:fixtures:krb5kdc-fixture').tasks.postProcessFixture
def tsk = tasks.register(fixtureName, org.opensearch.gradle.test.AntFixture) {
dependsOn configurations.hdfsFixture, project(':test:fixtures:krb5kdc-fixture').tasks.postProcessFixture
executable = "${BuildParams.runtimeJavaHome}/bin/java"
env 'CLASSPATH', "${-> project.configurations.hdfsFixture.asPath}"
maxWaitInSeconds 60
env 'CLASSPATH', "${-> configurations.hdfsFixture.asPath}"
maxWaitInSeconds = 60
onlyIf { BuildParams.inFipsJvm == false }
waitCondition = { fixture, ant ->
// the hdfs.MiniHDFS fixture writes the ports file when
@ -187,7 +187,7 @@ Set disabledIntegTestTaskNames = []
for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSecureHa']) {
task "${integTestTaskName}"(type: RestIntegTestTask) {
description = "Runs rest tests against an opensearch cluster with HDFS."
dependsOn(project.bundlePlugin)
dependsOn(bundlePlugin)
if (disabledIntegTestTaskNames.contains(integTestTaskName)) {
enabled = false;

View File

@ -41,8 +41,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The S3 repository plugin adds S3 repositories'
classname 'org.opensearch.repositories.s3.S3RepositoryPlugin'
description = 'The S3 repository plugin adds S3 repositories'
classname = 'org.opensearch.repositories.s3.S3RepositoryPlugin'
}
dependencies {

View File

@ -31,8 +31,8 @@ apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The Store SMB plugin adds support for SMB stores.'
classname 'org.opensearch.plugin.store.smb.SMBStorePlugin'
description = 'The Store SMB plugin adds support for SMB stores.'
classname = 'org.opensearch.plugin.store.smb.SMBStorePlugin'
}
restResources {
restApi {

View File

@ -14,8 +14,8 @@ import org.opensearch.gradle.info.BuildParams
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'Opentelemetry based telemetry implementation.'
classname 'org.opensearch.telemetry.OTelTelemetryPlugin'
description = 'Opentelemetry based telemetry implementation.'
classname = 'org.opensearch.telemetry.OTelTelemetryPlugin'
hasClientJar = false
}

View File

@ -9,8 +9,8 @@ import org.gradle.api.attributes.java.TargetJvmEnvironment
*/
opensearchplugin {
description 'gRPC based transport implementation'
classname 'org.opensearch.transport.grpc.GrpcPlugin'
description = 'gRPC based transport implementation'
classname = 'org.opensearch.transport.grpc.GrpcPlugin'
}
dependencies {

View File

@ -34,8 +34,8 @@ apply plugin: "opensearch.publish"
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'The nio transport.'
classname 'org.opensearch.transport.nio.NioTransportPlugin'
description = 'The nio transport.'
classname = 'org.opensearch.transport.nio.NioTransportPlugin'
hasClientJar = true
}

View File

@ -23,8 +23,8 @@ apply plugin: 'opensearch.internal-cluster-test'
apply plugin: 'opensearch.publish'
opensearchplugin {
description 'Reactor Netty 4 based transport implementation'
classname 'org.opensearch.transport.reactor.ReactorNetty4Plugin'
description = 'Reactor Netty 4 based transport implementation'
classname = 'org.opensearch.transport.reactor.ReactorNetty4Plugin'
hasClientJar = true
}

View File

@ -14,8 +14,8 @@ apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.internal-cluster-test'
opensearchplugin {
description 'OpenSearch Workload Management Plugin.'
classname 'org.opensearch.plugin.wlm.WorkloadManagementPlugin'
description = 'OpenSearch Workload Management Plugin.'
classname = 'org.opensearch.plugin.wlm.WorkloadManagementPlugin'
}
dependencies {

View File

@ -16,8 +16,8 @@ apply plugin: 'opensearch.java-rest-test'
apply plugin: 'opensearch.opensearchplugin'
opensearchplugin {
description 'Die with dignity plugin'
classname 'org.opensearch.DieWithDignityPlugin'
description = 'Die with dignity plugin'
classname = 'org.opensearch.DieWithDignityPlugin'
}
// let the javaRestTest see the classpath of main

Some files were not shown because too many files have changed in this diff Show More