Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.7.x
Browse files Browse the repository at this point in the history
Closes gh-30058
  • Loading branch information
wilkinsona committed Mar 3, 2022
2 parents 4846be9 + 2ba8b49 commit 4459fb4
Show file tree
Hide file tree
Showing 62 changed files with 139 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
apply(plugin = "io.spring.dependency-management")
// end::apply[]

task("verify") {
tasks.register("verify") {
doLast {
project.plugins.getPlugin(JavaPlugin::class)
project.plugins.getPlugin(io.spring.gradle.dependencymanagement.DependencyManagementPlugin::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ the<DependencyManagementExtension>().apply {
}
}

task("slf4jVersion") {
tasks.register("slf4jVersion") {
doLast {
println(project.the<DependencyManagementExtension>().managedVersions["org.slf4j:slf4j-api"])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::builder[]
bootBuildImage {
tasks.named("bootBuildImage") {
builder = "mine/java-cnb-builder"
runImage = "mine/java-cnb-run"
}
// end::builder[]

task bootBuildImageBuilder {
tasks.register("bootBuildImageBuilder") {
doFirst {
println("builder=${tasks.bootBuildImage.builder}")
println("runImage=${tasks.bootBuildImage.runImage}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {
id("org.springframework.boot") version "{gradle-project-version}"
}

tasks.getByName<BootJar>("bootJar") {
tasks.named<BootJar>("bootJar") {
mainClass.set("com.example.ExampleApplication")
}

// tag::builder[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
builder = "mine/java-cnb-builder"
runImage = "mine/java-cnb-run"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

// tag::buildpacks[]
bootBuildImage {
tasks.named("bootBuildImage") {
buildpacks = ["file:///path/to/example-buildpack.tgz", "urn:cnb:builder:paketo-buildpacks/java"]
}
// end::buildpacks[]

task bootBuildImageBuildpacks {
tasks.register("bootBuildImageBuildpacks") {
doFirst {
bootBuildImage.buildpacks.each { reference -> println "$reference" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

// tag::buildpacks[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
buildpacks = listOf("file:///path/to/example-buildpack.tgz", "urn:cnb:builder:paketo-buildpacks/java")
}
// end::buildpacks[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::caches[]
bootBuildImage {
tasks.named("bootBuildImage") {
buildCache {
volume {
name = "cache-${rootProject.name}.build"
Expand All @@ -22,7 +22,7 @@ bootBuildImage {
}
// end::caches[]

task bootBuildImageCaches {
tasks.register("bootBuildImageCaches") {
doFirst {
bootBuildImage.buildCache.asCache().with { println "buildCache=$name" }
bootBuildImage.launchCache.asCache().with { println "launchCache=$name" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

// tag::caches[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
buildCache {
volume {
name = "cache-${rootProject.name}.build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::docker-auth-token[]
bootBuildImage {
tasks.named("bootBuildImage") {
docker {
builderRegistry {
token = "9cbaf023786cd7..."
Expand All @@ -17,7 +17,7 @@ bootBuildImage {
}
// end::docker-auth-token[]

task bootBuildImageDocker {
tasks.register("bootBuildImageDocker") {
doFirst {
println("token=${tasks.bootBuildImage.docker.builderRegistry.token}")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {
id("org.springframework.boot") version "{gradle-project-version}"
}

tasks.getByName<BootJar>("bootJar") {
tasks.named<BootJar>("bootJar") {
mainClass.set("com.example.ExampleApplication")
}

// tag::docker-auth-token[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
docker {
builderRegistry {
token = "9cbaf023786cd7..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::docker-auth-user[]
bootBuildImage {
tasks.named("bootBuildImage") {
docker {
builderRegistry {
username = "user"
Expand All @@ -20,7 +20,7 @@ bootBuildImage {
}
// end::docker-auth-user[]

task bootBuildImageDocker {
tasks.register("bootBuildImageDocker") {
doFirst {
println("username=${tasks.bootBuildImage.docker.builderRegistry.username}")
println("password=${tasks.bootBuildImage.docker.builderRegistry.password}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {
id("org.springframework.boot") version "{gradle-project-version}"
}

tasks.getByName<BootJar>("bootJar") {
tasks.named<BootJar>("bootJar") {
mainClass.set("com.example.ExampleApplication")
}

// tag::docker-auth-user[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
docker {
builderRegistry {
username = "user"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::docker-host[]
bootBuildImage {
tasks.named("bootBuildImage") {
docker {
host = "tcp://192.168.99.100:2376"
tlsVerify = true
Expand All @@ -17,7 +17,7 @@ bootBuildImage {
}
// end::docker-host[]

task bootBuildImageDocker {
tasks.register("bootBuildImageDocker") {
doFirst {
println("host=${tasks.bootBuildImage.docker.host}")
println("tlsVerify=${tasks.bootBuildImage.docker.tlsVerify}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {
id("org.springframework.boot") version "{gradle-project-version}"
}

tasks.getByName<BootJar>("bootJar") {
tasks.named<BootJar>("bootJar") {
mainClass.set("com.example.ExampleApplication")
}

// tag::docker-host[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
docker {
host = "tcp://192.168.99.100:2376"
isTlsVerify = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ plugins {
}

// tag::env[]
bootBuildImage {
tasks.named("bootBuildImage") {
environment = [
"HTTP_PROXY" : "http://proxy.example.com",
"HTTPS_PROXY": "https://proxy.example.com"
]
}
// end::env[]

task bootBuildImageEnvironment {
tasks.register("bootBuildImageEnvironment") {
doFirst {
bootBuildImage.environment.each { name, value -> println "$name=$value" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

// tag::env[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
environment = mapOf("HTTP_PROXY" to "http://proxy.example.com",
"HTTPS_PROXY" to "https://proxy.example.com")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::env-runtime[]
bootBuildImage {
tasks.named("bootBuildImage") {
environment = [
"BPE_DELIM_JAVA_TOOL_OPTIONS" : " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS" : "-XX:+HeapDumpOnOutOfMemoryError"
]
}
// end::env-runtime[]

task bootBuildImageEnvironment {
tasks.register("bootBuildImageEnvironment") {
doFirst {
bootBuildImage.environment.each { name, value -> println "$name=$value" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

// tag::env-runtime[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
environment = mapOf(
"BPE_DELIM_JAVA_TOOL_OPTIONS" to " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS" to "-XX:+HeapDumpOnOutOfMemoryError"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

// tag::env[]
bootBuildImage {
tasks.named("bootBuildImage") {
environment = ["BP_JVM_VERSION" : "8.*"]
}
// end::env[]

task bootBuildImageEnvironment {
tasks.register("bootBuildImageEnvironment") {
doFirst {
bootBuildImage.environment.each { name, value -> println "$name=$value" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

// tag::env[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
environment = mapOf("BP_JVM_VERSION" to "8.*")
}
// end::env[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {
}

// tag::image-name[]
bootBuildImage {
tasks.named("bootBuildImage") {
imageName = "example.com/library/${project.name}"
}
// end::image-name[]

task bootBuildImageName {
doFirst {
println(tasks.bootBuildImage.imageName)
}
tasks.register("bootBuildImageName") {
doFirst {
println(tasks.bootBuildImage.imageName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ plugins {
}

// tag::image-name[]
tasks.getByName<BootBuildImage>("bootBuildImage") {
tasks.named<BootBuildImage>("bootBuildImage") {
imageName = "example.com/library/${project.name}"
}
// end::image-name[]

tasks.register("bootBuildImageName") {
doFirst {
println(tasks.getByName<BootBuildImage>("bootBuildImage").imageName)
}
doFirst {
println(tasks.getByName<BootBuildImage>("bootBuildImage").imageName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ plugins {
id 'org.springframework.boot' version '{gradle-project-version}'
}

bootJar {
tasks.named("bootJar") {
mainClass = 'com.example.ExampleApplication'
}

// tag::publish[]
bootBuildImage {
tasks.named("bootBuildImage") {
imageName = "docker.example.com/library/${project.name}"
publish = true
docker {
Expand All @@ -22,8 +22,8 @@ bootBuildImage {
}
// end::publish[]

task bootBuildImagePublish {
doFirst {
println(tasks.bootBuildImage.publish)
}
tasks.register("bootBuildImagePublish") {
doFirst {
println(tasks.bootBuildImage.publish)
}
}

0 comments on commit 4459fb4

Please sign in to comment.