Port the build to Gradle
Closes gh-19609 Closes gh-19608
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
application {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
|
||||
task configuredMainClass {
|
||||
doLast {
|
||||
println bootRun.main
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
application {
|
||||
mainClassName = "com.example.ExampleApplication"
|
||||
}
|
||||
// end::main-class[]
|
||||
|
||||
task("configuredMainClass") {
|
||||
doLast {
|
||||
println(tasks.getByName<BootRun>("bootRun").main)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::launch[]
|
||||
bootRun {
|
||||
optimizedLaunch = false
|
||||
}
|
||||
// end::launch[]
|
||||
|
||||
task optimizedLaunch {
|
||||
doLast {
|
||||
println bootRun.optimizedLaunch
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::launch[]
|
||||
tasks.getByName<BootRun>("bootRun") {
|
||||
isOptimizedLaunch = false
|
||||
}
|
||||
// end::launch[]
|
||||
|
||||
task("optimizedLaunch") {
|
||||
doLast {
|
||||
println(tasks.getByName<BootRun>("bootRun").isOptimizedLaunch)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::main[]
|
||||
bootRun {
|
||||
main = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main[]
|
||||
|
||||
task configuredMainClass {
|
||||
doLast {
|
||||
println bootRun.main
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::main[]
|
||||
tasks.getByName<BootRun>("bootRun") {
|
||||
main = "com.example.ExampleApplication"
|
||||
}
|
||||
// end::main[]
|
||||
|
||||
task("configuredMainClass") {
|
||||
doLast {
|
||||
println(tasks.getByName<BootRun>("bootRun").main)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::source-resources[]
|
||||
bootRun {
|
||||
sourceResources sourceSets.main
|
||||
}
|
||||
// end::source-resources[]
|
||||
|
||||
task configuredClasspath {
|
||||
doLast {
|
||||
println bootRun.classpath.files
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::source-resources[]
|
||||
tasks.getByName<BootRun>("bootRun") {
|
||||
sourceResources(sourceSets["main"])
|
||||
}
|
||||
// end::source-resources[]
|
||||
|
||||
task("configuredClasspath") {
|
||||
doLast {
|
||||
println(tasks.getByName<BootRun>("bootRun").classpath.files)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.springframework.boot' version '{version}'
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClassName = 'com.example.ExampleApplication'
|
||||
}
|
||||
// end::main-class[]
|
||||
|
||||
task configuredMainClass {
|
||||
doLast {
|
||||
println bootRun.main
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import org.springframework.boot.gradle.tasks.run.BootRun
|
||||
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
id("org.springframework.boot") version "{version}"
|
||||
}
|
||||
|
||||
// tag::main-class[]
|
||||
springBoot {
|
||||
mainClassName = "com.example.ExampleApplication"
|
||||
}
|
||||
// end::main-class[]
|
||||
|
||||
task("configuredMainClass") {
|
||||
doLast {
|
||||
println(tasks.getByName<BootRun>("bootRun").main)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user