Skip to content

Commit

Permalink
Move dependency configuration to Gradle TOML version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorbg committed Jul 1, 2022
1 parent 9f02aec commit 67ae5e0
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 281 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ buildscript {
}

dependencies {
classpath(PROGUARD_GRADLE)
classpath(GOOGLE_APPENGINE_GRADLE)
classpath(KOTLINX_ATOMICFU_GRADLE)
classpath(libs.proguard.gradle)
classpath(libs.google.appengine.gradle)
classpath(libs.kotlinx.atomicfu.gradle)
}
}

Expand All @@ -28,8 +28,8 @@ allprojects {
}

plugins {
KOTLIN_JVM apply false
DEPENDENCY_VERSIONS
kotlin("jvm") version libs.versions.kotlin apply false
alias(libs.plugins.dependency.versions)
}

val releasePrefix = "TNoodle-WCA"
Expand Down
7 changes: 5 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ repositories {
}

dependencies {
implementation("org.bouncycastle:bcprov-jdk15on:1.69")
implementation("org.eclipse.jgit:org.eclipse.jgit:5.11.0.202103091610-r")
implementation(libs.bouncycastle)
implementation(libs.eclipse.jgit)

// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
61 changes: 0 additions & 61 deletions buildSrc/src/main/kotlin/PluginsHack.kt

This file was deleted.

10 changes: 6 additions & 4 deletions buildSrc/src/main/kotlin/configurations/Frameworks.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package configurations

import dependencies.Libraries.JUNIT_JUPITER_API
import dependencies.Libraries.JUNIT_JUPITER_ENGINE
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Project
import org.gradle.api.plugins.quality.Checkstyle
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType

object Frameworks {
Expand All @@ -16,9 +16,11 @@ object Frameworks {
}

fun Project.configureJUnit5() {
val libs = the<LibrariesForLibs>()

dependencies {
add("testImplementation", JUNIT_JUPITER_API)
add("testRuntimeOnly", JUNIT_JUPITER_ENGINE)
add("testImplementation", libs.junit.jupiter.api)
add("testRuntimeOnly", libs.junit.jupiter.engine)
}

tasks.withType<Test> {
Expand Down
43 changes: 0 additions & 43 deletions buildSrc/src/main/kotlin/dependencies/Libraries.kt

This file was deleted.

35 changes: 0 additions & 35 deletions buildSrc/src/main/kotlin/dependencies/Plugins.kt

This file was deleted.

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

This file was deleted.

16 changes: 6 additions & 10 deletions cloudscrambles/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import configurations.CompilerSettings.KOTLIN_JVM_TARGET
import configurations.Languages.attachRemoteRepositories
import configurations.ProjectVersions.tNoodleImplOrDefault
import configurations.ProjectVersions.tNoodleVersionOrDefault
import dependencies.Libraries.BATIK_TRANSCODER
import dependencies.Libraries.BATIK_CODEC
import dependencies.Libraries.GOOGLE_CLOUD_STORAGE
import dependencies.Libraries.KOTLESS_KTOR
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

description = "An extension over the core server to expose scrambles in a Google Cloud environment"
Expand All @@ -15,19 +11,19 @@ attachRemoteRepositories()
plugins {
kotlin("jvm")
war
KOTLIN_SERIALIZATION
GOOGLE_APPENGINE
alias(libs.plugins.kotlin.serialization)
id("com.google.cloud.tools.appengine")
//KOTLESS
}

dependencies {
implementation(project(":tnoodle-server"))

//implementation(KOTLESS_KTOR)
implementation(GOOGLE_CLOUD_STORAGE)
implementation(BATIK_TRANSCODER)
//implementation(libs.kotless.ktor)
implementation(libs.google.cloud.storage)
implementation(libs.batik.transcoder)

runtimeOnly(BATIK_CODEC)
runtimeOnly(libs.batik.codec)
}

tasks.withType<KotlinCompile> {
Expand Down
58 changes: 58 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[versions]
kotlin = "1.6.21"
ktor = "2.0.3"
kotless = "0.1.6"
junit-jupiter = "5.8.2"
batik = "1.14"

nodejs = "16.15.1"

[libraries]
markdownj-core = { module = "org.markdownj:markdownj-core", version = "0.4" }
zip4j = { module = "net.lingala.zip4j:zip4j", version = "2.11.1" }
itextpdf = { module = "com.itextpdf:itextpdf", version = "5.5.13.3" }
batik-transcoder = { module = "org.apache.xmlgraphics:batik-transcoder", version.ref = "batik" }
batik-codec = { module = "org.apache.xmlgraphics:batik-codec", version.ref = "batik" }
snakeyaml = { module = "org.yaml:snakeyaml", version = "1.30" }
system-tray = { module = "com.dorkbox:SystemTray", version = "4.1" }
bouncycastle = { module = "org.bouncycastle:bcprov-jdk15on", version = "1.70" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.3.3" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.3" }
kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version = "0.17.2" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" }
ktor-server-servlet = { module = "io.ktor:ktor-server-servlet", version.ref = "ktor" }
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" }
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" }
ktor-server-default-headers = { module = "io.ktor:ktor-server-default-headers", version.ref = "ktor" }
ktor-server-status-pages = { module = "io.ktor:ktor-server-status-pages", version.ref = "ktor" }
ktor-server-cors = { module = "io.ktor:ktor-server-cors", version.ref = "ktor" }
ktor-server-websockets = { module = "io.ktor:ktor-server-websockets", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
logback-classic = { module = "ch.qos.logback:logback-classic", version = "1.2.10" }
kotlin-argparser = { module = "com.xenomachina:kotlin-argparser", version = "2.0.7" }
proguard-gradle = { module = "com.guardsquare:proguard-gradle", version = "7.2.2" }
wca-i18n = { module = "com.github.thewca:wca_i18n", version = "0.4.3" }
google-appengine-gradle = { module = "com.google.cloud.tools:appengine-gradle-plugin", version = "2.4.4" }
google-cloud-storage = { module = "com.google.cloud:google-cloud-storage", version = "2.9.0" }
tnoodle-scrambles = { module = "org.worldcubeassociation.tnoodle:lib-scrambles", version = "0.18.1" }
apache-commons-lang3 = { module = "org.apache.commons:commons-lang3", version = "3.12.0" }
kotless-ktor = { module = "io.kotless:ktor-lang", version.ref = "kotless" }
mockk = { module = "io.mockk:mockk", version = "1.12.4" }
eclipse-jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version = "6.2.0.202206071550-r" }

[bundles]
batik = ["batik-transcoder", "batik-codec"]

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
nodejs = { id = "com.github.node-gradle.node", version = "3.4.0" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dependency-versions = { id = "com.github.ben-manes.versions", version = "0.42.0" }
kotless = { id = "io.kotless", version.ref = "kotless" }

google-appengine = { id = "com.google.cloud.tools.appengine", version = "2.4.2" }
kotlinx-atomicfu = { id = "kotlinx-atomicfu" }
Loading

0 comments on commit 67ae5e0

Please sign in to comment.