Skip to content

Commit

Permalink
update to tutteli gradle 5.0.0, make kotlin version configurable
Browse files Browse the repository at this point in the history
moreover:
- add the missing pieces so that we can actually release minimalist,
  such as developer information
  • Loading branch information
robstoll committed Nov 5, 2023
1 parent eb388ea commit b98f512
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 57 deletions.
12 changes: 7 additions & 5 deletions gradle/build-logic/build-parameters/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("build-logic.kotlin-dsl-gradle-plugin")
id("org.gradlex.build-parameters") version "1.4.3"
Expand All @@ -13,14 +15,14 @@ buildParameters {
integer("defaultJdkVersion") {
defaultValue.set(defaultJdkVersion)
mandatory.set(true)
description.set("Default Java version for source and target compatibility")
description.set("Default jdk version for source and target compatibility")
}

group("kotlin") {
integer("version") {
group("kotlin") {
string("version") {
fromEnvironment()
defaultValue.set(defaultJdkVersion)
description.set("kotlin version")
defaultValue.set(KotlinVersion.KOTLIN_1_9.version)
description.set("kotlin version used for apiVersion and languageVersion")
}
bool("werror") {
defaultValue.set(true)
Expand Down
4 changes: 2 additions & 2 deletions gradle/build-logic/dev/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ dependencies {
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:4.10.0")
api("ch.tutteli.gradle.plugins.kotlin.module.info:ch.tutteli.gradle.plugins.kotlin.module.info.gradle.plugin:4.10.0")
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")
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("build-logic.junit-jacoco-conventions")
// this plugin sets inter alia toolchain and source/targetCompatibility
// but also applies common plugins such as gradle-convention, build-params
id("build-logic.java")
id("build-logic.junit-jacoco-conventions")
// this plugin sets inter alia toolchain and source/targetCompatibility
// but also applies common plugins such as gradle-convention, build-params
id("build-logic.java")
}

tasks.configureEach<KotlinCompile> {
kotlinOptions {
jvmTarget = buildParameters.defaultJdkVersion.toString()
}
kotlinOptions {
jvmTarget = buildParameters.defaultJdkVersion.toString()
languageVersion
}
}

tasks.configureEach<KotlinCompilationTask<*>> {
compilerOptions {
// suppress warnings about kotlin 1.4 beeing deprecated
freeCompilerArgs.add("-Xsuppress-version-warnings")
}
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
// suppress warnings about used kotlin version being deprecated, we use an older api/language version on purpose
freeCompilerArgs.add("-Xsuppress-version-warnings")

val kotlinVersion = KotlinVersion.fromVersion(buildParameters.kotlin.version)
languageVersion.set(kotlinVersion)
apiVersion.set(kotlinVersion)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ plugins {
dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
}

kotlin {
sourceSets {
configureLanguageSettings()
}
}
4 changes: 2 additions & 2 deletions gradle/build-logic/publishing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ dependencies {
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:4.10.0")
api("ch.tutteli.gradle.plugins.publish:ch.tutteli.gradle.plugins.publish.gradle.plugin:4.10.0")
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")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ch.tutteli.gradle.plugins.dokka.GhPages
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
id("build-logic.gradle-conventions")
Expand All @@ -8,21 +8,15 @@ plugins {

val kdocDir = rootProject.projectDir.resolve("misc/kdoc")

tasks.configureEach<DokkaTask> {
dokkaSourceSets.configureEach {
reportUndocumented.set(true)
}
}

tutteliDokka {
githubUser.set("tegonal")
modeSimple.set(false)
writeTo.set(GhPages)
}

tasks.configureEach<AbstractDokkaLeafTask> {
dokkaSourceSets.configureEach {
reportUndocumented.set(true)
jdkVersion.set(buildParameters.defaultJdkVersion)
//TODO also set kotlin version
includes.from(kdocDir.resolve("packages.md"))
}
configurePlugins()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
plugins {
id("build-logic.kotlin-jvm")
id("build-logic.kotlin-jvm")
id("build-logic.dokka")
id("ch.tutteli.gradle.plugins.kotlin.module.info")
id("ch.tutteli.gradle.plugins.publish")
id("ch.tutteli.gradle.plugins.publish")
}

tutteliPublish {
githubUser.set("tegonal")
resetLicenses("EUPL-1.2")
}
manifestVendor.set("Tegonal Genossenschaft")

resetLicenses("EUPL-1.2")
addDeveloper {
id = "robstoll_tegonal"
name = "Robert Stoll"
email = "robert.stoll@tegonal.com"
url = "https://tutteli.ch"
organization = "Tegonal Genossenschaft"
organizationUrl = "https://tegonal.com"
}
}
Empty file added misc/kdoc/packages.md
Empty file.

0 comments on commit b98f512

Please sign in to comment.