Skip to content

Commit

Permalink
introduce (build)libs.versions.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Nov 22, 2023
1 parent 951cae3 commit f2168c2
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 29 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ description = "Library which helps to setup and prioritise parameterized tests"


dependencies {
api("org.junit.jupiter:junit-jupiter-params:5.10.0")
api(libs.junit.jupiter.params)

testImplementation(kotlin("test"))
testImplementation("ch.tutteli.atrium:atrium-fluent:1.0.0")
testImplementation(libs.atrium.fluent)
}

val generationFolder: ConfigurableFileCollection = project.files("src/main/generated/kotlin")
Expand Down
9 changes: 5 additions & 4 deletions gradle/build-logic/basics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id("build-logic.kotlin-dsl-gradle-plugin")
id("build-logic.kotlin-dsl-gradle-plugin")
}

dependencies {
api(projects.buildParameters)
api("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.90")
api("com.dorongold.plugins:task-tree:2.1.1")
api(projects.buildParameters)
api(buildLibs.vlsi.crlf)
api(buildLibs.vlsi.gradle)
api(buildLibs.taskTree)
}
5 changes: 1 addition & 4 deletions gradle/build-logic/basics/src/main/kotlin/extensions.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import org.gradle.api.DomainObjectCollection
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType

// TODO 1.2.0 move into own repo and fetch via gt
fun Project.prefixedProject(name: String): Project = project(":${rootProject.name}-$name")

// TODO 0.5.0 move into own repo and fetch via gt
// copied from com.github.vlsi.gradle.dsl.configureEach, using this instead so that we don't have to import
inline fun <reified S : Any> DomainObjectCollection<in S>.configureEach(noinline configuration: S.() -> Unit) =
withType().configureEach(configuration)
2 changes: 1 addition & 1 deletion gradle/build-logic/build-parameters/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("build-logic.kotlin-dsl-gradle-plugin")
id("org.gradlex.build-parameters") version "1.4.3"
alias(buildLibs.plugins.build.parameters)
}

buildParameters {
Expand Down
10 changes: 4 additions & 6 deletions gradle/build-logic/dev/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ plugins {
dependencies {
api(projects.basics)

api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.8.20")
api("org.jetbrains.dokka:dokka-base:1.8.20")
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")

api("ch.tutteli.gradle.plugins.junitjacoco:ch.tutteli.gradle.plugins.junitjacoco.gradle.plugin:5.0.0")
api("ch.tutteli.gradle.plugins.kotlin.module.info:ch.tutteli.gradle.plugins.kotlin.module.info.gradle.plugin:5.0.0")
api(buildLibs.kotlin)
api(buildLibs.bundles.dokka)
api(buildLibs.tutteli.junitjacoco)
api(buildLibs.tutteli.moduleinfo)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ plugins {
id("build-logic.gradle-conventions")
}

tasks.register<DependencyInsightReportTask>("allDependencyInsight") {
group = HelpTasksPlugin.HELP_GROUP
description =
"Shows insights where the dependency is used. For instance: allDependencyInsight --configuration compile --dependency org.jsoup:jsoup"
}

java {
toolchain {
// reading JAVA_VERSION from env to enable jdk17 build in CI
Expand Down
8 changes: 3 additions & 5 deletions gradle/build-logic/publishing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ dependencies {
api(projects.basics)
api(projects.dev)

api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.8.20")
api("org.jetbrains.dokka:dokka-base:1.8.20")

api("ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin:5.0.0")
api("ch.tutteli.gradle.plugins.publish:ch.tutteli.gradle.plugins.publish.gradle.plugin:5.0.0")
api(buildLibs.bundles.dokka)
api(buildLibs.tutteli.dokka)
api(buildLibs.tutteli.publish)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tutteliPublish {

resetLicenses("EUPL-1.2")
addDeveloper {
id = "robstoll_tegonal"
id = "robstoll"
name = "Robert Stoll"
email = "robert.stoll@tegonal.com"
url = "https://tutteli.ch"
Expand Down
10 changes: 10 additions & 0 deletions gradle/build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ dependencyResolutionManagement {
repositories {
gradlePluginPortal()
}
versionCatalogs {
create("libs") {
from(files("../libs.versions.toml"))
}
}
versionCatalogs {
create("buildLibs") {
from(files("../buildLibs.versions.toml"))
}
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
Expand Down
29 changes: 29 additions & 0 deletions gradle/buildLibs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[versions]
dokka = "1.9.10"
jacocoTool = "0.8.9"
kotlin = "1.9.10"
task-tree = "2.1.1"
tutteli = "5.0.0"
vlsi = "1.90"

[libraries]
dokka-plugin = { module = "org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin", version.ref = "dokka" }
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }
kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
taskTree = { module = "com.dorongold.plugins:task-tree", version.ref = "task-tree" }

tutteli-dokka = { module = "ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin", version.ref = "tutteli" }
tutteli-junitjacoco = { module = "ch.tutteli.gradle.plugins.junitjacoco:ch.tutteli.gradle.plugins.junitjacoco.gradle.plugin", version.ref = "tutteli" }
tutteli-moduleinfo = { module = "ch.tutteli.gradle.plugins.kotlin.module.info:ch.tutteli.gradle.plugins.kotlin.module.info.gradle.plugin", version.ref = "tutteli" }
tutteli-publish = { module = "ch.tutteli.gradle.plugins.publish:ch.tutteli.gradle.plugins.publish.gradle.plugin", version.ref = "tutteli" }
tutteli-spek = { module = "ch.tutteli.gradle.plugins.spek:ch.tutteli.gradle.plugins.spek.gradle.plugin", version.ref = "tutteli" }

vlsi-crlf = { module = "com.github.vlsi.crlf:com.github.vlsi.crlf.gradle.plugin", version.ref = "vlsi" }
vlsi-gradle = { module = "com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin", version.ref = "vlsi" }


[bundles]
dokka = ["dokka-base", "dokka-plugin"]

[plugins]
build-parameters = { id = "org.gradlex.build-parameters", version = "1.4.3" }
8 changes: 8 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[versions]
atrium = "1.1.0"
junitJupiter = "5.10.0"

[libraries]
atrium-fluent = { module = "ch.tutteli.atrium:atrium-fluent", version.ref = "atrium" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junitJupiter" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junitJupiter" }

0 comments on commit f2168c2

Please sign in to comment.