Skip to content

Commit

Permalink
chore(exposed): scaffold kraftx-exposed
Browse files Browse the repository at this point in the history
  • Loading branch information
LizAinslie committed Nov 6, 2024
1 parent b0a65e1 commit 40c0467
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kotlinx-coroutines = "1.9.0"
slf4j = "2.0.16"
urilib = "1.0.12"
netty = "4.1.114.Final"
exposed = "0.56.0"
hikari = "6.0.0"

[libraries]
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Expand All @@ -14,3 +16,8 @@ slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
netty-all = { module = "io.netty:netty-all", version.ref = "netty" }

urilib = { module = "com.oxyggen.net:urilib", version.ref = "urilib" }

exposed-core = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
exposed-jdbc = { module = "org.jetbrains.exposed:exposed-jdbc", version.ref = "exposed" }

hikari = { module = "com.zaxxer:HikariCP", version.ref = "hikari" }
84 changes: 84 additions & 0 deletions kraftx/exposed/build.gradle.kts
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)
}
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)
}
}
}
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
}
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ rootProject.name = "kraft"
include("core")

include("kraftx:http")
include("kraftx:exposed")

0 comments on commit 40c0467

Please sign in to comment.