Skip to content

Commit 0bbaf70

Browse files
authored
Fix deprecated Gradle groovy dsl syntax on property assignments (#14780)
* Fix deprecated Gradle groovy dsl syntax on prop assignment This fixes Gradle deprecation warnings thrown for using deprecated API caused by "propName value" syntax used in Groovy dsl that relies on Gradle generated dsl extensions. * Fix formatting
1 parent 4212398 commit 0bbaf70

23 files changed

+72
-73
lines changed

build-tools/build-infra/src/main/groovy/lucene.all-projects.conventions.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ allprojects {project ->
5353

5454
// Common tasks or meta-tasks.
5555
tasks.register("tidy", {
56-
description "Applies all code formatters and other enforced cleanups to the project."
57-
group "verification"
56+
description = "Applies all code formatters and other enforced cleanups to the project."
57+
group = "verification"
5858
})
5959
}

build-tools/build-infra/src/main/groovy/lucene.datasets.external-datasets.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ configure(project(":lucene:benchmark")) {
4747
dst = file("${dataDir}/${name}")
4848
}
4949

50-
description "Download the ${ext.name} data set."
50+
description = "Download the ${ext.name} data set."
5151

5252
outputs.file ext.dst
5353

@@ -70,7 +70,7 @@ configure(project(":lucene:benchmark")) {
7070
dst = file("${dataDir}/${name}")
7171
}
7272

73-
description "Download the ${ext.name} data set."
73+
description = "Download the ${ext.name} data set."
7474

7575
outputs.file ext.dst
7676

@@ -96,7 +96,7 @@ configure(project(":lucene:benchmark")) {
9696
dst = file("${dataDir}/${name}")
9797
}
9898

99-
description "Download the ${ext.name} data set."
99+
description = "Download the ${ext.name} data set."
100100

101101
outputs.file ext.dst
102102

@@ -119,7 +119,7 @@ configure(project(":lucene:benchmark")) {
119119
dst = file("${dataDir}/${name}")
120120
}
121121

122-
description "Download the ${ext.name} data set."
122+
description = "Download the ${ext.name} data set."
123123

124124
outputs.dir ext.dst
125125

@@ -145,7 +145,7 @@ configure(project(":lucene:benchmark")) {
145145
dst = file("${dataDir}/reuters-out")
146146
}
147147

148-
description "Download the ${ext.name} data set."
148+
description = "Download the ${ext.name} data set."
149149

150150
outputs.dir ext.dst
151151

build-tools/build-infra/src/main/groovy/lucene.documentation.changes-to-html.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class ChangesToHtmlTask extends DefaultTask {
8282
def output = new ByteArrayOutputStream()
8383
def result = project.exec {
8484
executable project.externalTool("perl")
85-
standardInput changesFile.newInputStream()
86-
standardOutput project.file("${targetDir.get().getAsFile()}/Changes.html").newOutputStream()
85+
standardInput = changesFile.newInputStream()
86+
standardOutput = project.file("${targetDir.get().getAsFile()}/Changes.html").newOutputStream()
8787
errorOutput = output
8888
ignoreExitValue = true
8989

build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class ModularPathsExtension implements Cloneable, Iterable<Object> {
334334
// otherwise get terribly confused.
335335
Configuration modulePatchOnly = createModuleConfigurationForConvention(
336336
SourceSet.isMain(sourceSet) ? "patchOnly" : sourceSet.name + "PatchOnly")
337-
modulePatchOnly.canBeResolved(true)
337+
modulePatchOnly.canBeResolved = (true)
338338
moduleImplementation.extendsFrom(modulePatchOnly)
339339
this.modulePatchOnlyConfiguration = modulePatchOnly
340340

@@ -351,8 +351,8 @@ class ModularPathsExtension implements Cloneable, Iterable<Object> {
351351
Closure<Configuration> createResolvableModuleConfiguration = { String configurationName ->
352352
Configuration conventionConfiguration = configurations.maybeCreate(configurationName)
353353
Configuration moduleConfiguration = configurations.maybeCreate(moduleConfigurationNameFor(conventionConfiguration.name))
354-
moduleConfiguration.canBeConsumed(false)
355-
moduleConfiguration.canBeResolved(true)
354+
moduleConfiguration.canBeConsumed = false
355+
moduleConfiguration.canBeResolved = true
356356
ensureJarVariant(moduleConfiguration)
357357

358358
project.logger.info("Created resolvable module configuration for '${conventionConfiguration.name}': ${moduleConfiguration.name}")
@@ -565,8 +565,8 @@ class ModularPathsExtension implements Cloneable, Iterable<Object> {
565565
ConfigurationContainer configurations = project.configurations
566566
Configuration conventionConfiguration = configurations.maybeCreate(configurationName)
567567
Configuration moduleConfiguration = configurations.maybeCreate(moduleConfigurationNameFor(configurationName))
568-
moduleConfiguration.canBeConsumed(false)
569-
moduleConfiguration.canBeResolved(false)
568+
moduleConfiguration.canBeConsumed = false
569+
moduleConfiguration.canBeResolved = false
570570
conventionConfiguration.extendsFrom(moduleConfiguration)
571571

572572
project.logger.info("Created module configuration for '${conventionConfiguration.name}': ${moduleConfiguration.name}")

build-tools/build-infra/src/main/groovy/lucene.java.tests-and-randomization.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ tasks.withType(Test).configureEach {
282282
// Set up logging.
283283
testLogging {
284284
events TestLogEvent.FAILED
285-
exceptionFormat TestExceptionFormat.FULL
286-
showExceptions true
287-
showCauses true
288-
showStackTraces true
285+
exceptionFormat = TestExceptionFormat.FULL
286+
showExceptions = true
287+
showCauses = true
288+
showStackTraces = true
289289
stackTraceFilters.clear()
290-
showStandardStreams false
290+
showStandardStreams = false
291291
}
292292

293293
// Disable automatic test class detection, rely on class names only. This is needed for testing

build-tools/build-infra/src/main/groovy/lucene.publications.maven-to-nexus-releases.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ configure(rootProject.ext.mavenProjects) { Project project ->
6969
url = apacheNexusReleasesRepository
7070

7171
credentials {
72-
username asfNexusUsername.getOrElse(null)
73-
password asfNexusPassword.getOrElse(null)
72+
username = asfNexusUsername.getOrElse(null)
73+
password = asfNexusPassword.getOrElse(null)
7474
}
7575
}
7676
}

build-tools/build-infra/src/main/groovy/lucene.publications.maven-to-nexus-snapshots.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ configure(rootProject.ext.mavenProjects) { Project project ->
6767
url = apacheNexusSnapshotsRepository
6868

6969
credentials {
70-
username asfNexusUsername.getOrElse(null)
71-
password asfNexusPassword.getOrElse(null)
70+
username = asfNexusUsername.getOrElse(null)
71+
password = asfNexusPassword.getOrElse(null)
7272
}
7373
}
7474
}

build-tools/build-infra/src/main/groovy/lucene.regenerate.antlr.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
import java.nio.file.Files
1817

1918
configure(project(":lucene:expressions")) {
2019
configurations {
@@ -54,7 +53,7 @@ configure(project(":lucene:expressions")) {
5453
main = "org.antlr.v4.Tool"
5554
classpath = configurations.antlr
5655

57-
ignoreExitValue false
56+
ignoreExitValue = false
5857
args = [
5958
"-no-listener",
6059
"-visitor",

build-tools/build-infra/src/main/groovy/lucene.regenerate.extract-jdk-apis.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ configure(project(":lucene:core")) {
2121
plugins.withType(JavaPlugin) {
2222
mrjarJavaVersions.each { jdkVersion ->
2323
def task = tasks.create(name: "generateJdkApiJar${jdkVersion}", type: JavaExec) {
24-
description "Regenerate the API-only JAR file with public Panama Vector API from JDK ${jdkVersion}"
25-
group "generation"
24+
description = "Regenerate the API-only JAR file with public Panama Vector API from JDK ${jdkVersion}"
25+
group = "generation"
2626

2727
javaLauncher = javaToolchains.launcherFor {
2828
languageVersion = JavaLanguageVersion.of(jdkVersion)

build-tools/build-infra/src/main/groovy/lucene.regenerate.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ configure([
254254

255255
// Copy the description and group from the source task.
256256
project.afterEvaluate {
257-
conditionalTask.group sourceTask.group
258-
conditionalTask.description sourceTask.description + " (if sources changed)"
257+
conditionalTask.group = sourceTask.group
258+
conditionalTask.description = sourceTask.description + " (if sources changed)"
259259

260260
// Hide low-level tasks from help.
261261
sourceTask.group = null
262-
sourceTask.description sourceTask.description + " (low-level)"
262+
sourceTask.description = sourceTask.description + " (low-level)"
263263
}
264264

265265
// Set conditional execution only if checksum mismatch occurred.

0 commit comments

Comments
 (0)