Skip to content

Commit 7aee0d0

Browse files
authored
Enforce fail on deprecated gradle usage (7.9 backport) (7.8 backport) (#59882)
* Enforce fail on deprecated gradle usage (7.9 backport) (#59851) * Fix branch specific gradle usage deprecations
1 parent c32024b commit 7aee0d0

File tree

9 files changed

+11
-18
lines changed

9 files changed

+11
-18
lines changed

buildSrc/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ dependencies {
133133
integTestImplementation('org.spockframework:spock-core:1.3-groovy-2.5') {
134134
exclude module:"groovy"
135135
}
136-
minimumRuntimeCompile "junit:junit:${props.getProperty('junit')}"
137-
minimumRuntimeCompile localGroovy()
138-
minimumRuntimeCompile gradleApi()
136+
minimumRuntimeImplementation "junit:junit:${props.getProperty('junit')}"
137+
minimumRuntimeImplementation localGroovy()
138+
minimumRuntimeImplementation gradleApi()
139139
}
140140

141141
/*****************************************************************************

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class PluginBuildPlugin implements Plugin<Project> {
147147
project.pluginManager.apply('nebula.maven-base-publish')
148148
// Only change Jar tasks, we don't want a -client zip so we can't change archivesBaseName
149149
project.tasks.withType(Jar) {
150-
baseName = baseName + "-client"
150+
archiveBaseName = archiveBaseName.get() + "-client"
151151
}
152152
// always configure publishing for client jars
153153
project.publishing.publications.nebula(MavenPublication).artifactId(extension.name + "-client")

buildSrc/src/minimumRuntime/java/org/elasticsearch/gradle/LoggedExec.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.gradle.api.logging.Logger;
2626
import org.gradle.api.logging.Logging;
2727
import org.gradle.api.tasks.Exec;
28-
import org.gradle.api.tasks.Internal;
2928
import org.gradle.process.BaseExecSpec;
3029
import org.gradle.process.ExecOperations;
3130
import org.gradle.process.ExecResult;
@@ -84,7 +83,6 @@ public void execute(Task task) {
8483
}
8584
}
8685

87-
@Internal
8886
public void setSpoolOutput(boolean spoolOutput) {
8987
final OutputStream out;
9088
if (spoolOutput) {

client/transport/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ dependencies {
3434
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
3535
}
3636

37-
dependencyLicenses {
38-
dependencies = project.configurations.runtime.fileCollection {
39-
it.group.startsWith('org.elasticsearch') == false
40-
}
41-
}
42-
4337
forbiddenApisTest {
4438
// we don't use the core test-framework, no lucene classes present so we don't want the es-test-signatures to
4539
// be pulled in

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ options.forkOptions.memoryMaximumSize=2g
66
# Disable duplicate project id detection
77
# See https://docs.gradle.org/current/userguide/upgrading_version_6.html#duplicate_project_names_may_cause_publication_to_fail
88
systemProp.org.gradle.dependency.duplicate.project.detection=false
9+
10+
# Enforce the build to fail on deprecated gradle api usage
11+
systemProp.org.gradle.warning.mode=fail

libs/core/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (!isEclipse) {
3939
}
4040

4141
dependencies {
42-
java11Compile sourceSets.main.output
42+
java11Implementation sourceSets.main.output
4343
}
4444

4545
compileJava11Java {
@@ -71,10 +71,6 @@ dependencies {
7171
testImplementation "junit:junit:${versions.junit}"
7272
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
7373

74-
if (!isEclipse) {
75-
java11Compile sourceSets.main.output
76-
}
77-
7874
testImplementation(project(":test:framework")) {
7975
exclude group: 'org.elasticsearch', module: 'elasticsearch-core'
8076
}

x-pack/qa/smoke-test-plugins-ssl/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ ext.expansions = [
7979

8080
processTestResources {
8181
from(sourceSets.test.resources.srcDirs) {
82+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
8283
include '**/*.yml'
8384
inputs.properties(expansions)
8485
MavenFilteringHack.filter(it, expansions)

x-pack/qa/third-party/active-directory/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ testFixtures.useFixture ":x-pack:test:smb-fixture"
1010

1111
// add test resources from security, so tests can use example certs
1212
processTestResources {
13+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
1314
from(project(xpackModule('core')).sourceSets.test.resources.srcDirs)
1415
from(project(xpackModule('security')).sourceSets.test.resources.srcDirs)
1516
}

x-pack/snapshot-tool/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ task buildTarArchive(dependsOn: copyRuntimeLibs, type: Tar) {
114114
compression Compression.GZIP
115115
archiveBaseName.set('snapshot-tool')
116116
destinationDirectory.set(project.buildDir)
117-
into "snapshot-tool-${version}", {
117+
into "snapshot-tool-${archiveVersion.get()}", {
118118
into "bin", {
119119
from file("${project.projectDir}/src/bin")
120120
}

0 commit comments

Comments
 (0)