Skip to content

Commit

Permalink
chore(deps): update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Mar 22, 2024
1 parent ee00bb1 commit 1923e94
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
32 changes: 24 additions & 8 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
private fun Map<Int, List<Int>>.ver(minor: Int, patch: Int):String = "${minor}.${this[minor]?.get(patch)}"
private fun Map<Int, List<Int>>.ver(minor: Int, patch: Int): String = "${minor}.${this[minor]?.get(patch)}"

object UtilLibs {

Expand Down Expand Up @@ -62,18 +62,22 @@ object VertxLibs {

object Version {

private val pool = mapOf(2 to (0..7).toList(), 3 to (0..6).toList(), 4 to (0..0).toList())
@JvmField val vertxCore = "4.${pool.ver(3, 5)}"
@JvmField val vertxSQL = "4.${pool.ver(3, 5)}"
const val vertxJunit = "4.2.5"
private val pool = mapOf(
2 to (0..7).toList(),
3 to (0..8).toList(),
4 to (0..8).toList(),
5 to (0..4).toList()
)
@JvmField val vertxCore = "4.${pool.ver(4, 8)}"
@JvmField val vertxSQL = vertxCore
@JvmField val vertxJunit = vertxCore
}

@JvmField val core = "io.vertx:vertx-core:${Version.vertxCore}"
@JvmField val codegen = "io.vertx:vertx-codegen:${Version.vertxCore}"
@JvmField val rx2 = "io.vertx:vertx-rx-java2:${Version.vertxCore}"
@JvmField val rx3 = "io.vertx:vertx-rx-java3:${Version.vertxCore}"
@JvmField val junit5 = "io.vertx:vertx-junit5:${Version.vertxJunit}"

@JvmField val sqlClient = "io.vertx:vertx-sql-client:${Version.vertxSQL}"
@JvmField val jdbc = "io.vertx:vertx-jdbc-client:${Version.vertxSQL}"
@JvmField val pgsql = "io.vertx:vertx-pg-client:${Version.vertxSQL}"
Expand Down Expand Up @@ -119,8 +123,15 @@ object LogLibs {
object JooqLibs {
object Version {

private val pool = mapOf(14 to (0..13).toList(), 15 to (0..10).toList(), 16 to (0..6).toList())
@JvmField val jooq = "3.${pool.ver(14 ,13)}"
private val pool = mapOf(
14 to (0..16).toList(),
15 to (0..12).toList(),
16 to (0..23).toList(),
17 to (0..22).toList(),
18 to (0..13).toList(),
19 to (0..6).toList(),
)
@JvmField val jooq = "3.${pool.ver(16, 23)}"
}

@JvmField val jooq = "org.jooq:jooq:${Version.jooq}"
Expand Down Expand Up @@ -158,6 +169,11 @@ object DatabaseLibs {
const val hsqldb = "org.hsqldb:hsqldb:${Version.hsqldb}"
}

object DatabaseContainer {
val postgres = listOf("16-alpine", "14-alpine", "12-alpine")
val mysql = listOf("8.3", "8.0", "5.7")
}

object ZeroLibs {
object Version {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@

public interface SQLTestHelper {

/**
* Get current database version by system property "{@code dbVersion}"
*
* @return the current database version
*/
static String getCurrentDBVersion(String defaultVersion) {
return System.getProperty("dbVersion", defaultVersion);
}

/**
* Prepare database schema and test data by plain JDBC connection. That use {@code HikariCP}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

import io.github.zero88.jooqx.DBContainerProvider;
import io.github.zero88.jooqx.HasDBProvider;
import io.github.zero88.jooqx.SQLTestHelper;

public interface MySQLDBProvider extends DBContainerProvider<MySQLContainer<?>>,
HasDBProvider<MySQLContainer<?>, DBContainerProvider<MySQLContainer<?>>> {

String[] SUPPORTED_IMAGES = { "5.7-debian", "8.0-debian" };

@Override
default @NotNull MySQLContainer<?> init() {
final String dbVersion = System.getProperty("dbVersion", SUPPORTED_IMAGES[1]);
final String dbVersion = System.getProperty("dbVersion", SQLTestHelper.getCurrentDBVersion("8.3"));
return initDBContainer("mysql:" + dbVersion);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@

import io.github.zero88.jooqx.DBContainerProvider;
import io.github.zero88.jooqx.HasDBProvider;
import io.github.zero88.jooqx.SQLTestHelper;

public interface PgSQLDBProvider extends DBContainerProvider<PostgreSQLContainer<?>>,
HasDBProvider<PostgreSQLContainer<?>,
DBContainerProvider<PostgreSQLContainer<?>>> {

String[] SUPPORTED_IMAGES = { "10-alpine", "12-alpine", "14-alpine" };

@Override
default @NotNull PostgreSQLContainer<?> init() {
final String dbVersion = System.getProperty("dbVersion", SUPPORTED_IMAGES[0]);
return initDBContainer("postgres:" + dbVersion);
return initDBContainer("postgres:" + SQLTestHelper.getCurrentDBVersion("16-alpine"));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion integtest/mysql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ dependencies {
testImplementation(VertxLibs.mysql)
testImplementation(TestContainers.mysql)
}
val dbImage = "mysql:${(project.findProperty("dbVersion") ?: "8.0-debian")}"
val dialect = "org.jooq.meta.mysql.MySQLDatabase"
val dbImage = "mysql:${(project.findProperty("dbVersion") ?: DatabaseContainer.mysql[0])}"
fun getSchema(schemaFile: String): String = "${buildDir}/resources/main/${schemaFile}"

jooq {
Expand Down
2 changes: 1 addition & 1 deletion integtest/pg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ dependencies {
testImplementation("com.ongres.scram:client:2.1")
}

val dbImage = "postgresql:${(project.findProperty("dbVersion") ?: "10-alpine")}"
val dialect = "org.jooq.meta.postgres.PostgresDatabase"
val dbImage = "postgresql:${(project.findProperty("dbVersion") ?: DatabaseContainer.postgres[0])}"
fun getSchema(schemaFile: String): String = "${buildDir}/resources/main/${schemaFile}"

jooq {
Expand Down

0 comments on commit 1923e94

Please sign in to comment.