diff --git a/gradle/build-logic/build-parameters/build.gradle.kts b/gradle/build-logic/build-parameters/build.gradle.kts index e649eed..b5befe2 100644 --- a/gradle/build-logic/build-parameters/build.gradle.kts +++ b/gradle/build-logic/build-parameters/build.gradle.kts @@ -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" @@ -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) diff --git a/gradle/build-logic/dev/build.gradle.kts b/gradle/build-logic/dev/build.gradle.kts index d249918..9339548 100644 --- a/gradle/build-logic/dev/build.gradle.kts +++ b/gradle/build-logic/dev/build.gradle.kts @@ -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") } diff --git a/gradle/build-logic/dev/src/main/kotlin/KotlinConfigurationExtensions.kt b/gradle/build-logic/dev/src/main/kotlin/KotlinConfigurationExtensions.kt deleted file mode 100644 index c65788c..0000000 --- a/gradle/build-logic/dev/src/main/kotlin/KotlinConfigurationExtensions.kt +++ /dev/null @@ -1,18 +0,0 @@ -import org.gradle.api.NamedDomainObjectContainer -import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet - - -fun NamedDomainObjectContainer.configureLanguageSettings() { - configureEach { - // TODO make this configurable so that we can use a higher version in Tests. - - // we use a lower version on purpose so that it can be used in projects still using Kotlin 1.4 - val languageVersion = "1.4" - val apiVersion = "1.4" - languageSettings.apply { - this.languageVersion = languageVersion - this.apiVersion = apiVersion - optIn("kotlin.RequiresOptIn") - } - } -} diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts index 3ac95ea..9e1d28d 100644 --- a/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts @@ -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 { - kotlinOptions { - jvmTarget = buildParameters.defaultJdkVersion.toString() - } + kotlinOptions { + jvmTarget = buildParameters.defaultJdkVersion.toString() + languageVersion + } } tasks.configureEach> { - 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) + } } diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts index ab3735e..6c92e32 100644 --- a/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts @@ -6,9 +6,3 @@ plugins { dependencies { testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") } - -kotlin { - sourceSets { - configureLanguageSettings() - } -} diff --git a/gradle/build-logic/publishing/build.gradle.kts b/gradle/build-logic/publishing/build.gradle.kts index e4f7b04..ff0f9c4 100644 --- a/gradle/build-logic/publishing/build.gradle.kts +++ b/gradle/build-logic/publishing/build.gradle.kts @@ -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") } diff --git a/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts b/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts index 5395875..83b297a 100644 --- a/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts +++ b/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts @@ -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") @@ -8,21 +8,15 @@ plugins { val kdocDir = rootProject.projectDir.resolve("misc/kdoc") -tasks.configureEach { - dokkaSourceSets.configureEach { - reportUndocumented.set(true) - } -} - tutteliDokka { githubUser.set("tegonal") - modeSimple.set(false) + writeTo.set(GhPages) } tasks.configureEach { dokkaSourceSets.configureEach { + reportUndocumented.set(true) jdkVersion.set(buildParameters.defaultJdkVersion) - //TODO also set kotlin version includes.from(kdocDir.resolve("packages.md")) } configurePlugins() diff --git a/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-jvm.gradle.kts b/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-jvm.gradle.kts index e16672f..09918f1 100644 --- a/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-jvm.gradle.kts +++ b/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-jvm.gradle.kts @@ -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" + } +} diff --git a/misc/kdoc/packages.md b/misc/kdoc/packages.md new file mode 100644 index 0000000..e69de29