Skip to content

Commit

Permalink
Create modules/subprojects to split code into, and move the example a…
Browse files Browse the repository at this point in the history
…nd benchmark code into the module "integrated"

IntelliJ IDEA Code Analysis shows there are 5 errors.
  • Loading branch information
ShreckYe committed Nov 15, 2024
1 parent eef978f commit c534750
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 29 deletions.
12 changes: 1 addition & 11 deletions buildSrc/src/main/kotlin/conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import com.huanshankeji.team.`Shreck Ye`
import com.huanshankeji.team.pomForTeamDefaultOpenSource
import com.huanshankeji.team.repositoriesAddTeamGithubPackagesMavenRegistry
import org.gradle.kotlin.dsl.repositories

plugins {
id("com.huanshankeji.team.with-group")
id("com.huanshankeji.kotlin-jvm-library-sonatype-ossrh-publish-conventions")
id("com.huanshankeji.team.default-github-packages-maven-publish")
kotlin("jvm")
}

repositories {
Expand All @@ -18,9 +14,3 @@ repositoriesAddTeamGithubPackagesMavenRegistry("kotlin-common")
kotlin.jvmToolchain(8)

version = projectVersion

publishing.publications.getByName<MavenPublication>("maven") {
pomForTeamDefaultOpenSource(project, "Exposed Vert.x SQL Client", "Exposed on top of Vert.x Reactive SQL Client") {
`Shreck Ye`()
}
}
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/lib-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import com.huanshankeji.team.`Shreck Ye`
import com.huanshankeji.team.pomForTeamDefaultOpenSource

plugins {
id("conventions")
id("com.huanshankeji.kotlin-jvm-library-sonatype-ossrh-publish-conventions")
id("com.huanshankeji.team.default-github-packages-maven-publish")
id("com.huanshankeji.team.dokka.github-dokka-convention")
}

publishing.publications.getByName<MavenPublication>("maven") {
pomForTeamDefaultOpenSource(project, "Exposed Vert.x SQL Client", "Exposed on top of Vert.x Reactive SQL Client") {
`Shreck Ye`()
}
}
19 changes: 3 additions & 16 deletions lib/build.gradle.kts → core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
conventions
id("com.huanshankeji.benchmark.kotlinx-benchmark-jvm-conventions")
id("com.huanshankeji.team.dokka.github-dokka-convention")
`lib-conventions`
}

dependencies {
api(commonDependencies.exposed.core()) // TODO: use `implementation` when possible
// TODO: remove the Exposed JDBC dependency and the PostgresSQL dependency when there is no need to to generate SQLs with an Exposed transaction
runtimeOnly(commonDependencies.exposed.module("jdbc"))
api(commonDependencies.kotlinCommon.exposed())
implementation("com.huanshankeji:exposed-adt-mapping:${DependencyVersions.exposedAdtMapping}")
implementation("com.huanshankeji:exposed-adt-mapping:${DependencyVersions.exposedAdtMapping}") // TODO remove when code is moved out

with(commonDependencies.vertx) {
implementation(platformStackDepchain())
Expand All @@ -25,20 +23,9 @@ dependencies {
implementation(commonDependencies.kotlinCommon.net())
}


// TODO remove when code is moved out
// for PostgreSQL
dependencies {
runtimeOnly(commonDependencies.postgreSql())
implementation(commonDependencies.vertx.moduleWithoutVersion("pg-client"))
}

afterEvaluate {
// for the benchmarks
dependencies {
with(commonDependencies.testContainers) {
"benchmarksImplementation"(platformBom())
"benchmarksImplementation"(postgreSql)
}
"benchmarksImplementation"(commonDependencies.slf4j.simple())
}
}
3 changes: 3 additions & 0 deletions integrated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The integrated module

This module includes tests, benchmarks, and examples.
28 changes: 28 additions & 0 deletions integrated/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import com.huanshankeji.cpnProject

plugins {
conventions
id("com.huanshankeji.benchmark.kotlinx-benchmark-jvm-conventions")
}

dependencies {
with(commonDependencies.vertx) { implementation(platformStackDepchain()) } // needed

implementation(cpnProject(project, ":core"))

testImplementation("com.huanshankeji:exposed-adt-mapping:${DependencyVersions.exposedAdtMapping}")
testImplementation(cpnProject(project, ":sql-dsl-with-mapper"))
}

afterEvaluate {
// for the benchmarks
dependencies {
"benchmarksImplementation"(cpnProject(project, ":postgresql"))

with(commonDependencies.testContainers) {
"benchmarksImplementation"(platformBom())
"benchmarksImplementation"(postgreSql)
}
"benchmarksImplementation"(commonDependencies.slf4j.simple())
}
}
13 changes: 13 additions & 0 deletions postgresql/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import com.huanshankeji.cpnProject

plugins {
`lib-conventions`
}

dependencies {
with(commonDependencies.vertx) { implementation(platformStackDepchain()) } // needed
implementation(cpnProject(project, ":core"))

runtimeOnly(commonDependencies.postgreSql())
implementation(commonDependencies.vertx.moduleWithoutVersion("pg-client"))
}
14 changes: 12 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
rootProject.name = "exposed-vertx-sql-client"
include("lib")
project(":lib").name = rootProject.name + "-postgresql"

include("core")
include("sql-dsl-with-mapper")
include("postgresql")
include("integrated")

fun ProjectDescriptor.setProjectConcatenatedNames(prefix: String) {
name = prefix + name
for (child in children)
child.setProjectConcatenatedNames("$name-")
}
rootProject.setProjectConcatenatedNames("")

// for Dokka
@Suppress("UnstableApiUsage")
Expand Down
10 changes: 10 additions & 0 deletions sql-dsl-with-mapper/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import com.huanshankeji.cpnProject

plugins {
`lib-conventions`
}

dependencies {
with(commonDependencies.vertx) { implementation(platformStackDepchain()) } // needed
implementation(cpnProject(project, ":core"))
}

0 comments on commit c534750

Please sign in to comment.