Skip to content

Commit

Permalink
Migrate to libs.versions.toml, upgrade dependencies (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrw authored Jan 13, 2024
1 parent 018440a commit 3678b6f
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 181 deletions.
14 changes: 6 additions & 8 deletions armeria/dashboard-search-table/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import hotwire_kt.Dependencies

plugins {
id("org.jetbrains.kotlin.jvm")
id("com.github.johnrengelman.shadow")
Expand All @@ -19,13 +17,13 @@ dependencies {
implementation(projects.hotwireKt.kotlinxHtmlTemplates)
implementation(projects.hotwireKt.tailwindsUi)

implementation(Dependencies.kotlinxHtml)
implementation(Dependencies.okio)
implementation(Dependencies.moshiCore)
implementation(Dependencies.moshiKotlin)
implementation(Dependencies.wispLogging)
implementation(libs.kotlinxHtml)
implementation(libs.okio)
implementation(libs.moshiCore)
implementation(libs.moshiKotlin)
implementation(libs.wispLogging)

implementation(platform(Dependencies.armeriaBom))
implementation(platform(libs.armeriaBom))
implementation("com.linecorp.armeria:armeria-grpc")
}

Expand Down
12 changes: 5 additions & 7 deletions armeria/full-spec/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import hotwire_kt.Dependencies

plugins {
id("org.jetbrains.kotlin.jvm")
id("com.github.johnrengelman.shadow")
Expand All @@ -19,12 +17,12 @@ dependencies {
implementation(projects.hotwireKt.kotlinxHtmlTemplates)
implementation(projects.hotwireKt.tailwindsUi)

implementation(Dependencies.mustacheCompiler)
implementation(Dependencies.kotlinxHtml)
implementation(Dependencies.okio)
implementation(Dependencies.wispLogging)
implementation(libs.mustacheCompiler)
implementation(libs.kotlinxHtml)
implementation(libs.okio)
implementation(libs.wispLogging)

implementation(platform(Dependencies.armeriaBom))
implementation(platform(libs.armeriaBom))
implementation("com.linecorp.armeria:armeria-grpc")
}

Expand Down
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ buildscript {
}

dependencies {
classpath(hotwire_kt.Dependencies.kotlinAllOpenPlugin)
classpath(hotwire_kt.Dependencies.kotlinGradlePlugin)
classpath(hotwire_kt.Dependencies.junitGradlePlugin)
classpath(hotwire_kt.Dependencies.shadowJarPlugin)
classpath(hotwire_kt.Dependencies.sqldelightGradle)
classpath(hotwire_kt.Dependencies.wireGradlePlugin)
classpath(libs.kotlinAllOpenPlugin)
classpath(libs.kotlinGradlePlugin)
classpath(libs.junitGradlePlugin)
classpath(libs.shadowJarPlugin)
classpath(libs.sqldelightGradle)
classpath(libs.wireGradlePlugin)
}
}

Expand Down
7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

5 changes: 0 additions & 5 deletions buildSrc/settings.gradle.kts

This file was deleted.

88 changes: 0 additions & 88 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

42 changes: 42 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[versions]

misk = "2023.12.01.175902-d977e5a"
kotlin = "1.9.20"
moshi = "1.13.0"
okio = "3.6.0"
sqldelight = "2.0.1"
wire = "4.9.3"

[libraries]
armeriaBom = { module = "com.linecorp.armeria:armeria-bom", version = "1.11.0" }
junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.9.1" }
junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version = "5.9.1" }
junitGradlePlugin = { module = "org.junit.platform:junit-platform-gradle-plugin", version = "1.2.0" }
kotlinAllOpenPlugin = { module = "org.jetbrains.kotlin:kotlin-allopen", version.ref = "kotlin" }
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlinxHtml = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version = "0.8.1" }
logbackClassic = { module = "ch.qos.logback:logback-classic", version = "1.4.14" }
misk = { module = "com.squareup.misk:misk", version.ref = "misk" }
miskActions = { module = "com.squareup.misk:misk-actions", version.ref = "misk" }
miskAdmin = { module = "com.squareup.misk:misk-admin", version.ref = "misk" }
miskCore = { module = "com.squareup.misk:misk-core", version.ref = "misk" }
miskFeature = { module = "com.squareup.misk:misk-feature", version.ref = "misk" }
miskInject = { module = "com.squareup.misk:misk-inject", version.ref = "misk" }
miskJdbc = { module = "com.squareup.misk:misk-jdbc", version.ref = "misk" }
miskService = { module = "com.squareup.misk:misk-service", version.ref = "misk" }
miskTesting = { module = "com.squareup.misk:misk-testing", version.ref = "misk" }
moshiCore = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshiKotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
mustacheCompiler = { module = "com.github.spullara.mustache.java:compiler", version = "0.9.5" }
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
shadowJarPlugin = { module = "gradle.plugin.com.github.johnrengelman:shadow", version = "7.1.2" }
sqldelightGradle = { module = "app.cash.sqldelight:app.cash.sqldelight.gradle.plugin", version.ref = "sqldelight" }
sqldelightJdbc = { module = "org.xerial:sqlite-jdbc", version = "3.39.3.0" }
sqldelightJdbcDriver = { module = "app.cash.sqldelight:jdbc-driver", version.ref = "sqldelight" }
sqldelightMysqlDialect = { module = "app.cash.sqldelight:mysql-dialect", version.ref = "sqldelight" }
wireGradlePlugin = { module = "com.squareup.wire:wire-gradle-plugin", version.ref = "wire" }
wispConfig = { module = "app.cash.wisp:wisp-config", version.ref = "misk" }
wispDeployment = { module = "app.cash.wisp:wisp-deployment", version.ref = "misk" }
wispLogging = { module = "app.cash.wisp:wisp-logging", version.ref = "misk" }
wispMoshi = { module = "app.cash.wisp:wisp-moshi", version.ref = "misk" }
6 changes: 2 additions & 4 deletions hotwire-kt/kotlinx-html-templates/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import hotwire_kt.Dependencies

plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.kotlin.plugin.allopen")
}

dependencies {
api(Dependencies.kotlinxHtml)
api(Dependencies.miskActions)
api(libs.kotlinxHtml)
api(libs.miskActions)
}
4 changes: 1 addition & 3 deletions hotwire-kt/tailwinds-ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import hotwire_kt.Dependencies

plugins {
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.kotlin.plugin.allopen")
}

dependencies {
api(projects.hotwireKt.kotlinxHtmlTemplates)
implementation(Dependencies.kotlinxHtml)
implementation(libs.kotlinxHtml)
}
26 changes: 12 additions & 14 deletions misk-db/feature-sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import hotwire_kt.Dependencies

plugins {
id("app.cash.sqldelight")
id("com.squareup.wire")
Expand All @@ -15,18 +13,18 @@ application {
dependencies {
implementation(projects.miskDb.feature)

implementation(Dependencies.logbackClassic)
implementation(Dependencies.misk)
implementation(Dependencies.miskAdmin)
implementation(Dependencies.miskCore)
implementation(Dependencies.miskFeature)
implementation(Dependencies.miskInject)
implementation(Dependencies.wispConfig)
implementation(libs.logbackClassic)
implementation(libs.misk)
implementation(libs.miskAdmin)
implementation(libs.miskCore)
implementation(libs.miskFeature)
implementation(libs.miskInject)
implementation(libs.wispConfig)

// Database
implementation(Dependencies.miskJdbc)
implementation(Dependencies.sqldelightJdbc)
implementation(Dependencies.sqldelightJdbcDriver)
implementation(libs.miskJdbc)
implementation(libs.sqldelightJdbc)
implementation(libs.sqldelightJdbcDriver)
}

wire {
Expand All @@ -50,9 +48,9 @@ wire {
sqldelight {
databases {
create("FlagpoleDatabase") {
dialect(Dependencies.sqldelightMysqlDialect)
dialect(libs.sqldelightMysqlDialect)
packageName.set("misk.db.flagpole.db")
sourceFolders.set(listOf("sqldelight", "resources/db-migrations"))
srcDirs(listOf("src/main/sqldelight", "src/main/resources/db-migrations"))
deriveSchemaFromMigrations.set(true)
migrationOutputDirectory.set(file("$buildDir/resources/main/db-migrations"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private const val SERVICE_NAME = "flagpole"

fun main(args: Array<String>) {
val deployment = DEVELOPMENT
// FlagpoleLogging.configure()
FlagpoleLogging.configure()
val config = MiskConfig.load<FlagpoleConfig>(SERVICE_NAME, deployment)
MiskApplication(
MiskRealServiceModule(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class FlagpolePersistenceModule(
return connection
}

override fun notifyListeners(queryKeys: Array<String>) {
override fun notifyListeners(vararg queryKeys: String) {
}

override fun removeListener(listener: Query.Listener, queryKeys: Array<String>) {
override fun removeListener(vararg queryKeys: String, listener: Query.Listener) {
}

override fun addListener(listener: Query.Listener, queryKeys: Array<String>) {
override fun addListener(vararg queryKeys: String, listener: Query.Listener) {
}

override fun closeConnection(connection: Connection) {
Expand Down
44 changes: 21 additions & 23 deletions misk-db/feature/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import hotwire_kt.Dependencies

plugins {
`java-library`
id("app.cash.sqldelight")
Expand All @@ -8,20 +6,20 @@ plugins {

dependencies {
// Basic Misk libraries
api(Dependencies.miskActions)
api(Dependencies.miskAdmin)
api(Dependencies.miskFeature)
api(Dependencies.miskInject)
api(Dependencies.wispDeployment)
api(Dependencies.wispLogging)
api(Dependencies.wispMoshi)
implementation(Dependencies.miskCore)
implementation(Dependencies.miskService)
api(libs.miskActions)
api(libs.miskAdmin)
api(libs.miskFeature)
api(libs.miskInject)
api(libs.wispDeployment)
api(libs.wispLogging)
api(libs.wispMoshi)
implementation(libs.miskCore)
implementation(libs.miskService)

// Database
implementation(Dependencies.miskJdbc)
implementation(Dependencies.sqldelightJdbc)
implementation(Dependencies.sqldelightJdbcDriver)
implementation(libs.miskJdbc)
implementation(libs.sqldelightJdbc)
implementation(libs.sqldelightJdbcDriver)

// ui
api(projects.hotwireKt.kotlinxHtmlTemplates)
Expand All @@ -30,14 +28,14 @@ dependencies {
// testing
testImplementation(projects.miskDb.featureSample)

testImplementation(Dependencies.junitApi)
testImplementation(Dependencies.kotlinTest)
testImplementation(Dependencies.misk)
testImplementation(Dependencies.miskAdmin)
testImplementation(testFixtures(Dependencies.miskJdbc))
testImplementation(Dependencies.miskTesting)
testImplementation(libs.junitApi)
testImplementation(libs.kotlinTest)
testImplementation(libs.misk)
testImplementation(libs.miskAdmin)
testImplementation(testFixtures(libs.miskJdbc))
testImplementation(libs.miskTesting)

testRuntimeOnly(Dependencies.junitEngine)
testRuntimeOnly(libs.junitEngine)
}

sourceSets {
Expand Down Expand Up @@ -74,9 +72,9 @@ wire {
sqldelight {
databases {
create("FeatureDatabase") {
dialect(Dependencies.sqldelightMysqlDialect)
dialect(libs.sqldelightMysqlDialect)
packageName.set("misk.db")
sourceFolders.set(listOf("sqldelight", "sqldelight-migrations"))
srcDirs(listOf("src/main/sqldelight", "src/main/sqldelight-migrations"))
deriveSchemaFromMigrations.set(true)
}
}
Expand Down
Loading

0 comments on commit 3678b6f

Please sign in to comment.