File tree 2 files changed +11
-10
lines changed
src/main/kotlin/by/andd3dfx/build 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ abstract class Starters(
57
57
}
58
58
59
59
class SpringBootStarters (
60
- val dependencyHandlerScope : DependencyHandlerScope
60
+ val dependencyHandlerScope : DependencyHandlerScope ,
61
+ private val dependencyVersions : DependencyVersions
61
62
) : Starters(dependencyHandlerScope, " org.springframework.boot" ) {
62
63
63
64
fun springBoot () = implementation(" org.springframework.boot:spring-boot-starter" )
@@ -107,11 +108,12 @@ class SpringCloudStarters(
107
108
}
108
109
109
110
fun DependencyHandlerScope.springBoot (
110
- version : String = DependencyVersions . SPRING_BOOT ,
111
+ project : org.gradle.api. Project ,
111
112
body : SpringBootStarters .() -> Unit = {}
112
113
) {
113
- implementation(platform(" org.springframework.boot:spring-boot-dependencies:${version} " ))
114
- SpringBootStarters (this ).init (body)
114
+ val dependencyVersions = DependencyVersions (project)
115
+ implementation(platform(" org.springframework.boot:spring-boot-dependencies:${dependencyVersions.SPRING_BOOT } " ))
116
+ SpringBootStarters (this , dependencyVersions).init (body)
115
117
}
116
118
117
119
fun DependencyHandlerScope.lombok (version : String = DependencyVersions .LOMBOK ) {
Original file line number Diff line number Diff line change 1
1
package by.andd3dfx.build
2
2
3
- class DependencyVersions {
3
+ import org.gradle.api.Project
4
+
5
+ class DependencyVersions (private val project : Project ) {
4
6
companion object {
5
7
const val LOMBOK = " 1.18.30"
6
- val SPRING_BOOT : String = System .getProperty(" springBootVersion" )
7
8
const val SPRING_CLOUD = " 2023.0.0"
8
9
const val MAP_STRUCT = " 1.5.5.Final"
9
10
const val SPRING_DOC = " 1.7.0"
10
11
const val SWAGGER = " 1.6.12"
11
12
const val POSTGRES = " 42.7.1"
12
13
const val TEST_CONTAINERS = " 1.19.3"
13
14
}
14
- }
15
15
16
- class ApiVersion {
17
- companion object {
18
- }
16
+ val SPRING_BOOT : String
17
+ get() = project.property(" springBootVersion" ).toString()
19
18
}
You can’t perform that action at this time.
0 commit comments