mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Support Gradle 7 (#1609)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
parent
74943c43c6
commit
8bf6fa6b4f
@ -313,7 +313,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean hasShadow = project.plugins.hasPlugin(ShadowPlugin)
|
boolean hasShadow = project.plugins.hasPlugin(ShadowPlugin)
|
||||||
project.configurations.compile.dependencies
|
project.configurations.implementation.dependencies
|
||||||
.findAll()
|
.findAll()
|
||||||
.toSorted(sortClosure)
|
.toSorted(sortClosure)
|
||||||
.each({ c -> depJavadocClosure(hasShadow, c) })
|
.each({ c -> depJavadocClosure(hasShadow, c) })
|
||||||
|
@ -124,7 +124,7 @@ dependencies {
|
|||||||
testFixturesApi gradleTestKit()
|
testFixturesApi gradleTestKit()
|
||||||
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2'
|
testImplementation 'com.github.tomakehurst:wiremock-jre8-standalone:2.23.2'
|
||||||
testImplementation "org.mockito:mockito-core:${props.getProperty('mockito')}"
|
testImplementation "org.mockito:mockito-core:${props.getProperty('mockito')}"
|
||||||
integTestImplementation('org.spockframework:spock-core:1.3-groovy-2.5') {
|
integTestImplementation('org.spockframework:spock-core:2.0-groovy-3.0') {
|
||||||
exclude module: "groovy"
|
exclude module: "groovy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,6 +260,9 @@ if (project != rootProject) {
|
|||||||
*/
|
*/
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
generatePomFileForPluginMavenPublication.enabled = false
|
generatePomFileForPluginMavenPublication.enabled = false
|
||||||
|
tasks.named("validatePluginMavenPom").configure {
|
||||||
|
dependsOn("generatePomFileForNebulaPublication")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing.publications.named("nebula").configure {
|
publishing.publications.named("nebula").configure {
|
||||||
|
@ -82,7 +82,7 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
|
|||||||
doLast(new Action<Task>() {
|
doLast(new Action<Task>() {
|
||||||
@Override
|
@Override
|
||||||
public void execute(Task task) {
|
public void execute(Task task) {
|
||||||
if (LoggedExec.this.getExecResult().getExitValue() != 0) {
|
if (LoggedExec.this.getExecutionResult().get().getExitValue() != 0) {
|
||||||
try {
|
try {
|
||||||
LoggedExec.this.getLogger().error("Output for " + LoggedExec.this.getExecutable() + ":");
|
LoggedExec.this.getLogger().error("Output for " + LoggedExec.this.getExecutable() + ":");
|
||||||
outputLogger.accept(LoggedExec.this.getLogger());
|
outputLogger.accept(LoggedExec.this.getLogger());
|
||||||
@ -94,7 +94,7 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
|
|||||||
"Process '%s %s' finished with non-zero exit value %d",
|
"Process '%s %s' finished with non-zero exit value %d",
|
||||||
LoggedExec.this.getExecutable(),
|
LoggedExec.this.getExecutable(),
|
||||||
LoggedExec.this.getArgs(),
|
LoggedExec.this.getArgs(),
|
||||||
LoggedExec.this.getExecResult().getExitValue()
|
LoggedExec.this.getExecutionResult().get().getExitValue()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class OpenSearchTestBasePlugin implements Plugin<Project> {
|
|||||||
File heapdumpDir = new File(project.getBuildDir(), "heapdump");
|
File heapdumpDir = new File(project.getBuildDir(), "heapdump");
|
||||||
|
|
||||||
project.getTasks().withType(Test.class).configureEach(test -> {
|
project.getTasks().withType(Test.class).configureEach(test -> {
|
||||||
File testOutputDir = new File(test.getReports().getJunitXml().getDestination(), "output");
|
File testOutputDir = new File(test.getReports().getJunitXml().getOutputLocation().getAsFile().get(), "output");
|
||||||
|
|
||||||
ErrorReportingTestListener listener = new ErrorReportingTestListener(test.getTestLogging(), test.getLogger(), testOutputDir);
|
ErrorReportingTestListener listener = new ErrorReportingTestListener(test.getTestLogging(), test.getLogger(), testOutputDir);
|
||||||
test.getExtensions().add("errorReportingTestListener", listener);
|
test.getExtensions().add("errorReportingTestListener", listener);
|
||||||
|
@ -41,11 +41,10 @@ import org.gradle.api.Project;
|
|||||||
import org.gradle.api.logging.Logger;
|
import org.gradle.api.logging.Logger;
|
||||||
import org.gradle.api.logging.Logging;
|
import org.gradle.api.logging.Logging;
|
||||||
import org.gradle.api.model.ObjectFactory;
|
import org.gradle.api.model.ObjectFactory;
|
||||||
import org.gradle.api.provider.Provider;
|
|
||||||
import org.gradle.api.provider.ProviderFactory;
|
import org.gradle.api.provider.ProviderFactory;
|
||||||
import org.gradle.internal.jvm.Jvm;
|
import org.gradle.internal.jvm.Jvm;
|
||||||
import org.gradle.jvm.toolchain.JavaInstallation;
|
import org.gradle.internal.jvm.inspection.JvmInstallationMetadata;
|
||||||
import org.gradle.jvm.toolchain.JavaInstallationRegistry;
|
import org.gradle.internal.jvm.inspection.JvmMetadataDetector;
|
||||||
import org.gradle.util.GradleVersion;
|
import org.gradle.util.GradleVersion;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -77,13 +76,13 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
private static final String DEFAULT_VERSION_JAVA_FILE_PATH = "server/src/main/java/org/opensearch/Version.java";
|
private static final String DEFAULT_VERSION_JAVA_FILE_PATH = "server/src/main/java/org/opensearch/Version.java";
|
||||||
private static Integer _defaultParallel = null;
|
private static Integer _defaultParallel = null;
|
||||||
|
|
||||||
private final JavaInstallationRegistry javaInstallationRegistry;
|
private final JvmMetadataDetector jvmMetadataDetector;
|
||||||
private final ObjectFactory objects;
|
private final ObjectFactory objects;
|
||||||
private final ProviderFactory providers;
|
private final ProviderFactory providers;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GlobalBuildInfoPlugin(JavaInstallationRegistry javaInstallationRegistry, ObjectFactory objects, ProviderFactory providers) {
|
public GlobalBuildInfoPlugin(JvmMetadataDetector jvmMetadataDetector, ObjectFactory objects, ProviderFactory providers) {
|
||||||
this.javaInstallationRegistry = javaInstallationRegistry;
|
this.jvmMetadataDetector = jvmMetadataDetector;
|
||||||
this.objects = objects;
|
this.objects = objects;
|
||||||
this.providers = providers;
|
this.providers = providers;
|
||||||
}
|
}
|
||||||
@ -115,7 +114,7 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
params.setRuntimeJavaHome(runtimeJavaHome);
|
params.setRuntimeJavaHome(runtimeJavaHome);
|
||||||
params.setRuntimeJavaVersion(determineJavaVersion("runtime java.home", runtimeJavaHome, minimumRuntimeVersion));
|
params.setRuntimeJavaVersion(determineJavaVersion("runtime java.home", runtimeJavaHome, minimumRuntimeVersion));
|
||||||
params.setIsRutimeJavaHomeSet(runtimeJavaHomeOpt.isPresent());
|
params.setIsRutimeJavaHomeSet(runtimeJavaHomeOpt.isPresent());
|
||||||
params.setRuntimeJavaDetails(getJavaInstallation(runtimeJavaHome).getImplementationName());
|
params.setRuntimeJavaDetails(getJavaInstallation(runtimeJavaHome).getDisplayName());
|
||||||
params.setJavaVersions(getAvailableJavaVersions(minimumCompilerVersion));
|
params.setJavaVersions(getAvailableJavaVersions(minimumCompilerVersion));
|
||||||
params.setMinimumCompilerVersion(minimumCompilerVersion);
|
params.setMinimumCompilerVersion(minimumCompilerVersion);
|
||||||
params.setMinimumRuntimeVersion(minimumRuntimeVersion);
|
params.setMinimumRuntimeVersion(minimumRuntimeVersion);
|
||||||
@ -160,14 +159,14 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
final String osVersion = System.getProperty("os.version");
|
final String osVersion = System.getProperty("os.version");
|
||||||
final String osArch = System.getProperty("os.arch");
|
final String osArch = System.getProperty("os.arch");
|
||||||
final Jvm gradleJvm = Jvm.current();
|
final Jvm gradleJvm = Jvm.current();
|
||||||
final String gradleJvmDetails = getJavaInstallation(gradleJvm.getJavaHome()).getImplementationName();
|
final String gradleJvmDetails = getJavaInstallation(gradleJvm.getJavaHome()).getDisplayName();
|
||||||
|
|
||||||
LOGGER.quiet("=======================================");
|
LOGGER.quiet("=======================================");
|
||||||
LOGGER.quiet("OpenSearch Build Hamster says Hello!");
|
LOGGER.quiet("OpenSearch Build Hamster says Hello!");
|
||||||
LOGGER.quiet(" Gradle Version : " + GradleVersion.current().getVersion());
|
LOGGER.quiet(" Gradle Version : " + GradleVersion.current().getVersion());
|
||||||
LOGGER.quiet(" OS Info : " + osName + " " + osVersion + " (" + osArch + ")");
|
LOGGER.quiet(" OS Info : " + osName + " " + osVersion + " (" + osArch + ")");
|
||||||
if (BuildParams.getIsRuntimeJavaHomeSet()) {
|
if (BuildParams.getIsRuntimeJavaHomeSet()) {
|
||||||
String runtimeJvmDetails = getJavaInstallation(BuildParams.getRuntimeJavaHome()).getImplementationName();
|
String runtimeJvmDetails = getJavaInstallation(BuildParams.getRuntimeJavaHome()).getDisplayName();
|
||||||
LOGGER.quiet(" Runtime JDK Version : " + BuildParams.getRuntimeJavaVersion() + " (" + runtimeJvmDetails + ")");
|
LOGGER.quiet(" Runtime JDK Version : " + BuildParams.getRuntimeJavaVersion() + " (" + runtimeJvmDetails + ")");
|
||||||
LOGGER.quiet(" Runtime java.home : " + BuildParams.getRuntimeJavaHome());
|
LOGGER.quiet(" Runtime java.home : " + BuildParams.getRuntimeJavaHome());
|
||||||
LOGGER.quiet(" Gradle JDK Version : " + gradleJvm.getJavaVersion() + " (" + gradleJvmDetails + ")");
|
LOGGER.quiet(" Gradle JDK Version : " + gradleJvm.getJavaVersion() + " (" + gradleJvmDetails + ")");
|
||||||
@ -182,8 +181,8 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private JavaVersion determineJavaVersion(String description, File javaHome, JavaVersion requiredVersion) {
|
private JavaVersion determineJavaVersion(String description, File javaHome, JavaVersion requiredVersion) {
|
||||||
JavaInstallation installation = getJavaInstallation(javaHome);
|
JvmInstallationMetadata installation = getJavaInstallation(javaHome);
|
||||||
JavaVersion actualVersion = installation.getJavaVersion();
|
JavaVersion actualVersion = installation.getLanguageVersion();
|
||||||
if (actualVersion.isCompatibleWith(requiredVersion) == false) {
|
if (actualVersion.isCompatibleWith(requiredVersion) == false) {
|
||||||
throwInvalidJavaHomeException(
|
throwInvalidJavaHomeException(
|
||||||
description,
|
description,
|
||||||
@ -196,15 +195,8 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
return actualVersion;
|
return actualVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaInstallation getJavaInstallation(File javaHome) {
|
private JvmInstallationMetadata getJavaInstallation(File javaHome) {
|
||||||
JavaInstallation installation;
|
return jvmMetadataDetector.getMetadata(javaHome);
|
||||||
if (isCurrentJavaHome(javaHome)) {
|
|
||||||
installation = javaInstallationRegistry.getInstallationForCurrentVirtualMachine().get();
|
|
||||||
} else {
|
|
||||||
installation = javaInstallationRegistry.installationForDirectory(objects.directoryProperty().fileValue(javaHome)).get();
|
|
||||||
}
|
|
||||||
|
|
||||||
return installation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<JavaHome> getAvailableJavaVersions(JavaVersion minimumCompilerVersion) {
|
private List<JavaHome> getAvailableJavaVersions(JavaVersion minimumCompilerVersion) {
|
||||||
@ -214,11 +206,9 @@ public class GlobalBuildInfoPlugin implements Plugin<Project> {
|
|||||||
String javaHomeEnvVarName = getJavaHomeEnvVarName(Integer.toString(version));
|
String javaHomeEnvVarName = getJavaHomeEnvVarName(Integer.toString(version));
|
||||||
if (System.getenv(javaHomeEnvVarName) != null) {
|
if (System.getenv(javaHomeEnvVarName) != null) {
|
||||||
File javaHomeDirectory = new File(findJavaHome(Integer.toString(version)));
|
File javaHomeDirectory = new File(findJavaHome(Integer.toString(version)));
|
||||||
Provider<JavaInstallation> javaInstallationProvider = javaInstallationRegistry.installationForDirectory(
|
JvmInstallationMetadata javaInstallation = jvmMetadataDetector.getMetadata(javaHomeDirectory);
|
||||||
objects.directoryProperty().fileValue(javaHomeDirectory)
|
|
||||||
);
|
|
||||||
JavaHome javaHome = JavaHome.of(version, providers.provider(() -> {
|
JavaHome javaHome = JavaHome.of(version, providers.provider(() -> {
|
||||||
int actualVersion = Integer.parseInt(javaInstallationProvider.get().getJavaVersion().getMajorVersion());
|
int actualVersion = Integer.parseInt(javaInstallation.getLanguageVersion().getMajorVersion());
|
||||||
if (actualVersion != version) {
|
if (actualVersion != version) {
|
||||||
throwInvalidJavaHomeException("env variable " + javaHomeEnvVarName, javaHomeDirectory, version, actualVersion);
|
throwInvalidJavaHomeException("env variable " + javaHomeEnvVarName, javaHomeDirectory, version, actualVersion);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import org.opensearch.gradle.LoggedExec;
|
|||||||
import org.gradle.api.Action;
|
import org.gradle.api.Action;
|
||||||
import org.gradle.api.GradleException;
|
import org.gradle.api.GradleException;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
|
import org.gradle.api.Task;
|
||||||
import org.gradle.api.logging.LogLevel;
|
import org.gradle.api.logging.LogLevel;
|
||||||
import org.gradle.api.provider.Provider;
|
import org.gradle.api.provider.Provider;
|
||||||
import org.gradle.api.tasks.TaskProvider;
|
import org.gradle.api.tasks.TaskProvider;
|
||||||
@ -80,77 +81,83 @@ public class BwcSetupExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TaskProvider<LoggedExec> createRunBwcGradleTask(Project project, String name, Action<LoggedExec> configAction) {
|
private TaskProvider<LoggedExec> createRunBwcGradleTask(Project project, String name, Action<LoggedExec> configAction) {
|
||||||
return project.getTasks().register(name, LoggedExec.class, loggedExec -> {
|
return project.getTasks().register(name, LoggedExec.class, new Action<LoggedExec>() {
|
||||||
// TODO revisit
|
@Override
|
||||||
loggedExec.dependsOn("checkoutBwcBranch");
|
public void execute(LoggedExec loggedExec) {
|
||||||
loggedExec.setSpoolOutput(true);
|
// TODO revisit
|
||||||
loggedExec.setWorkingDir(checkoutDir.get());
|
loggedExec.dependsOn("checkoutBwcBranch");
|
||||||
loggedExec.doFirst(t -> {
|
loggedExec.setSpoolOutput(true);
|
||||||
// Execution time so that the checkouts are available
|
loggedExec.setWorkingDir(checkoutDir.get());
|
||||||
String javaVersionsString = readFromFile(new File(checkoutDir.get(), ".ci/java-versions.properties"));
|
loggedExec.doFirst(new Action<Task>() {
|
||||||
loggedExec.environment(
|
@Override
|
||||||
"JAVA_HOME",
|
public void execute(Task t) {
|
||||||
getJavaHome(
|
// Execution time so that the checkouts are available
|
||||||
Integer.parseInt(
|
String javaVersionsString = readFromFile(new File(checkoutDir.get(), ".ci/java-versions.properties"));
|
||||||
Arrays.asList(javaVersionsString.split("\n"))
|
loggedExec.environment(
|
||||||
.stream()
|
"JAVA_HOME",
|
||||||
.filter(l -> l.trim().startsWith("OPENSEARCH_BUILD_JAVA="))
|
getJavaHome(
|
||||||
.map(l -> l.replace("OPENSEARCH_BUILD_JAVA=java", "").trim())
|
Integer.parseInt(
|
||||||
.map(l -> l.replace("OPENSEARCH_BUILD_JAVA=openjdk", "").trim())
|
Arrays.asList(javaVersionsString.split("\n"))
|
||||||
.collect(Collectors.joining("!!"))
|
.stream()
|
||||||
)
|
.filter(l -> l.trim().startsWith("OPENSEARCH_BUILD_JAVA="))
|
||||||
)
|
.map(l -> l.replace("OPENSEARCH_BUILD_JAVA=java", "").trim())
|
||||||
);
|
.map(l -> l.replace("OPENSEARCH_BUILD_JAVA=openjdk", "").trim())
|
||||||
loggedExec.environment(
|
.collect(Collectors.joining("!!"))
|
||||||
"RUNTIME_JAVA_HOME",
|
)
|
||||||
getJavaHome(
|
)
|
||||||
Integer.parseInt(
|
);
|
||||||
Arrays.asList(javaVersionsString.split("\n"))
|
loggedExec.environment(
|
||||||
.stream()
|
"RUNTIME_JAVA_HOME",
|
||||||
.filter(l -> l.trim().startsWith("OPENSEARCH_RUNTIME_JAVA="))
|
getJavaHome(
|
||||||
.map(l -> l.replace("OPENSEARCH_RUNTIME_JAVA=java", "").trim())
|
Integer.parseInt(
|
||||||
.map(l -> l.replace("OPENSEARCH_RUNTIME_JAVA=openjdk", "").trim())
|
Arrays.asList(javaVersionsString.split("\n"))
|
||||||
.collect(Collectors.joining("!!"))
|
.stream()
|
||||||
)
|
.filter(l -> l.trim().startsWith("OPENSEARCH_RUNTIME_JAVA="))
|
||||||
)
|
.map(l -> l.replace("OPENSEARCH_RUNTIME_JAVA=java", "").trim())
|
||||||
);
|
.map(l -> l.replace("OPENSEARCH_RUNTIME_JAVA=openjdk", "").trim())
|
||||||
});
|
.collect(Collectors.joining("!!"))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
loggedExec.executable("cmd");
|
loggedExec.executable("cmd");
|
||||||
loggedExec.args("/C", "call", new File(checkoutDir.get(), "gradlew").toString());
|
loggedExec.args("/C", "call", new File(checkoutDir.get(), "gradlew").toString());
|
||||||
} else {
|
} else {
|
||||||
loggedExec.executable(new File(checkoutDir.get(), "gradlew").toString());
|
loggedExec.executable(new File(checkoutDir.get(), "gradlew").toString());
|
||||||
}
|
}
|
||||||
if (project.getGradle().getStartParameter().isOffline()) {
|
if (project.getGradle().getStartParameter().isOffline()) {
|
||||||
loggedExec.args("--offline");
|
loggedExec.args("--offline");
|
||||||
}
|
}
|
||||||
// TODO resolve
|
// TODO resolve
|
||||||
String buildCacheUrl = System.getProperty("org.opensearch.build.cache.url");
|
String buildCacheUrl = System.getProperty("org.opensearch.build.cache.url");
|
||||||
if (buildCacheUrl != null) {
|
if (buildCacheUrl != null) {
|
||||||
loggedExec.args("-Dorg.opensearch.build.cache.url=" + buildCacheUrl);
|
loggedExec.args("-Dorg.opensearch.build.cache.url=" + buildCacheUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
loggedExec.args("-Dbuild.snapshot=true");
|
loggedExec.args("-Dbuild.snapshot=true");
|
||||||
loggedExec.args("-Dscan.tag.NESTED");
|
loggedExec.args("-Dscan.tag.NESTED");
|
||||||
final LogLevel logLevel = project.getGradle().getStartParameter().getLogLevel();
|
final LogLevel logLevel = project.getGradle().getStartParameter().getLogLevel();
|
||||||
List<LogLevel> nonDefaultLogLevels = Arrays.asList(LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG);
|
List<LogLevel> nonDefaultLogLevels = Arrays.asList(LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG);
|
||||||
if (nonDefaultLogLevels.contains(logLevel)) {
|
if (nonDefaultLogLevels.contains(logLevel)) {
|
||||||
loggedExec.args("--" + logLevel.name().toLowerCase(Locale.ENGLISH));
|
loggedExec.args("--" + logLevel.name().toLowerCase(Locale.ENGLISH));
|
||||||
|
}
|
||||||
|
final String showStacktraceName = project.getGradle().getStartParameter().getShowStacktrace().name();
|
||||||
|
assert Arrays.asList("INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL").contains(showStacktraceName);
|
||||||
|
if (showStacktraceName.equals("ALWAYS")) {
|
||||||
|
loggedExec.args("--stacktrace");
|
||||||
|
} else if (showStacktraceName.equals("ALWAYS_FULL")) {
|
||||||
|
loggedExec.args("--full-stacktrace");
|
||||||
|
}
|
||||||
|
if (project.getGradle().getStartParameter().isParallelProjectExecutionEnabled()) {
|
||||||
|
loggedExec.args("--parallel");
|
||||||
|
}
|
||||||
|
loggedExec.setStandardOutput(new IndentingOutputStream(System.out, unreleasedVersionInfo.get().version));
|
||||||
|
loggedExec.setErrorOutput(new IndentingOutputStream(System.err, unreleasedVersionInfo.get().version));
|
||||||
|
configAction.execute(loggedExec);
|
||||||
}
|
}
|
||||||
final String showStacktraceName = project.getGradle().getStartParameter().getShowStacktrace().name();
|
|
||||||
assert Arrays.asList("INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL").contains(showStacktraceName);
|
|
||||||
if (showStacktraceName.equals("ALWAYS")) {
|
|
||||||
loggedExec.args("--stacktrace");
|
|
||||||
} else if (showStacktraceName.equals("ALWAYS_FULL")) {
|
|
||||||
loggedExec.args("--full-stacktrace");
|
|
||||||
}
|
|
||||||
if (project.getGradle().getStartParameter().isParallelProjectExecutionEnabled()) {
|
|
||||||
loggedExec.args("--parallel");
|
|
||||||
}
|
|
||||||
loggedExec.setStandardOutput(new IndentingOutputStream(System.out, unreleasedVersionInfo.get().version));
|
|
||||||
loggedExec.setErrorOutput(new IndentingOutputStream(System.err, unreleasedVersionInfo.get().version));
|
|
||||||
configAction.execute(loggedExec);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,11 @@
|
|||||||
package org.opensearch.gradle.internal;
|
package org.opensearch.gradle.internal;
|
||||||
|
|
||||||
import org.opensearch.gradle.BwcVersions;
|
import org.opensearch.gradle.BwcVersions;
|
||||||
|
import org.opensearch.gradle.LoggedExec;
|
||||||
import org.opensearch.gradle.Version;
|
import org.opensearch.gradle.Version;
|
||||||
import org.opensearch.gradle.info.BuildParams;
|
import org.opensearch.gradle.info.BuildParams;
|
||||||
import org.opensearch.gradle.info.GlobalBuildInfoPlugin;
|
import org.opensearch.gradle.info.GlobalBuildInfoPlugin;
|
||||||
|
import org.gradle.api.Action;
|
||||||
import org.gradle.api.InvalidUserDataException;
|
import org.gradle.api.InvalidUserDataException;
|
||||||
import org.gradle.api.Plugin;
|
import org.gradle.api.Plugin;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
@ -204,24 +206,30 @@ public class InternalDistributionBwcSetupPlugin implements Plugin<Project> {
|
|||||||
TaskProvider<Task> bwcTaskProvider
|
TaskProvider<Task> bwcTaskProvider
|
||||||
) {
|
) {
|
||||||
String bwcTaskName = buildBwcTaskName(projectName);
|
String bwcTaskName = buildBwcTaskName(projectName);
|
||||||
bwcSetupExtension.bwcTask(bwcTaskName, c -> {
|
bwcSetupExtension.bwcTask(bwcTaskName, new Action<LoggedExec>() {
|
||||||
c.getInputs().file(new File(project.getBuildDir(), "refspec"));
|
@Override
|
||||||
c.getOutputs().files(projectArtifact);
|
public void execute(LoggedExec c) {
|
||||||
c.getOutputs().cacheIf("BWC distribution caching is disabled on 'master' branch", task -> {
|
c.getInputs().file(new File(project.getBuildDir(), "refspec"));
|
||||||
String gitBranch = System.getenv("GIT_BRANCH");
|
c.getOutputs().files(projectArtifact);
|
||||||
return BuildParams.isCi() && (gitBranch == null || gitBranch.endsWith("master") == false);
|
c.getOutputs().cacheIf("BWC distribution caching is disabled on 'master' branch", task -> {
|
||||||
});
|
String gitBranch = System.getenv("GIT_BRANCH");
|
||||||
c.args(projectPath.replace('/', ':') + ":assemble");
|
return BuildParams.isCi() && (gitBranch == null || gitBranch.endsWith("master") == false);
|
||||||
if (project.getGradle().getStartParameter().isBuildCacheEnabled()) {
|
});
|
||||||
c.args("--build-cache");
|
c.args(projectPath.replace('/', ':') + ":assemble");
|
||||||
}
|
if (project.getGradle().getStartParameter().isBuildCacheEnabled()) {
|
||||||
c.doLast(task -> {
|
c.args("--build-cache");
|
||||||
if (projectArtifact.exists() == false) {
|
|
||||||
throw new InvalidUserDataException(
|
|
||||||
"Building " + bwcVersion.get() + " didn't generate expected file " + projectArtifact
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
c.doLast(new Action<Task>() {
|
||||||
|
@Override
|
||||||
|
public void execute(Task task) {
|
||||||
|
if (projectArtifact.exists() == false) {
|
||||||
|
throw new InvalidUserDataException(
|
||||||
|
"Building " + bwcVersion.get() + " didn't generate expected file " + projectArtifact
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
bwcTaskProvider.configure(t -> t.dependsOn(bwcTaskName));
|
bwcTaskProvider.configure(t -> t.dependsOn(bwcTaskName));
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,16 @@ public class JarHellPrecommitPlugin extends PrecommitPlugin {
|
|||||||
|
|
||||||
TaskProvider<JarHellTask> jarHell = project.getTasks().register("jarHell", JarHellTask.class);
|
TaskProvider<JarHellTask> jarHell = project.getTasks().register("jarHell", JarHellTask.class);
|
||||||
jarHell.configure(t -> {
|
jarHell.configure(t -> {
|
||||||
SourceSet testSourceSet = Util.getJavaTestSourceSet(project).get();
|
final Task testClassesTask = project.getTasks().getByName("testClasses");
|
||||||
|
final SourceSet testSourceSet = Util.getJavaTestSourceSet(project).get();
|
||||||
t.setClasspath(testSourceSet.getRuntimeClasspath().plus(jarHellConfig));
|
t.setClasspath(testSourceSet.getRuntimeClasspath().plus(jarHellConfig));
|
||||||
t.dependsOn(jarHellConfig);
|
t.dependsOn(jarHellConfig, testClassesTask);
|
||||||
|
|
||||||
|
// if this a plugin, we need to add dependency on pluginProperties task
|
||||||
|
project.getPluginManager().withPlugin("opensearch.opensearchplugin", plugin -> {
|
||||||
|
Task propertiesTask = project.getTasks().getByName("pluginProperties");
|
||||||
|
t.dependsOn(jarHellConfig, testClassesTask, propertiesTask);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return jarHell;
|
return jarHell;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
package org.opensearch.gradle.precommit;
|
package org.opensearch.gradle.precommit;
|
||||||
|
|
||||||
import org.opensearch.gradle.LoggedExec;
|
import org.opensearch.gradle.LoggedExec;
|
||||||
|
|
||||||
import org.gradle.api.file.FileCollection;
|
import org.gradle.api.file.FileCollection;
|
||||||
import org.gradle.api.tasks.CacheableTask;
|
import org.gradle.api.tasks.CacheableTask;
|
||||||
import org.gradle.api.tasks.CompileClasspath;
|
import org.gradle.api.tasks.CompileClasspath;
|
||||||
@ -56,7 +57,7 @@ public class JarHellTask extends PrecommitTask {
|
|||||||
public void runJarHellCheck() {
|
public void runJarHellCheck() {
|
||||||
LoggedExec.javaexec(getProject(), spec -> {
|
LoggedExec.javaexec(getProject(), spec -> {
|
||||||
spec.environment("CLASSPATH", getClasspath().getAsPath());
|
spec.environment("CLASSPATH", getClasspath().getAsPath());
|
||||||
spec.setMain("org.opensearch.bootstrap.JarHell");
|
spec.getMainClass().set("org.opensearch.bootstrap.JarHell");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public class LoggerUsageTask extends PrecommitTask {
|
|||||||
@TaskAction
|
@TaskAction
|
||||||
public void runLoggerUsageTask() {
|
public void runLoggerUsageTask() {
|
||||||
LoggedExec.javaexec(getProject(), spec -> {
|
LoggedExec.javaexec(getProject(), spec -> {
|
||||||
spec.setMain("org.opensearch.test.loggerusage.OpenSearchLoggerUsageChecker");
|
spec.getMainClass().set("org.opensearch.test.loggerusage.OpenSearchLoggerUsageChecker");
|
||||||
spec.classpath(getClasspath());
|
spec.classpath(getClasspath());
|
||||||
getClassDirectories().forEach(spec::args);
|
getClassDirectories().forEach(spec::args);
|
||||||
});
|
});
|
||||||
|
@ -281,10 +281,6 @@ public class ThirdPartyAuditTask extends DefaultTask {
|
|||||||
getLogger().error("Forbidden APIs output:\n{}==end of forbidden APIs==", forbiddenApisOutput);
|
getLogger().error("Forbidden APIs output:\n{}==end of forbidden APIs==", forbiddenApisOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void throwNotConfiguredCorrectlyException() {
|
|
||||||
throw new IllegalArgumentException("Audit of third party dependencies is not configured correctly");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void extractJars(Set<File> jars) {
|
private void extractJars(Set<File> jars) {
|
||||||
File jarExpandDir = getJarExpandDir();
|
File jarExpandDir = getJarExpandDir();
|
||||||
// We need to clean up to make sure old dependencies don't linger
|
// We need to clean up to make sure old dependencies don't linger
|
||||||
@ -360,7 +356,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
|
|||||||
);
|
);
|
||||||
spec.jvmArgs("-Xmx1g");
|
spec.jvmArgs("-Xmx1g");
|
||||||
spec.jvmArgs(LoggedExec.shortLivedArgs());
|
spec.jvmArgs(LoggedExec.shortLivedArgs());
|
||||||
spec.setMain("de.thetaphi.forbiddenapis.cli.CliMain");
|
spec.getMainClass().set("de.thetaphi.forbiddenapis.cli.CliMain");
|
||||||
spec.args("-f", getSignatureFile().getAbsolutePath(), "-d", getJarExpandDir(), "--allowmissingclasses");
|
spec.args("-f", getSignatureFile().getAbsolutePath(), "-d", getJarExpandDir(), "--allowmissingclasses");
|
||||||
spec.setErrorOutput(errorOut);
|
spec.setErrorOutput(errorOut);
|
||||||
if (getLogger().isInfoEnabled() == false) {
|
if (getLogger().isInfoEnabled() == false) {
|
||||||
@ -390,7 +386,7 @@ public class ThirdPartyAuditTask extends DefaultTask {
|
|||||||
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
|
getProject().getConfigurations().getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME)
|
||||||
);
|
);
|
||||||
|
|
||||||
spec.setMain(JDK_JAR_HELL_MAIN_CLASS);
|
spec.getMainClass().set(JDK_JAR_HELL_MAIN_CLASS);
|
||||||
spec.args(getJarExpandDir());
|
spec.args(getJarExpandDir());
|
||||||
spec.setIgnoreExitValue(true);
|
spec.setIgnoreExitValue(true);
|
||||||
if (javaHome != null) {
|
if (javaHome != null) {
|
||||||
|
@ -1381,25 +1381,27 @@ public class OpenSearchNode implements TestClusterConfiguration {
|
|||||||
return distributions.get(currentDistro).getExtracted().getSingleFile().toPath();
|
return distributions.get(currentDistro).getExtracted().getSingleFile().toPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<File> getInstalledFileSet(Action<? super PatternFilterable> filter) {
|
private List<Provider<List<File>>> getInstalledFileSet(Action<? super PatternFilterable> filter) {
|
||||||
return Stream.concat(plugins.stream().map(Provider::get), modules.stream().map(Provider::get))
|
return Stream.concat(plugins.stream(), modules.stream()).map(p -> p.map(f -> {
|
||||||
.filter(File::exists)
|
if (f.exists()) {
|
||||||
// TODO: We may be able to simplify this with Gradle 5.6
|
final FileTree tree = archiveOperations.zipTree(f).matching(filter);
|
||||||
// https://docs.gradle.org/nightly/release-notes.html#improved-handling-of-zip-archives-on-classpaths
|
return tree.getFiles();
|
||||||
.map(zipFile -> archiveOperations.zipTree(zipFile).matching(filter))
|
} else {
|
||||||
.flatMap(tree -> tree.getFiles().stream())
|
return new HashSet<File>();
|
||||||
.sorted(Comparator.comparing(File::getName))
|
}
|
||||||
|
}))
|
||||||
|
.map(p -> p.map(f -> f.stream().sorted(Comparator.comparing(File::getName)).collect(Collectors.toList())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Classpath
|
@Classpath
|
||||||
public List<File> getInstalledClasspath() {
|
public List<Provider<List<File>>> getInstalledClasspath() {
|
||||||
return getInstalledFileSet(filter -> filter.include("**/*.jar"));
|
return getInstalledFileSet(filter -> filter.include("**/*.jar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@InputFiles
|
@InputFiles
|
||||||
@PathSensitive(PathSensitivity.RELATIVE)
|
@PathSensitive(PathSensitivity.RELATIVE)
|
||||||
public List<File> getInstalledFiles() {
|
public List<Provider<List<File>>> getInstalledFiles() {
|
||||||
return getInstalledFileSet(filter -> filter.exclude("**/*.jar"));
|
return getInstalledFileSet(filter -> filter.exclude("**/*.jar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,27 +112,42 @@ public class TestFixturesPlugin implements Plugin<Project> {
|
|||||||
project.getPluginManager().apply(BasePlugin.class);
|
project.getPluginManager().apply(BasePlugin.class);
|
||||||
project.getPluginManager().apply(DockerComposePlugin.class);
|
project.getPluginManager().apply(DockerComposePlugin.class);
|
||||||
|
|
||||||
TaskProvider<Task> preProcessFixture = project.getTasks().register("preProcessFixture", t -> {
|
TaskProvider<Task> preProcessFixture = project.getTasks().register("preProcessFixture", new Action<Task>() {
|
||||||
t.getOutputs().dir(testfixturesDir);
|
@Override
|
||||||
t.doFirst(t2 -> {
|
public void execute(Task t) {
|
||||||
try {
|
t.getOutputs().dir(testfixturesDir);
|
||||||
Files.createDirectories(testfixturesDir.toPath());
|
t.doFirst(new Action<Task>() {
|
||||||
} catch (IOException e) {
|
@Override
|
||||||
throw new UncheckedIOException(e);
|
public void execute(Task t2) {
|
||||||
}
|
{
|
||||||
});
|
try {
|
||||||
|
Files.createDirectories(testfixturesDir.toPath());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new UncheckedIOException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
TaskProvider<Task> buildFixture = project.getTasks().register("buildFixture", new Action<Task>() {
|
||||||
|
@Override
|
||||||
|
public void execute(Task t) {
|
||||||
|
t.dependsOn(preProcessFixture, tasks.named("composeUp"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
TaskProvider<Task> buildFixture = project.getTasks()
|
|
||||||
.register("buildFixture", t -> t.dependsOn(preProcessFixture, tasks.named("composeUp")));
|
|
||||||
|
|
||||||
TaskProvider<Task> postProcessFixture = project.getTasks().register("postProcessFixture", task -> {
|
TaskProvider<Task> postProcessFixture = project.getTasks().register("postProcessFixture", new Action<Task>() {
|
||||||
task.dependsOn(buildFixture);
|
@Override
|
||||||
configureServiceInfoForTask(
|
public void execute(Task task) {
|
||||||
task,
|
task.dependsOn(buildFixture);
|
||||||
project,
|
configureServiceInfoForTask(
|
||||||
false,
|
task,
|
||||||
(name, port) -> task.getExtensions().getByType(ExtraPropertiesExtension.class).set(name, port)
|
project,
|
||||||
);
|
false,
|
||||||
|
(name, port) -> task.getExtensions().getByType(ExtraPropertiesExtension.class).set(name, port)
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
maybeSkipTask(dockerSupport, preProcessFixture);
|
maybeSkipTask(dockerSupport, preProcessFixture);
|
||||||
|
@ -187,9 +187,9 @@ public abstract class GradleUtils {
|
|||||||
*/
|
*/
|
||||||
public static void extendSourceSet(Project project, String parentSourceSetName, String childSourceSetName) {
|
public static void extendSourceSet(Project project, String parentSourceSetName, String childSourceSetName) {
|
||||||
final List<Function<SourceSet, String>> configNameFunctions = Arrays.asList(
|
final List<Function<SourceSet, String>> configNameFunctions = Arrays.asList(
|
||||||
SourceSet::getCompileConfigurationName,
|
SourceSet::getCompileClasspathConfigurationName,
|
||||||
SourceSet::getImplementationConfigurationName,
|
SourceSet::getImplementationConfigurationName,
|
||||||
SourceSet::getRuntimeConfigurationName,
|
SourceSet::getRuntimeClasspathConfigurationName,
|
||||||
SourceSet::getRuntimeOnlyConfigurationName
|
SourceSet::getRuntimeOnlyConfigurationName
|
||||||
);
|
);
|
||||||
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
|
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
|
||||||
|
@ -95,7 +95,7 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("does not exist, but there are dependencies"));
|
expectedException.expectMessage(containsString("does not exist, but there are dependencies"));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,10 +110,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expectMessage(containsString("Missing SHA for "));
|
expectedException.expectMessage(containsString("Missing SHA for "));
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createFileIn(licensesDir, "groovy-all-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
createFileIn(licensesDir, "groovy-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
||||||
createFileIn(licensesDir, "groovy-all-NOTICE.txt", "");
|
createFileIn(licensesDir, "groovy-NOTICE.txt", "");
|
||||||
|
|
||||||
project.getDependencies().add("compile", project.getDependencies().localGroovy());
|
project.getDependencies().add("compileClasspath", project.getDependencies().localGroovy());
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Missing LICENSE for "));
|
expectedException.expectMessage(containsString("Missing LICENSE for "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", project.getDependencies().localGroovy());
|
project.getDependencies().add("compileClasspath", project.getDependencies().localGroovy());
|
||||||
|
|
||||||
getLicensesDir(project).mkdir();
|
getLicensesDir(project).mkdir();
|
||||||
updateShas.updateShas();
|
updateShas.updateShas();
|
||||||
@ -134,9 +134,9 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Missing NOTICE for "));
|
expectedException.expectMessage(containsString("Missing NOTICE for "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
createFileIn(getLicensesDir(project), "groovy-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
||||||
|
|
||||||
updateShas.updateShas();
|
updateShas.updateShas();
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -147,10 +147,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Missing SOURCES for "));
|
expectedException.expectMessage(containsString("Missing SOURCES for "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-LICENSE.txt", STRICT_LICENSE_TEXT);
|
createFileIn(getLicensesDir(project), "groovy-LICENSE.txt", STRICT_LICENSE_TEXT);
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-NOTICE.txt", "");
|
createFileIn(getLicensesDir(project), "groovy-NOTICE.txt", "");
|
||||||
|
|
||||||
updateShas.updateShas();
|
updateShas.updateShas();
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -158,11 +158,15 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenProjectWithStrictDependencyAndEverythingInOrderThenShouldReturnSilently() throws Exception {
|
public void givenProjectWithStrictDependencyAndEverythingInOrderThenShouldReturnSilently() throws Exception {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-LICENSE.txt", STRICT_LICENSE_TEXT);
|
createFileIn(getLicensesDir(project), "groovy-LICENSE.txt", STRICT_LICENSE_TEXT);
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-NOTICE.txt", "");
|
createFileIn(getLicensesDir(project), "groovy-NOTICE.txt", "");
|
||||||
createFileIn(getLicensesDir(project), "groovy-all-SOURCES.txt", "");
|
createFileIn(getLicensesDir(project), "groovy-SOURCES.txt", "");
|
||||||
|
|
||||||
|
createFileIn(getLicensesDir(project), "javaparser-core-LICENSE.txt", STRICT_LICENSE_TEXT);
|
||||||
|
createFileIn(getLicensesDir(project), "javaparser-core-NOTICE.txt", "");
|
||||||
|
createFileIn(getLicensesDir(project), "javaparser-core-SOURCES.txt", "");
|
||||||
|
|
||||||
updateShas.updateShas();
|
updateShas.updateShas();
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -170,11 +174,11 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenProjectWithDependencyAndEverythingInOrderThenShouldReturnSilently() throws Exception {
|
public void givenProjectWithDependencyAndEverythingInOrderThenShouldReturnSilently() throws Exception {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
|
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy-all");
|
createAllDefaultDependencyFiles(licensesDir, "groovy", "javaparser-core");
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,10 +187,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Unused license "));
|
expectedException.expectMessage(containsString("Unused license "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy-all");
|
createAllDefaultDependencyFiles(licensesDir, "groovy", "javaparser-core");
|
||||||
createFileIn(licensesDir, "non-declared-LICENSE.txt", "");
|
createFileIn(licensesDir, "non-declared-LICENSE.txt", "");
|
||||||
|
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -197,10 +201,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Unused notice "));
|
expectedException.expectMessage(containsString("Unused notice "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy-all");
|
createAllDefaultDependencyFiles(licensesDir, "groovy", "javaparser-core");
|
||||||
createFileIn(licensesDir, "non-declared-NOTICE.txt", "");
|
createFileIn(licensesDir, "non-declared-NOTICE.txt", "");
|
||||||
|
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -211,10 +215,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("Unused sha files found: \n"));
|
expectedException.expectMessage(containsString("Unused sha files found: \n"));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy-all");
|
createAllDefaultDependencyFiles(licensesDir, "groovy", "javaparser-core");
|
||||||
createFileIn(licensesDir, "non-declared.sha1", "");
|
createFileIn(licensesDir, "non-declared.sha1", "");
|
||||||
|
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -225,10 +229,10 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
expectedException.expect(GradleException.class);
|
expectedException.expect(GradleException.class);
|
||||||
expectedException.expectMessage(containsString("SHA has changed! Expected "));
|
expectedException.expectMessage(containsString("SHA has changed! Expected "));
|
||||||
|
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy-all");
|
createAllDefaultDependencyFiles(licensesDir, "groovy");
|
||||||
|
|
||||||
Path groovySha = Files.list(licensesDir.toPath()).filter(file -> file.toFile().getName().contains("sha")).findFirst().get();
|
Path groovySha = Files.list(licensesDir.toPath()).filter(file -> file.toFile().getName().contains("sha")).findFirst().get();
|
||||||
|
|
||||||
@ -239,14 +243,14 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenProjectWithADependencyMappingThenShouldReturnSilently() throws Exception {
|
public void givenProjectWithADependencyMappingThenShouldReturnSilently() throws Exception {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createAllDefaultDependencyFiles(licensesDir, "groovy");
|
createAllDefaultDependencyFiles(licensesDir, "groovy", "javaparser");
|
||||||
|
|
||||||
Map<String, String> mappings = new HashMap<>();
|
Map<String, String> mappings = new HashMap<>();
|
||||||
mappings.put("from", "groovy-all");
|
mappings.put("from", "javaparser-core");
|
||||||
mappings.put("to", "groovy");
|
mappings.put("to", "javaparser");
|
||||||
|
|
||||||
task.get().mapping(mappings);
|
task.get().mapping(mappings);
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
@ -254,13 +258,30 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenProjectWithAIgnoreShaConfigurationAndNoShaFileThenShouldReturnSilently() throws Exception {
|
public void givenProjectWithAIgnoreShaConfigurationAndNoShaFileThenShouldReturnSilently() throws Exception {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File licensesDir = getLicensesDir(project);
|
File licensesDir = getLicensesDir(project);
|
||||||
createFileIn(licensesDir, "groovy-all-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
createFileIn(licensesDir, "groovy-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
||||||
createFileIn(licensesDir, "groovy-all-NOTICE.txt", "");
|
createFileIn(licensesDir, "groovy-NOTICE.txt", "");
|
||||||
|
|
||||||
|
createFileIn(licensesDir, "javaparser-core-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
||||||
|
createFileIn(licensesDir, "javaparser-core-NOTICE.txt", "");
|
||||||
|
|
||||||
|
task.get().ignoreSha("groovy");
|
||||||
|
task.get().ignoreSha("groovy-ant");
|
||||||
|
task.get().ignoreSha("groovy-astbuilder");
|
||||||
|
task.get().ignoreSha("groovy-console");
|
||||||
|
task.get().ignoreSha("groovy-datetime");
|
||||||
|
task.get().ignoreSha("groovy-dateutil");
|
||||||
|
task.get().ignoreSha("groovy-groovydoc");
|
||||||
|
task.get().ignoreSha("groovy-json");
|
||||||
|
task.get().ignoreSha("groovy-nio");
|
||||||
|
task.get().ignoreSha("groovy-sql");
|
||||||
|
task.get().ignoreSha("groovy-templates");
|
||||||
|
task.get().ignoreSha("groovy-test");
|
||||||
|
task.get().ignoreSha("groovy-xml");
|
||||||
|
task.get().ignoreSha("javaparser-core");
|
||||||
|
|
||||||
task.get().ignoreSha("groovy-all");
|
|
||||||
task.get().checkDependencies();
|
task.get().checkDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,9 +300,11 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAllDefaultDependencyFiles(File licensesDir, String dependencyName) throws IOException, NoSuchAlgorithmException {
|
private void createAllDefaultDependencyFiles(File licensesDir, String... dependencyNames) throws IOException, NoSuchAlgorithmException {
|
||||||
createFileIn(licensesDir, dependencyName + "-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
for (final String dependencyName : dependencyNames) {
|
||||||
createFileIn(licensesDir, dependencyName + "-NOTICE.txt", "");
|
createFileIn(licensesDir, dependencyName + "-LICENSE.txt", PERMISSIVE_LICENSE_TEXT);
|
||||||
|
createFileIn(licensesDir, dependencyName + "-NOTICE.txt", "");
|
||||||
|
}
|
||||||
|
|
||||||
updateShas.updateShas();
|
updateShas.updateShas();
|
||||||
}
|
}
|
||||||
@ -316,6 +339,12 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(DependencyLicensesTask dependencyLicensesTask) {
|
public void execute(DependencyLicensesTask dependencyLicensesTask) {
|
||||||
dependencyLicensesTask.setDependencies(getDependencies(project));
|
dependencyLicensesTask.setDependencies(getDependencies(project));
|
||||||
|
|
||||||
|
final Map<String, String> mappings = new HashMap<>();
|
||||||
|
mappings.put("from", "groovy-.*");
|
||||||
|
mappings.put("to", "groovy");
|
||||||
|
|
||||||
|
dependencyLicensesTask.mapping(mappings);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -323,6 +352,6 @@ public class DependencyLicensesTaskTests extends GradleUnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private FileCollection getDependencies(Project project) {
|
private FileCollection getDependencies(Project project) {
|
||||||
return project.getConfigurations().getByName("compile");
|
return project.getConfigurations().getByName("compileClasspath");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,19 +86,19 @@ public class UpdateShasTaskTests extends GradleUnitTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenDependencyExistsButShaNotThenShouldCreateNewShaFile() throws IOException, NoSuchAlgorithmException {
|
public void whenDependencyExistsButShaNotThenShouldCreateNewShaFile() throws IOException, NoSuchAlgorithmException {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
getLicensesDir(project).mkdir();
|
getLicensesDir(project).mkdir();
|
||||||
task.updateShas();
|
task.updateShas();
|
||||||
|
|
||||||
Path groovySha = Files.list(getLicensesDir(project).toPath()).findFirst().get();
|
Path groovySha = Files.list(getLicensesDir(project).toPath()).findFirst().get();
|
||||||
|
|
||||||
assertTrue(groovySha.toFile().getName().startsWith("groovy-all"));
|
assertTrue(groovySha.toFile().getName().startsWith("groovy-"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenDependencyAndWrongShaExistsThenShouldNotOverwriteShaFile() throws IOException, NoSuchAlgorithmException {
|
public void whenDependencyAndWrongShaExistsThenShouldNotOverwriteShaFile() throws IOException, NoSuchAlgorithmException {
|
||||||
project.getDependencies().add("compile", dependency);
|
project.getDependencies().add("compileClasspath", dependency);
|
||||||
|
|
||||||
File groovyJar = task.getParentTask().getDependencies().getFiles().iterator().next();
|
File groovyJar = task.getParentTask().getDependencies().getFiles().iterator().next();
|
||||||
String groovyShaName = groovyJar.getName() + ".sha1";
|
String groovyShaName = groovyJar.getName() + ".sha1";
|
||||||
@ -163,6 +163,6 @@ public class UpdateShasTaskTests extends GradleUnitTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private FileCollection getDependencies(Project project) {
|
private FileCollection getDependencies(Project project) {
|
||||||
return project.getConfigurations().getByName("compile");
|
return project.getConfigurations().getByName("compileClasspath");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,8 @@ public class GradleThreadsFilter implements ThreadFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean reject(Thread t) {
|
public boolean reject(Thread t) {
|
||||||
return t.getName().startsWith("Exec process") || t.getName().startsWith("File watcher consumer");
|
return t.getName().startsWith("Exec process")
|
||||||
|
|| t.getName().startsWith("Memory manager")
|
||||||
|
|| t.getName().startsWith("File watcher consumer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ import java.util.regex.Pattern
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "nebula.ospackage-base" version "8.3.0"
|
id "nebula.ospackage-base" version "9.0.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
void addProcessFilesTask(String type, boolean jdk) {
|
void addProcessFilesTask(String type, boolean jdk) {
|
||||||
@ -136,9 +136,9 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
|
|||||||
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
|
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
|
||||||
// Deb convention uses a '_' for final separator before architecture, rpm uses a '.'
|
// Deb convention uses a '_' for final separator before architecture, rpm uses a '.'
|
||||||
if (type == 'deb') {
|
if (type == 'deb') {
|
||||||
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-min_${project.version}${jdkString}_${archString}.${type}")) }
|
archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min_${project.version}${jdkString}_${archString}.${type}" }))
|
||||||
} else {
|
} else {
|
||||||
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDirectory.get()}/${packageName}-min-${project.version}${jdkString}.${archString}.${type}")) }
|
archiveFileName.value(project.provider({ "${destinationDirectory.get()}/${packageName}-min-${project.version}${jdkString}.${archString}.${type}" }))
|
||||||
}
|
}
|
||||||
|
|
||||||
String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"
|
String packagingFiles = "build/packaging/${jdk ? '' : 'no-jdk-'}${type}"
|
||||||
|
@ -22,6 +22,7 @@ allprojects {
|
|||||||
def codeCoverageReportTask = tasks.register("codeCoverageReport", JacocoReport) {
|
def codeCoverageReportTask = tasks.register("codeCoverageReport", JacocoReport) {
|
||||||
description = 'Generates aggregate report from all subprojects.'
|
description = 'Generates aggregate report from all subprojects.'
|
||||||
executionData.setFrom fileTree(dir: '.', include: '**/build/jacoco/*.exec')
|
executionData.setFrom fileTree(dir: '.', include: '**/build/jacoco/*.exec')
|
||||||
|
dependsOn subprojects.findAll(s -> s.tasks.findByName('check') != null).check
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("codeCoverageReportForUnitTest", JacocoReport) {
|
tasks.register("codeCoverageReportForUnitTest", JacocoReport) {
|
||||||
@ -46,10 +47,12 @@ tasks.withType(JacocoReport).configureEach {
|
|||||||
def projectsWithJavaPlugin = subprojects.findAll { it.pluginManager.hasPlugin('java') }
|
def projectsWithJavaPlugin = subprojects.findAll { it.pluginManager.hasPlugin('java') }
|
||||||
def projectsWithUnitTest = projectsWithJavaPlugin.findAll { it.tasks.findByName('test').enabled }
|
def projectsWithUnitTest = projectsWithJavaPlugin.findAll { it.tasks.findByName('test').enabled }
|
||||||
def projectsWithIntegTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('integTest')}
|
def projectsWithIntegTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('integTest')}
|
||||||
|
def projectsWithAsyncIntegTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('asyncIntegTest')}
|
||||||
def projectsWithInternalClusterTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('internalClusterTest')}
|
def projectsWithInternalClusterTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('internalClusterTest')}
|
||||||
|
def projectsWithPooledInternalClusterTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('pooledInternalClusterTest')}
|
||||||
def projectsWithJavaRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('javaRestTest')}
|
def projectsWithJavaRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('javaRestTest')}
|
||||||
def projectsWithYamlRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('yamlRestTest')}
|
def projectsWithYamlRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('yamlRestTest')}
|
||||||
def projectsWithIntegrationTest = projectsWithIntegTest + projectsWithInternalClusterTest + projectsWithJavaRestTest + projectsWithYamlRestTest
|
def projectsWithIntegrationTest = projectsWithIntegTest + projectsWithAsyncIntegTest + projectsWithInternalClusterTest + projectsWithPooledInternalClusterTest + projectsWithJavaRestTest + projectsWithYamlRestTest
|
||||||
def projectsWithTest = projectsWithUnitTest + projectsWithIntegrationTest
|
def projectsWithTest = projectsWithUnitTest + projectsWithIntegrationTest
|
||||||
|
|
||||||
def selectedProjects
|
def selectedProjects
|
||||||
@ -60,7 +63,9 @@ tasks.withType(JacocoReport).configureEach {
|
|||||||
break
|
break
|
||||||
case "codeCoverageReportForIntegrationTest":
|
case "codeCoverageReportForIntegrationTest":
|
||||||
dependsOn projectsWithIntegTest.integTest
|
dependsOn projectsWithIntegTest.integTest
|
||||||
|
dependsOn projectsWithAsyncIntegTest.asyncIntegTest
|
||||||
dependsOn projectsWithInternalClusterTest.internalClusterTest
|
dependsOn projectsWithInternalClusterTest.internalClusterTest
|
||||||
|
dependsOn projectsWithPooledInternalClusterTest.pooledInternalClusterTest
|
||||||
dependsOn projectsWithJavaRestTest.javaRestTest
|
dependsOn projectsWithJavaRestTest.javaRestTest
|
||||||
dependsOn projectsWithYamlRestTest.yamlRestTest
|
dependsOn projectsWithYamlRestTest.yamlRestTest
|
||||||
selectedProjects = projectsWithIntegrationTest
|
selectedProjects = projectsWithIntegrationTest
|
||||||
@ -68,20 +73,23 @@ tasks.withType(JacocoReport).configureEach {
|
|||||||
default:
|
default:
|
||||||
dependsOn projectsWithUnitTest.test
|
dependsOn projectsWithUnitTest.test
|
||||||
dependsOn projectsWithIntegTest.integTest
|
dependsOn projectsWithIntegTest.integTest
|
||||||
|
dependsOn projectsWithAsyncIntegTest.asyncIntegTest
|
||||||
dependsOn projectsWithInternalClusterTest.internalClusterTest
|
dependsOn projectsWithInternalClusterTest.internalClusterTest
|
||||||
|
dependsOn projectsWithPooledInternalClusterTest.pooledInternalClusterTest
|
||||||
dependsOn projectsWithJavaRestTest.javaRestTest
|
dependsOn projectsWithJavaRestTest.javaRestTest
|
||||||
dependsOn projectsWithYamlRestTest.yamlRestTest
|
dependsOn projectsWithYamlRestTest.yamlRestTest
|
||||||
selectedProjects = projectsWithTest
|
selectedProjects = projectsWithJavaPlugin
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceDirectories.setFrom files(selectedProjects.sourceSets.main.allSource.srcDirs)
|
sourceDirectories.setFrom files(selectedProjects.sourceSets.main.allSource.srcDirs)
|
||||||
classDirectories.setFrom files(selectedProjects.sourceSets.main.output)
|
classDirectories.setFrom files(selectedProjects.sourceSets.main.output)
|
||||||
|
|
||||||
reports {
|
reports {
|
||||||
// Code coverage report in HTML and CSV formats are on demand, in case they take extra disk space.
|
// Code coverage report in HTML and CSV formats are on demand, in case they take extra disk space.
|
||||||
xml.enabled System.getProperty('tests.coverage.report.xml', 'true').toBoolean()
|
xml.getRequired().set(System.getProperty('tests.coverage.report.xml', 'true').toBoolean())
|
||||||
html.enabled System.getProperty('tests.coverage.report.html', 'false').toBoolean()
|
html.getRequired().set(System.getProperty('tests.coverage.report.html', 'false').toBoolean())
|
||||||
csv.enabled System.getProperty('tests.coverage.report.csv', 'false').toBoolean()
|
csv.getRequired().set(System.getProperty('tests.coverage.report.csv', 'false').toBoolean())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import javax.annotation.Nullable
|
import javax.annotation.Nullable
|
||||||
|
import org.gradle.internal.jvm.Jvm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks for missing javadocs.
|
* Checks for missing javadocs.
|
||||||
@ -300,9 +301,7 @@ class MissingJavadocTask extends DefaultTask {
|
|||||||
|
|
||||||
def javadocCmd = {
|
def javadocCmd = {
|
||||||
if (executable == null) {
|
if (executable == null) {
|
||||||
JavaInstallationRegistry registry = project.extensions.getByType(JavaInstallationRegistry)
|
return Jvm.current().javadocExecutable
|
||||||
JavaInstallation currentJvm = registry.installationForCurrentVirtualMachine.get()
|
|
||||||
return currentJvm.jdk.get().javadocExecutable.asFile
|
|
||||||
} else {
|
} else {
|
||||||
return project.file(executable)
|
return project.file(executable)
|
||||||
}
|
}
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionSha256Sum=11657af6356b7587bfb37287b5992e94a9686d5c8a0a1b60b87b9928a2decde5
|
distributionSha256Sum=00b273629df4ce46e68df232161d5a7c4e495b9a029ce6e0420f071e21316867
|
||||||
|
@ -92,3 +92,7 @@ forbiddenPatterns {
|
|||||||
exclude '**/*.p12'
|
exclude '**/*.p12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named("bundlePlugin").configure {
|
||||||
|
dependsOn("copyParentJoinMetadata")
|
||||||
|
dependsOn("copyTransportNetty4Metadata")
|
||||||
|
}
|
||||||
|
@ -124,6 +124,13 @@ testClusters.integTest {
|
|||||||
String realm = "BUILD.OPENSEARCH.ORG"
|
String realm = "BUILD.OPENSEARCH.ORG"
|
||||||
String krb5conf = project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs")
|
String krb5conf = project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs")
|
||||||
|
|
||||||
|
|
||||||
|
project(':test:fixtures:krb5kdc-fixture').tasks.preProcessFixture {
|
||||||
|
dependsOn tasks.named("jarHell")
|
||||||
|
dependsOn tasks.named("testingConventions")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Create HDFS File System Testing Fixtures for HA/Secure combinations
|
// Create HDFS File System Testing Fixtures for HA/Secure combinations
|
||||||
for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', 'secureHaHdfsFixture']) {
|
for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', 'secureHaHdfsFixture']) {
|
||||||
def tsk = project.tasks.register(fixtureName, org.opensearch.gradle.test.AntFixture) {
|
def tsk = project.tasks.register(fixtureName, org.opensearch.gradle.test.AntFixture) {
|
||||||
|
@ -92,7 +92,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TaskProvider testJar = tasks.register("testJar", Jar) {
|
TaskProvider testJar = tasks.register("testJar", Jar) {
|
||||||
appendix 'test'
|
archiveAppendix = 'test'
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def testJar = tasks.register("testJar", Jar) {
|
def testJar = tasks.register("testJar", Jar) {
|
||||||
appendix 'test'
|
archiveAppendix = 'test'
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task testJar(type: Jar) {
|
task testJar(type: Jar) {
|
||||||
appendix 'test'
|
archiveAppendix = 'test'
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user