Make consistent use of Property for Gradle task configuration

Closes gh-32769
This commit is contained in:
Andy Wilkinson
2022-10-19 17:29:46 +01:00
parent e5c12c2b56
commit 8621be6bba
60 changed files with 554 additions and 960 deletions

View File

@@ -9,7 +9,7 @@ version = '1.0'
springBoot {
buildInfo {
properties {
additionalProperties = [
additional = [
'a': 'alpha', 'b': 'bravo'
]
}

View File

@@ -7,7 +7,7 @@ apply plugin: 'org.graalvm.buildtools.native'
task('bootBuildImageConfiguration') {
doFirst {
println "builder = ${tasks.getByName('bootBuildImage').builder}"
println "BP_NATIVE_IMAGE = ${tasks.getByName('bootBuildImage').environment['BP_NATIVE_IMAGE']}"
println "builder = ${tasks.getByName('bootBuildImage').builder.get()}"
println "BP_NATIVE_IMAGE = ${tasks.getByName('bootBuildImage').environment.get()['BP_NATIVE_IMAGE']}"
}
}

View File

@@ -5,7 +5,6 @@ plugins {
version = '0.1.0'
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
destinationDir project.buildDir
properties {
artifact = 'foo'
group = 'foo'

View File

@@ -6,11 +6,5 @@ group = 'foo'
version = '0.1.0'
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
destinationDir project.buildDir
properties {
group = ''
artifact = ''
version = ''
name = ''
}
excludes = ['group', 'artifact', 'version', 'name']
}

View File

@@ -3,11 +3,11 @@ plugins {
}
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
excludes = ["time"]
properties {
artifact = 'example'
group = 'com.example'
name = 'example'
additional = ['additional': 'alpha']
time = null
}
}

View File

@@ -5,11 +5,11 @@ plugins {
version = '{projectVersion}'
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
excludes = ["time"]
properties {
artifact = 'example'
group = 'com.example'
name = 'example'
additional = ['additional': 'alpha']
time = null
}
}

View File

@@ -1,16 +0,0 @@
plugins {
id 'org.springframework.boot' version '{version}' apply false
}
group = 'foo'
version = '0.1.0'
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
destinationDir project.buildDir
properties {
group = null
artifact = null
version = null
name = null
}
}

View File

@@ -3,7 +3,5 @@ plugins {
}
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
properties {
time = null
}
excludes = ["time"]
}

View File

@@ -3,7 +3,5 @@ plugins {
}
task buildInfo(type: org.springframework.boot.gradle.tasks.buildinfo.BuildInfo) {
properties {
time = null
}
excludes = ["time"]
}