From 007210f5ef0813e204b2f45ae424a20baf194459 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Fri, 31 May 2024 23:56:20 +0200 Subject: [PATCH] switch to gradle build-logic --- build.gradle.kts | 66 +++---------------- gradle.properties | 4 ++ .../build-logic-conventions/build.gradle.kts | 17 +++++ .../settings.gradle.kts | 8 +++ ...-logic.kotlin-dsl-gradle-plugin.gradle.kts | 8 +++ gradle/build-logic/basics/build.gradle.kts | 10 +++ .../build-logic.gradle-conventions.gradle.kts | 7 ++ .../basics/src/main/kotlin/extensions.kt | 7 ++ .../build-parameters/build.gradle.kts | 47 +++++++++++++ gradle/build-logic/build.gradle.kts | 7 ++ gradle/build-logic/dev/build.gradle.kts | 12 ++++ .../dev/src/main/kotlin/DokkaExtensions.kt | 9 +++ .../main/kotlin/build-logic.java.gradle.kts | 29 ++++++++ ...-logic.junit-jacoco-conventions.gradle.kts | 9 +++ .../build-logic.kotlin-conventions.gradle.kts | 19 ++++++ ...ld-logic.kotlin-jvm-conventions.gradle.kts | 17 +++++ .../kotlin/build-logic.kotlin-jvm.gradle.kts | 8 +++ ...uild-logic.kotlin-multiplatform.gradle.kts | 38 +++++++++++ .../build-logic/publishing/build.gradle.kts | 12 ++++ .../main/kotlin/build-logic.dokka.gradle.kts | 16 +++++ ....published-kotlin-multiplatform.gradle.kts | 7 ++ gradle/build-logic/settings.gradle.kts | 29 ++++++++ gradle/buildLibs.versions.toml | 32 +++++++++ gradle/{scripts => }/detekt.yml | 1 + gradle/libs.versions.toml | 11 ++++ {kotlin-js-store => gradle}/yarn.lock | 0 settings.gradle.kts | 17 +++++ 27 files changed, 390 insertions(+), 57 deletions(-) create mode 100644 gradle/build-logic-conventions/build.gradle.kts create mode 100644 gradle/build-logic-conventions/settings.gradle.kts create mode 100644 gradle/build-logic-conventions/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts create mode 100644 gradle/build-logic/basics/build.gradle.kts create mode 100644 gradle/build-logic/basics/src/main/kotlin/build-logic.gradle-conventions.gradle.kts create mode 100644 gradle/build-logic/basics/src/main/kotlin/extensions.kt create mode 100644 gradle/build-logic/build-parameters/build.gradle.kts create mode 100644 gradle/build-logic/build.gradle.kts create mode 100644 gradle/build-logic/dev/build.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.java.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm-conventions.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts create mode 100644 gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-multiplatform.gradle.kts create mode 100644 gradle/build-logic/publishing/build.gradle.kts create mode 100644 gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts create mode 100644 gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-multiplatform.gradle.kts create mode 100644 gradle/build-logic/settings.gradle.kts create mode 100644 gradle/buildLibs.versions.toml rename gradle/{scripts => }/detekt.yml (93%) create mode 100644 gradle/libs.versions.toml rename {kotlin-js-store => gradle}/yarn.lock (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 8db364f..e810bb9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,3 @@ -import org.jetbrains.kotlin.gradle.dsl.KotlinVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.nio.file.Files import java.nio.file.Path import java.nio.file.StandardCopyOption @@ -14,72 +11,26 @@ buildscript { } plugins { - kotlin("multiplatform") version "2.0.0" - id("org.jetbrains.dokka") version "1.9.20" - val tutteliGradleVersion = "5.0.1" - id("ch.tutteli.gradle.plugins.dokka") version tutteliGradleVersion - id("ch.tutteli.gradle.plugins.junitjacoco") version tutteliGradleVersion - id("ch.tutteli.gradle.plugins.kotlin.module.info") version tutteliGradleVersion - id("ch.tutteli.gradle.plugins.publish") version tutteliGradleVersion - id("io.gitlab.arturbosch.detekt") version "1.23.6" - id("io.github.gradle-nexus.publish-plugin") version "2.0.0" + id("build-logic.published-kotlin-multiplatform") + alias(libs.plugins.detekt) + alias(libs.plugins.nexus.publish) } -val atriumVersion by extra("1.2.0") - -the() - .allowedTestTasksWithoutTests.set(listOf("jsNodeTest")) - -repositories { mavenCentral() } kotlin { - compilerOptions { - @Suppress("DEPRECATION" /* we support kotlin 1.4 as long as possible */) - val kotlinVersion = KotlinVersion.KOTLIN_1_4 - apiVersion.set(kotlinVersion) - languageVersion.set(kotlinVersion) - freeCompilerArgs.add("-Xexpect-actual-classes") - } - - jvm { withJava() } - js(IR) { nodejs() } - sourceSets { - val excludeKbox: ExternalModuleDependency.() -> Unit = { - exclude(group = "ch.tutteli.kbox") - } - - val commonTest by getting { + commonTest { dependencies { - implementation(kotlin("test")) - implementation("ch.tutteli.atrium:atrium-fluent:$atriumVersion", excludeKbox) + implementation(libs.atrium.fluent.get().let { "${it.module}:${it.version}"}) { + exclude(group = "ch.tutteli.kbox") + } } } } } -kotlin { - // reading JAVA_VERSION from env to enable jdk17 build in CI - val jdkVersion = System.getenv("JAVA_VERSION")?.toIntOrNull() ?: 11 - jvmToolchain(jdkVersion) -} -tasks.withType { - kotlinOptions.jvmTarget = "11" -} -tasks.withType { - sourceCompatibility = "11" - targetCompatibility = "11" -} -tasks.withType>().configureEach { - compilerOptions { - with(freeCompilerArgs) { - add("-opt-in=kotlin.RequiresOptIn") - add("-Xexpect-actual-classes") - } - } -} detekt { allRules = true - config.from(files("${rootProject.projectDir}/gradle/scripts/detekt.yml")) + config.from(files("${rootProject.projectDir}/gradle/detekt.yml")) } val detektTasks = tasks.withType() @@ -126,6 +77,7 @@ nexusPublishing { } } + /* Release & deploy a commit diff --git a/gradle.properties b/gradle.properties index 8af57df..a8bc793 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,6 @@ kotlin.code.style=official kotlin.js.generate.executable.default=false + +# com.github.vlsi.gradle-extensions prints only failing or slow test results +slowTestLogThreshold=500 +slowSuiteLogThreshold=5000 diff --git a/gradle/build-logic-conventions/build.gradle.kts b/gradle/build-logic-conventions/build.gradle.kts new file mode 100644 index 0000000..4358458 --- /dev/null +++ b/gradle/build-logic-conventions/build.gradle.kts @@ -0,0 +1,17 @@ +import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion + +plugins { + `kotlin-dsl` +} + +allprojects { + group = "ch.tutteli.kbox.build-logic.convention" +} + +dependencies { + // We use precompiled script plugins (== plugins written as src/kotlin/build-logic.*.gradle.kts files, + // and we need to declare dependency on org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin + // in order to be able to specify tasks.validatePlugins + // See https://github.com/gradle/gradle/issues/17016 regarding expectedKotlinDslPluginsVersion + implementation("org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:$expectedKotlinDslPluginsVersion") +} diff --git a/gradle/build-logic-conventions/settings.gradle.kts b/gradle/build-logic-conventions/settings.gradle.kts new file mode 100644 index 0000000..e2516aa --- /dev/null +++ b/gradle/build-logic-conventions/settings.gradle.kts @@ -0,0 +1,8 @@ +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + gradlePluginPortal() + } +} + +rootProject.name = "build-logic-conventions" diff --git a/gradle/build-logic-conventions/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts b/gradle/build-logic-conventions/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts new file mode 100644 index 0000000..8f63011 --- /dev/null +++ b/gradle/build-logic-conventions/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id("org.gradle.kotlin.kotlin-dsl") // this is 'kotlin-dsl' without version +} + +tasks.validatePlugins { + failOnWarning.set(true) + enableStricterValidation.set(true) +} diff --git a/gradle/build-logic/basics/build.gradle.kts b/gradle/build-logic/basics/build.gradle.kts new file mode 100644 index 0000000..1e36b79 --- /dev/null +++ b/gradle/build-logic/basics/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id("build-logic.kotlin-dsl-gradle-plugin") +} + +dependencies { + api(projects.buildParameters) + api(buildLibs.vlsi.crlf) + api(buildLibs.vlsi.gradle) + api(buildLibs.taskTree) +} diff --git a/gradle/build-logic/basics/src/main/kotlin/build-logic.gradle-conventions.gradle.kts b/gradle/build-logic/basics/src/main/kotlin/build-logic.gradle-conventions.gradle.kts new file mode 100644 index 0000000..5e5baed --- /dev/null +++ b/gradle/build-logic/basics/src/main/kotlin/build-logic.gradle-conventions.gradle.kts @@ -0,0 +1,7 @@ +plugins { + // plugins we use in all gradle projects + id("build-logic.build-params") + id("com.github.vlsi.gradle-extensions") + // enable to analyse task dependencies +// id("com.dorongold.task-tree") +} diff --git a/gradle/build-logic/basics/src/main/kotlin/extensions.kt b/gradle/build-logic/basics/src/main/kotlin/extensions.kt new file mode 100644 index 0000000..e15c144 --- /dev/null +++ b/gradle/build-logic/basics/src/main/kotlin/extensions.kt @@ -0,0 +1,7 @@ +import org.gradle.api.DomainObjectCollection +import org.gradle.kotlin.dsl.withType + +// TODO check if already moved into own tegonal 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 DomainObjectCollection.configureEach(noinline configuration: S.() -> Unit) = + withType().configureEach(configuration) diff --git a/gradle/build-logic/build-parameters/build.gradle.kts b/gradle/build-logic/build-parameters/build.gradle.kts new file mode 100644 index 0000000..70afca0 --- /dev/null +++ b/gradle/build-logic/build-parameters/build.gradle.kts @@ -0,0 +1,47 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion + +plugins { + id("build-logic.kotlin-dsl-gradle-plugin") + alias(buildLibs.plugins.build.parameters) +} + +buildParameters { + pluginId("build-logic.build-params") + + // Other plugins can contribute parameters, so below list is not exhaustive, hence we disable the validation + enableValidation.set(false) + + val defaultJdkVersion = 11 + integer("defaultJdkVersion") { + defaultValue.set(defaultJdkVersion) + mandatory.set(true) + description.set("Default jdk version for source and target compatibility") + } + + group("kotlin") { + string("version") { + fromEnvironment() + @Suppress("DEPRECATION" /* we support kotlin_1_4 on purpose */) + defaultValue.set(KotlinVersion.KOTLIN_1_4.version) + description.set("kotlin version used for apiVersion and languageVersion") + } + bool("werror") { + defaultValue.set(true) + description.set("Treat kotlinc warnings as errors") + } + } + + + group("java") { + integer("version") { + fromEnvironment() + defaultValue.set(defaultJdkVersion) + description.set("Java version used for java.toolchain") + } + bool("werror") { + defaultValue.set(true) + description.set("Treat javac, javadoc, warnings as errors") + } + } + +} diff --git a/gradle/build-logic/build.gradle.kts b/gradle/build-logic/build.gradle.kts new file mode 100644 index 0000000..427e7a5 --- /dev/null +++ b/gradle/build-logic/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `embedded-kotlin` apply false +} + +allprojects { + group = "ch.tutteli.kbox.build-logic" +} diff --git a/gradle/build-logic/dev/build.gradle.kts b/gradle/build-logic/dev/build.gradle.kts new file mode 100644 index 0000000..d1d21b2 --- /dev/null +++ b/gradle/build-logic/dev/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("build-logic.kotlin-dsl-gradle-plugin") +} + +dependencies { + api(projects.basics) + + api(buildLibs.kotlin) + api(buildLibs.bundles.dokka) + api(buildLibs.tutteli.junitjacoco) + api(buildLibs.tutteli.moduleinfo) +} diff --git a/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt b/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt new file mode 100644 index 0000000..31f9e5f --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/DokkaExtensions.kt @@ -0,0 +1,9 @@ +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration +import org.jetbrains.dokka.gradle.AbstractDokkaTask + +fun AbstractDokkaTask.configurePlugins() { + pluginConfiguration { + footerMessage = "KBox © Copyright Robert Stoll <rstoll@tutteli.ch>" + } +} diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.java.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.java.gradle.kts new file mode 100644 index 0000000..a20f007 --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.java.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("java") + id("build-logic.gradle-conventions") +} + +java { + toolchain { + // reading JAVA_VERSION from env to enable jdk17 build in CI + languageVersion.set(JavaLanguageVersion.of(buildParameters.java.version)) + } + consistentResolution { + useCompileClasspathVersions() + } +} + + +tasks.configureEach { + inputs.property("java.version", System.getProperty("java.version")) + inputs.property("java.vm.version", System.getProperty("java.vm.version")) + sourceCompatibility = buildParameters.defaultJdkVersion.toString() + targetCompatibility = buildParameters.defaultJdkVersion.toString() + options.apply { + encoding = "UTF-8" + compilerArgs.add("-Xlint:deprecation") + if (buildParameters.java.werror) { + compilerArgs.add("-Werror") + } + } +} diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts new file mode 100644 index 0000000..8774e48 --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("ch.tutteli.gradle.plugins.junitjacoco") +} + +dependencies { + // used to run the samples + testImplementation("org.junit.jupiter:junit-jupiter-api") + testImplementation("org.junit.jupiter:junit-jupiter-params") +} 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 new file mode 100644 index 0000000..af20ff7 --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-conventions.gradle.kts @@ -0,0 +1,19 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask + +plugins { + id("build-logic.gradle-conventions") +} +tasks.configureEach> { + compilerOptions { + freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") + // suppress warnings about kotlin 1.4 being deprecated + freeCompilerArgs.add("-Xsuppress-version-warnings") + // suppress warnings about expect/actual being an experimental feature + freeCompilerArgs.add("-Xexpect-actual-classes") + + 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-conventions.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm-conventions.gradle.kts new file mode 100644 index 0000000..2720953 --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm-conventions.gradle.kts @@ -0,0 +1,17 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + id("build-logic.kotlin-conventions") + 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("ch.tutteli.gradle.plugins.kotlin.module.info") +} + +tasks.configureEach { + compilerOptions{ + jvmTarget.set(JvmTarget.fromTarget(buildParameters.defaultJdkVersion.toString())) + } +} 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 new file mode 100644 index 0000000..521802c --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-jvm.gradle.kts @@ -0,0 +1,8 @@ +plugins { + kotlin("jvm") + id("build-logic.kotlin-jvm-conventions") +} + +dependencies { + testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") +} diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-multiplatform.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-multiplatform.gradle.kts new file mode 100644 index 0000000..89d2f49 --- /dev/null +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.kotlin-multiplatform.gradle.kts @@ -0,0 +1,38 @@ +plugins { + kotlin("multiplatform") + id("build-logic.kotlin-jvm-conventions") +} + + +kotlin { + jvm { + // for module-info.java + withJava() + } + + js(IR) { nodejs() } + + sourceSets { + commonTest { + dependencies { + implementation(kotlin("test")) + } + } + + // necessary due to https://youtrack.jetbrains.com/issue/KT-65352/KMP-Gradle-impossible-to-set-language-apiVersion-for-common-to-1.4 + all { + languageSettings { + languageVersion = buildParameters.kotlin.version + apiVersion = buildParameters.kotlin.version + } + } + } +} + +// this is necessary due to some crazy kotlin plugin voodoo. If we define this in the rootProject itself, +// then it does not work. +rootProject.plugins.withType { + rootProject.configure { + lockFileDirectory = rootProject.projectDir.resolve("gradle") + } +} diff --git a/gradle/build-logic/publishing/build.gradle.kts b/gradle/build-logic/publishing/build.gradle.kts new file mode 100644 index 0000000..d45da1e --- /dev/null +++ b/gradle/build-logic/publishing/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("build-logic.kotlin-dsl-gradle-plugin") +} + +dependencies { + api(projects.basics) + api(projects.dev) + + api(buildLibs.bundles.dokka) + api(buildLibs.tutteli.dokka) + api(buildLibs.tutteli.publish) +} 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 new file mode 100644 index 0000000..1ec419f --- /dev/null +++ b/gradle/build-logic/publishing/src/main/kotlin/build-logic.dokka.gradle.kts @@ -0,0 +1,16 @@ +import ch.tutteli.gradle.plugins.dokka.GhPages +import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask + +plugins { + id("build-logic.gradle-conventions") + id("ch.tutteli.gradle.plugins.dokka") +} + +tasks.configureEach { + moduleName.set("KBox") + dokkaSourceSets.configureEach { + reportUndocumented.set(true) + jdkVersion.set(buildParameters.defaultJdkVersion) + } + configurePlugins() +} diff --git a/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-multiplatform.gradle.kts b/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-multiplatform.gradle.kts new file mode 100644 index 0000000..80a9343 --- /dev/null +++ b/gradle/build-logic/publishing/src/main/kotlin/build-logic.published-kotlin-multiplatform.gradle.kts @@ -0,0 +1,7 @@ +import ch.tutteli.gradle.plugins.publish.PublishPluginExtension + +plugins { + id("build-logic.kotlin-multiplatform") + id("build-logic.dokka") + id("ch.tutteli.gradle.plugins.publish") +} diff --git a/gradle/build-logic/settings.gradle.kts b/gradle/build-logic/settings.gradle.kts new file mode 100644 index 0000000..2e7a463 --- /dev/null +++ b/gradle/build-logic/settings.gradle.kts @@ -0,0 +1,29 @@ +rootProject.name = "build-logic" + +pluginManagement { + includeBuild("../build-logic-conventions") +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + gradlePluginPortal() + } + versionCatalogs { + create("libs") { + from(files("../libs.versions.toml")) + } + } + versionCatalogs { + create("buildLibs") { + from(files("../buildLibs.versions.toml")) + } + } +} + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +include("basics") +include("build-parameters") +include("dev") +include("publishing") diff --git a/gradle/buildLibs.versions.toml b/gradle/buildLibs.versions.toml new file mode 100644 index 0000000..8c657cd --- /dev/null +++ b/gradle/buildLibs.versions.toml @@ -0,0 +1,32 @@ +[versions] +dokka = "1.9.20" +jacocoTool = "0.8.9" +# using the latest kbox version in the build-logic itself +kbox = "1.2.0" +kotlin = "2.0.0" +task-tree = "3.0.0" +tutteli = "5.0.1" +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" } +kbox = { module = "ch.tutteli.kbox:kbox", version.ref = "kbox" } +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.4" } diff --git a/gradle/scripts/detekt.yml b/gradle/detekt.yml similarity index 93% rename from gradle/scripts/detekt.yml rename to gradle/detekt.yml index 9d8a4e3..4cbf785 100644 --- a/gradle/scripts/detekt.yml +++ b/gradle/detekt.yml @@ -28,4 +28,5 @@ style: comments: OutdatedDocumentation: + matchDeclarationsOrder: false allowParamOnConstructorProperties: true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..682f79b --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,11 @@ +[versions] +atrium = "1.2.0" +nexusPublish = "2.0.0" +detekt = "1.23.6" + +[libraries] +atrium-fluent = { module = "ch.tutteli.atrium:atrium-fluent", version.ref = "atrium" } + +[plugins] +nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublish" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } diff --git a/kotlin-js-store/yarn.lock b/gradle/yarn.lock similarity index 100% rename from kotlin-js-store/yarn.lock rename to gradle/yarn.lock diff --git a/settings.gradle.kts b/settings.gradle.kts index e450c0c..413ae8e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,18 @@ +pluginManagement { + repositories { +// mavenLocal() + gradlePluginPortal() + } + includeBuild("gradle/build-logic") + includeBuild("gradle/build-logic-conventions") +} + +dependencyResolutionManagement { + // kotlinNodeJsSetup configures ivy repository 'Node Distributions at https://nodejs.org/dist' + // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + } +} + rootProject.name = "kbox"