Skip to content

Commit 7aee363

Browse files
committed
feat: add support for Surf Database R2DBC dependency with relocation, update version to 1.8.0
1 parent b37366a commit 7aee363

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

surf-api-gradle-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
group = groupId
2121
version = buildString {
2222
append(mcVersion)
23-
append("-1.7.1")
23+
append("-1.8.0")
2424
if (snapshot) append("-SNAPSHOT")
2525
}
2626

surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/platform/core/CoreSurfExtension.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ open class CoreSurfExtension @Inject constructor(objects: ObjectFactory) :
1515
internal val surfRedisVersion = objects.property<String>()
1616
internal val surfRedisRelocation = objects.property<String>()
1717

18+
internal val withSurfDatabaseR2dbc = objects.property<Boolean>().convention(false)
19+
internal val surfDatabaseR2dbcVersion = objects.property<String>()
20+
internal val surfDatabaseR2dbcRelocation = objects.property<String>()
21+
1822
fun withSurfRedis(version: String, relocation: String) {
1923
withSurfRedis.set(true)
2024
withSurfRedis.finalizeValue()
@@ -24,6 +28,15 @@ open class CoreSurfExtension @Inject constructor(objects: ObjectFactory) :
2428
surfRedisRelocation.finalizeValue()
2529
}
2630

31+
fun withSurfDatabaseR2dbc(version: String, relocation: String) {
32+
withSurfDatabaseR2dbc.set(true)
33+
withSurfDatabaseR2dbc.finalizeValue()
34+
surfDatabaseR2dbcVersion.set(version)
35+
surfDatabaseR2dbcVersion.finalizeValue()
36+
surfDatabaseR2dbcRelocation.set(relocation)
37+
surfDatabaseR2dbcRelocation.finalizeValue()
38+
}
39+
2740
fun withCloudCommon() {
2841
cloudModule.set(SurfCloudModules.COMMON)
2942
}

surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/platform/core/CoreSurfPlugin.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ internal abstract class AbstractCoreSurfPlugin<E : CoreSurfExtension>(
3131
}
3232
}
3333

34+
if (extension.withSurfDatabaseR2dbc.get()) {
35+
dependencies {
36+
add(API, "dev.slne.surf:surf-database-r2dbc:${extension.surfDatabaseR2dbcVersion.get()}")
37+
}
38+
39+
tasks.withType<ShadowJar>().configureEach {
40+
doFirst {
41+
relocate("dev.slne.surf.database.r2dbc", extension.surfDatabaseR2dbcRelocation.get())
42+
}
43+
}
44+
}
45+
3446
afterEvaluated1(extension)
3547
}
3648

0 commit comments

Comments
 (0)