-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(exposed): scaffold kraftx-exposed
- Loading branch information
1 parent
b0a65e1
commit 40c0467
Showing
6 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
plugins { | ||
kotlin("jvm") version "2.0.0" | ||
id("org.jetbrains.dokka") version "1.9.20" | ||
`maven-publish` | ||
} | ||
|
||
group = rootProject.group | ||
version = rootProject.version | ||
|
||
dependencies { | ||
implementation(project(":core")) | ||
|
||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.kotlinx.coroutines.slf4j) | ||
|
||
implementation(libs.slf4j.api) | ||
|
||
implementation(libs.exposed.core) | ||
implementation(libs.exposed.jdbc) | ||
|
||
implementation(libs.hikari) | ||
|
||
testImplementation(kotlin("test")) | ||
testImplementation(libs.kotlinx.coroutines.test) | ||
} | ||
|
||
val sourcesJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("sources") | ||
from(sourceSets.main.get().allSource) | ||
} | ||
|
||
val dokkaHtmlJar by tasks.registering(Jar::class) { | ||
dependsOn(tasks.dokkaHtml) | ||
from(tasks.dokkaHtml.flatMap { it.outputDirectory }) | ||
archiveClassifier.set("html-docs") | ||
} | ||
|
||
val dokkaJavadocJar by tasks.registering(Jar::class) { | ||
dependsOn(tasks.dokkaJavadoc) | ||
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
publishing { | ||
repositories { | ||
mavenLocal() | ||
maven { | ||
name = "frottingServicesSnapshots" | ||
url = uri("https://maven.frotting.services/snapshots") | ||
credentials(PasswordCredentials::class) | ||
authentication { | ||
create<BasicAuthentication>("basic") | ||
} | ||
} | ||
maven { | ||
name = "frottingServicesReleases" | ||
url = uri("https://maven.frotting.services/releases") | ||
credentials(PasswordCredentials::class) | ||
authentication { | ||
create<BasicAuthentication>("basic") | ||
} | ||
} | ||
} | ||
|
||
publications { | ||
create<MavenPublication>("kraftxHttp") { | ||
artifactId = "kraftx-exposed" | ||
|
||
from(components["java"]) | ||
|
||
artifact(sourcesJar.get()) | ||
artifact(dokkaHtmlJar.get()) | ||
artifact(dokkaJavadocJar.get()) | ||
|
||
pom { | ||
// todo | ||
} | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(19) | ||
} |
19 changes: 19 additions & 0 deletions
19
kraftx/exposed/src/main/kotlin/sh/illumi/kraft/x/exposed/DbManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package sh.illumi.kraft.x.exposed | ||
|
||
import com.zaxxer.hikari.HikariConfig | ||
import com.zaxxer.hikari.HikariDataSource | ||
import org.jetbrains.exposed.sql.Database | ||
|
||
sealed interface DbManager { | ||
val db: Database | ||
val isPooled: Boolean | ||
|
||
class Hikari() : DbManager { | ||
private val dataSource = HikariDataSource(HikariConfig()) | ||
|
||
override val isPooled = true | ||
override val db by lazy { | ||
Database.connect(dataSource) | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
kraftx/exposed/src/main/kotlin/sh/illumi/kraft/x/exposed/dsl/ConfigureDsl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package sh.illumi.kraft.x.exposed.dsl | ||
|
||
class ConfigureDsl { | ||
lateinit var jdbcUrl: String | ||
lateinit var driverClassName: String | ||
lateinit var username: String | ||
lateinit var password: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ rootProject.name = "kraft" | |
include("core") | ||
|
||
include("kraftx:http") | ||
include("kraftx:exposed") |