Update Gradle test scripts to avoid warnings with 8.12

Closes gh-43496
This commit is contained in:
Andy Wilkinson
2024-12-16 13:18:27 +00:00
parent 3117d60ce0
commit 734040abe2
34 changed files with 104 additions and 39 deletions

View File

@@ -16,9 +16,9 @@ task('taskExists') {
}
task('distributionExists') {
def distributions = project.extensions.findByType(DistributionContainer)
doFirst {
boolean found = project.hasProperty('distributions') &&
distributions.findByName(distributionName) != null
boolean found = distributions != null && distributions.findByName(distributionName) != null
println "${distributionName} exists = ${found}"
}
}

View File

@@ -17,12 +17,15 @@ if (project.hasProperty('applyDependencyManagementPlugin')) {
}
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
task doesNotHaveDependencyManagement {
def extensions = project.extensions
doLast {
if (project.extensions.findByName('dependencyManagement') != null) {
if (extensions.findByName('dependencyManagement') != null) {
throw new GradleException('Found dependency management extension')
}
}

View File

@@ -17,7 +17,9 @@ dependencyManagement {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {
@@ -25,8 +27,9 @@ dependencies {
}
task kotlinVersion {
def properties = project.properties
doLast {
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
println "Kotlin version: ${kotlinVersion}"
}
}

View File

@@ -3,8 +3,9 @@ plugins {
}
task kotlinVersion {
def properties = project.properties
doLast {
def kotlinVersion = project.hasProperty('kotlin.version') ? project.getProperty('kotlin.version') : 'none'
def kotlinVersion = properties.getOrDefault('kotlin.version', 'none')
println "Kotlin version: ${kotlinVersion}"
}
}

View File

@@ -6,7 +6,9 @@ plugins {
apply plugin: 'io.spring.dependency-management'
repositories {
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencyManagement {

View File

@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -6,7 +6,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -7,7 +7,9 @@ apply plugin: 'org.springframework.boot.aot'
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -6,7 +6,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
configurations.all {

View File

@@ -27,7 +27,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -5,7 +5,9 @@ plugins {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -9,7 +9,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -13,7 +13,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -42,7 +42,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -20,7 +20,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -10,7 +10,9 @@ task launch(type: JavaExec) {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -9,7 +9,9 @@ bootJar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -28,7 +28,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -10,7 +10,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -14,7 +14,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -43,7 +43,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {

View File

@@ -21,7 +21,9 @@ bootWar {
repositories {
mavenCentral()
maven { url 'repository' }
maven {
url = 'repository'
}
}
dependencies {