From dc4f85561ccdbd026e3f301fa704689ce8fcbec7 Mon Sep 17 00:00:00 2001 From: Suresh G Date: Tue, 22 Oct 2024 18:26:19 -0700 Subject: [PATCH] chore: plugin refactorings --- gradle.properties | 4 + gradle/libs.versions.toml | 71 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- plugins/build.gradle.kts | 8 +- .../src/main/kotlin/common/Multiplatform.kt | 473 +++++++++--------- .../src/main/kotlin/common/ProjectExtns.kt | 333 ++++++------ .../dev.suresh.plugin.graalvm.gradle.kts | 2 +- ....suresh.plugin.kotlin.benchmark.gradle.kts | 4 +- .../dev.suresh.plugin.kotlin.docs.gradle.kts | 145 +++--- .../dev.suresh.plugin.kotlin.jvm.gradle.kts | 15 +- .../dev.suresh.plugin.kotlin.mpp.gradle.kts | 37 +- .../dev.suresh.plugin.publishing.gradle.kts | 43 +- .../kotlin/dev.suresh.plugin.root.gradle.kts | 19 +- sandbox/gradle.properties | 39 +- sandbox/gradle/libs.versions.toml | 97 ++-- 15 files changed, 624 insertions(+), 668 deletions(-) diff --git a/gradle.properties b/gradle.properties index ba2ef11..f1bd1ad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,10 @@ org.gradle.unsafe.isolated-projects=false kotlin.code.style=official kotlin.jvm.target.validation.mode=warning +## Dokka +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true + # Project semver.tagPrefix=v semver.project.tagPrefix=v diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ff1e376..64c2735 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] java = "24" -kotlin = "2.1.0-Beta1" -kotlin-ksp = "2.1.0-Beta1-1.0.25" -kotlin-jvmtarget = "22" +kotlin = "2.1.0-Beta2" +kotlin-ksp = "2.1.0-Beta2-1.0.25" +kotlin-jvmtarget = "21" kotlin-dsl-jvmtarget = "21" kotlin-api-version = "2.1" kotlin-lang-version = "2.1" -gradle = "8.10.2" +gradle = "8.11-rc-1" java-vendor = "Oracle" java-jvmArguments = "--enable-preview" java-addModules = "jdk.incubator.vector" @@ -22,7 +22,7 @@ org-url = "https://suresh.dev" # Gradle Dependencies Versions kotlinx-kover = "0.9.0-RC" kotlinx-io = "0.5.4" -kotlinx-atomicfu = "0.25.0" +kotlinx-atomicfu = "0.26.0" kotlinx-coroutines = "1.9.0" kotlinx-datetime = "0.6.1" kotlinx-serialization = "1.7.3" @@ -31,18 +31,18 @@ kotlinx-collections-immutable = "0.3.8" kotlinx-lincheck = "2.34" kotlinx-html = "0.11.0" kotlinx-browser = "0.2" -kotlinx-benchmark = "0.4.11" +kotlinx-benchmark = "0.4.12" kotlinx-metadata = "0.9.0" kotlinx-reflect-lite = "1.1.0" kotlinx-bcv = "0.16.3" -kotlin-dokka = "1.9.20" -kotlin-wrappers = "1.0.0-pre.817" +kotlin-dokka = "2.0.0-Beta" +kotlin-wrappers = "1.0.0-pre.820" kotlin-redacted = "1.11.0-alpha01" kotlinx-multik = "0.2.3" kotlinx-dataframe = "0.13.1" kotlinx-kandy = "0.5.0" evas = "1.1.0" -kopy = "0.11.0+2.0.20" +kopy = "0.12.0+2.0.21" poko = "0.17.2" mappie = "0.8.0" akkurate = "0.10.0" @@ -53,11 +53,11 @@ spring-boot = "3.3.4" spring-depmgmt = "1.1.6" ktor = "3.0.0" ktor-cohort = "2.5.1" -otel = "1.42.1" +otel = "1.43.0" otel-instr = "2.9.0" -otel-instr-alpha = "2.8.0-alpha" -otel-semconv = "1.27.0-alpha" -otel-samplers = "1.39.0-alpha" +otel-instr-alpha = "2.9.0-alpha" +otel-semconv = "1.28.0-alpha" +otel-samplers = "1.40.0-alpha" elastic-otel = "0.4.0" okio = "3.9.1" sslcontext-kickstart = "8.3.7" @@ -76,17 +76,17 @@ jte = "3.1.13" jimfs = "1.3.0" sshj = "0.38.0" jsch = "0.2.20" -pty4j = "0.13.0" -junit = "5.11.2" +pty4j = "0.13.2" +junit = "5.11.3" koin = "4.0.0" kotest = "6.0.0.M1" mockk = "1.13.13" mokkery = "2.4.0" -wiremock = "3.9.1" +wiremock = "3.9.2" wiremock-kotlin = "2.1.1" okhttp = "5.0.0-alpha.14" slf4j = "2.1.0-alpha1" -logback = "1.5.9" +logback = "1.5.11" logback-tyler = "0.7" log4j = "3.0.0-beta2" jmh = "1.37" @@ -111,9 +111,9 @@ kotlin-cryptography = "0.4.0" uri-kmp = "0.0.18" urlencoder = "1.5.0" bytesize = "2.0.0-beta04" -cash-turbine = "1.1.0" +cash-turbine = "1.2.0" cardiologist = "0.2.2" -kmp-store5 = "5.1.0-alpha05" +kmp-store5 = "5.1.0-alpha04" kmp-settings = "1.2.0" kmp-appdirs = "1.2.0" parsus = "0.6.1" @@ -125,7 +125,7 @@ exposed = "0.55.0" postgresql = "42.7.4" hikariCP = "6.0.0" h2 = "2.3.232" -micrometer = "1.13.5" +micrometer = "1.13.3" swagger-ui = "5.17.14" hoplite = "2.8.0" config4k = "0.6.0" @@ -133,29 +133,29 @@ shedlock = "5.15.0" sherlock = "1.0.1" sqids = "0.1.0" tsid = "2.1.1" -expiringmap = "0.5.11" +expiringmap = "0.5.10" otp = "2.0.3" password4j = "1.8.2" apache-commons-imaging = "1.0-alpha3" -testcontainers = "1.20.2" +testcontainers = "1.20.3" sourceBuddy = "2.5.0" tcp-javanioproxy = "1.6" -kubernetes-client = "21.0.1" +kubernetes-client = "21.0.2" reflect-typeparamresolver = "1.0.2" reflect-typetools = "0.6.3" async-profiler = "3.0" ap-loader-all = "3.0-9" openjdk-jmc = "9.0.0" airlift-aircompressor = "2.0.2" -airlift-security = "273" +airlift-security = "275" directory-keystore = "1.1.0" maven-mima = "3.0.0-alpha-3" maven-archeologist = "0.0.10" -jfree-chart = "1.5.5" +jfree-chart = "1.5.4" jfree-svg = "5.0.6" xchart = "3.8.7" batik = "1.17" -twelvemonkeys = "3.10.1" +twelvemonkeys = "3.12.0" okapibarcode = "0.4.1" chasm = "0.7.1" kfswatch = "1.3.0" @@ -165,16 +165,16 @@ ldaptive = "2.3.2" chicory = "0.0.12" # Compose -jetbrains-compose = "1.7.0-rc01" -jetbrains-compose-viewmodel = "2.8.3-rc01" +jetbrains-compose = "1.7.0" +jetbrains-compose-viewmodel = "2.8.3" jetbrains-compose-nav = "2.8.0-alpha10" -jetbrains-compose-adaptive = "1.0.0-rc01" +jetbrains-compose-adaptive = "1.0.0" kobweb = "0.19.2" detekt = "1.23.7" -detekt-compose-rules = "0.4.12" +detekt-compose-rules = "0.4.16" compose-icons = "1.1.0" compose-routing = "0.4.0" -kottie = "2.0.0" +kottie = "2.0.1" mosaic = "0.14.0" # NPM Dependencies @@ -191,14 +191,14 @@ foojay-resolver = "0.8.0" gradle-develocity = "3.18.1" nmcp = "0.0.9" nexus-publish = "2.0.0" -vanniktech-publish = "0.29.0" +vanniktech-publish = "0.30.0" shadow = "8.3.3" -spotless = "7.0.0.BETA2" +spotless = "7.0.0.BETA3" semver-plugin = "0.8.0" tasktree = "4.0.0" sigstore = "1.0.0" reproducible-builds = "1.0" -autonomousapps-depanalysis = "2.1.4" +autonomousapps-depanalysis = "2.2.0" autonomousapps-bestpractices = "0.10" graalvm-nativeimage = "0.10.3" github-depgraph = "0.1.0" @@ -211,7 +211,7 @@ modulegraph = "0.10.1" cash-molecule = "1.4.3" npm-publish-plugin = "3.4.3" exposed-plugin = "0.2.1" -jib-plugin = "3.4.3" +jib-plugin = "3.4.4" jib-nativeimage-extn = "0.1.0" includegit-plugin = "0.1.6" kmp-hierarchy = "1.1" @@ -238,7 +238,6 @@ build-kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicf build-kotlinx-benchmark = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin" , version.ref = "kotlinx-benchmark"} build-kotlin-dsl = { module = "org.gradle.kotlin:gradle-kotlin-dsl-plugins" , version.ref = "gradle-kotlin-dsl"} build-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin" , version.ref = "kotlin-dokka"} -build-dokka-base = { module = "org.jetbrains.dokka:dokka-base" , version.ref = "kotlin-dokka"} build-kotlin-ksp = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin" , version.ref = "kotlin-ksp"} build-kopy-plugin = { module = "com.javiersc.kotlin:kopy-gradle-plugin" , version.ref = "kopy"} build-redacted-plugin = { module = "dev.zacsweers.redacted:redacted-compiler-plugin-gradle" , version.ref = "kotlin-redacted"} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 79eb9d0..ff418b6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-rc-1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts index d5a3036..4a3434f 100644 --- a/plugins/build.gradle.kts +++ b/plugins/build.gradle.kts @@ -4,7 +4,6 @@ import gg.jte.gradle.GenerateJteTask import org.jetbrains.kotlin.gradle.dsl.* plugins { - // Just apply with `kotlin-dsl` id. id("org.gradle.kotlin.kotlin-dsl") // embeddedKotlin("jvm") embeddedKotlin("plugin.serialization") @@ -118,9 +117,6 @@ gradlePlugin { } dependencies { - // Hack to access version catalog from pre-compiled script plugins. - // https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 - implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) implementation(platform(libs.kotlin.bom)) implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.core) @@ -153,7 +149,6 @@ dependencies { implementation(libs.build.kotlinx.benchmark) implementation(libs.build.kotlinx.bcv) implementation(libs.build.dokka.plugin) - implementation(libs.build.dokka.base) implementation(libs.build.redacted.plugin) implementation(libs.build.gradle.develocity) implementation(libs.build.nmcp.plugin) @@ -176,6 +171,9 @@ dependencies { implementation(libs.build.kopy.plugin) implementation(libs.build.tomlj) + // https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) + // implementation(libs.build.kotlin.compose.compiler) // implementation(libs.build.karakum.plugin) // implementation(libs.jte.native) diff --git a/plugins/src/main/kotlin/common/Multiplatform.kt b/plugins/src/main/kotlin/common/Multiplatform.kt index 7e0d0ee..0f59a86 100644 --- a/plugins/src/main/kotlin/common/Multiplatform.kt +++ b/plugins/src/main/kotlin/common/Multiplatform.kt @@ -4,245 +4,247 @@ import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.kotlin.dsl.* import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinNativeCompilerOptions import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig -context(Project) -fun KotlinMultiplatformExtension.commonTarget() { - jvmToolchain { configureJvmToolchain() } - compilerOptions { configureKotlinCommon() } - withSourcesJar(publish = true) - // targets.configureEach {} +fun KotlinMultiplatformExtension.commonTarget(project: Project) = + with(project) { + jvmToolchain { configureJvmToolchain(project) } + compilerOptions { configureKotlinCommon(project) } + withSourcesJar(publish = true) + // targets.configureEach {} - sourceSets { - all { - // Apply multiplatform library bom to all source sets - dependencies { - api(project.dependencies.platform(libs.kotlin.bom)) - api(project.dependencies.platform(libs.kotlinx.coroutines.bom)) - api(project.dependencies.platform(libs.kotlinx.serialization.bom)) - api(project.dependencies.platform(libs.ktor.bom)) - api(project.dependencies.platform(libs.kotlin.wrappers.bom)) - } - // languageSettings.enableLanguageFeature(LanguageFeature.xx) - } + sourceSets { + all { + // Apply multiplatform library bom to all source sets + dependencies { + api(project.dependencies.platform(libs.kotlin.bom)) + api(project.dependencies.platform(libs.kotlinx.coroutines.bom)) + api(project.dependencies.platform(libs.kotlinx.serialization.bom)) + api(project.dependencies.platform(libs.ktor.bom)) + api(project.dependencies.platform(libs.kotlin.wrappers.bom)) + } + // languageSettings.enableLanguageFeature(LanguageFeature.xx) + } - commonMain { - dependencies { - api(libs.kotlinx.coroutines.core) - api(libs.kotlinx.datetime) - api(libs.kotlinx.io.core) - api(libs.kotlinx.serialization.json) - api(libs.kotlinx.serialization.json.io) - api(libs.kotlinx.collections.immutable) - api(libs.kotlin.redacted.annotations) - api(libs.kotlin.retry) - api(libs.kotlin.logging) - api(libs.kotlinx.html) - api(libs.bundles.ajalt) - api(libs.kotlinx.jsonpath) - api(libs.kotlin.cryptography.core) - api(libs.kotlin.cryptography.random) - api(libs.kotlin.bignum) - api(libs.kotlin.bignum.serialization) - api(libs.ktor.client.core) - api(libs.ktor.client.content.negotiation) - api(libs.ktor.client.encoding) - api(libs.ktor.client.logging) - api(libs.ktor.client.resources) - api(libs.ktor.client.auth) - api(libs.ktor.client.serialization) - api(libs.ktor.client.websockets) - api(libs.ktor.serialization.json) - } - // kotlin.srcDirs() - // resources.srcDirs() - } + commonMain { + dependencies { + api(libs.kotlinx.coroutines.core) + api(libs.kotlinx.datetime) + api(libs.kotlinx.io.core) + api(libs.kotlinx.serialization.json) + api(libs.kotlinx.serialization.json.io) + api(libs.kotlinx.collections.immutable) + api(libs.kotlin.redacted.annotations) + api(libs.kotlin.retry) + api(libs.kotlin.logging) + api(libs.kotlinx.html) + api(libs.bundles.ajalt) + api(libs.kotlinx.jsonpath) + api(libs.kotlin.cryptography.core) + api(libs.kotlin.cryptography.random) + api(libs.kotlin.bignum) + api(libs.kotlin.bignum.serialization) + api(libs.ktor.client.core) + api(libs.ktor.client.content.negotiation) + api(libs.ktor.client.encoding) + api(libs.ktor.client.logging) + api(libs.ktor.client.resources) + api(libs.ktor.client.auth) + api(libs.ktor.client.serialization) + api(libs.ktor.client.websockets) + api(libs.ktor.serialization.json) + } + // kotlin.srcDirs() + // resources.srcDirs() + } - commonTest { - dependencies { - api(kotlin("test")) - api(libs.kotlinx.coroutines.test) - api(libs.ktor.client.mock) - api(libs.cash.turbine) - } - } + commonTest { + dependencies { + api(kotlin("test")) + api(libs.kotlinx.coroutines.test) + api(libs.ktor.client.mock) + api(libs.cash.turbine) + } + } - // Get target compilations - // val commonTarget = targets.first { it.platformType == KotlinPlatformType.common } - // OR targets["metadata"] - // val compilation = commonTarget.compilations["main"] + // Get target compilations + // val commonTarget = targets.first { it.platformType == KotlinPlatformType.common } + // OR targets["metadata"] + // val compilation = commonTarget.compilations["main"] - // Add a task output as sourceSet - // compilation.defaultSourceSet.kotlin.srcDir(buildConfig) + // Add a task output as sourceSet + // compilation.defaultSourceSet.kotlin.srcDir(buildConfig) - // Add new sourceSet - // val newSourceSet = sourceSets.create("gen") - // compilation.defaultSourceSet.dependsOn(newSourceSet) - } -} - -context(Project) -fun KotlinMultiplatformExtension.jvmTarget() { - jvm { - withJava() - compilations.configureEach { compileJavaTaskProvider?.configure { configureJavac() } } - compilerOptions { configureKotlinJvm() } - - mainRun { - mainClass = libs.versions.app.mainclass - setArgs(jvmRunArgs) + // Add new sourceSet + // val newSourceSet = sourceSets.create("gen") + // compilation.defaultSourceSet.dependsOn(newSourceSet) + } } - // val test by testRuns.existing - testRuns.configureEach { executionTask.configure { configureJavaTest() } } +fun KotlinMultiplatformExtension.jvmTarget(project: Project) = + with(project) { + jvm { + withJava() + compilations.configureEach { + compileJavaTaskProvider?.configure { configureJavac(project) } + } + compilerOptions { configureKotlinJvm(project) } - // Register a task to execute a class using jvm runtime dependencies. - // compilations.getByName("test") { - // tasks.register("ktExec") { - // classpath(runtimeDependencyFiles, output) - // mainClass = "dev.suresh.test.ExecMain" - // } - // } + mainRun { + mainClass = libs.versions.app.mainclass + setArgs(jvmRunArgs) + } - // attributes.attribute(mppTargetAttr, platformType.name) - // attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) - } + // val test by testRuns.existing + testRuns.configureEach { executionTask.configure { configureJavaTest() } } + + // Register a task to execute a class using jvm runtime dependencies. + // compilations.getByName("test") { + // tasks.register("ktExec") { + // classpath(runtimeDependencyFiles, output) + // mainClass = "dev.suresh.test.ExecMain" + // } + // } - sourceSets { - jvmMain { - // dependsOn(jvmCommon) - dependencies { - // api(libs.kotlin.stdlib) - api(libs.kotlin.metadata.jvm) - api(libs.ktor.client.java) - api(libs.slf4j.api) - api(libs.slf4j.jul) - api(libs.kotlinx.coroutines.slf4j) - api(libs.jspecify) - api(libs.bundles.keystore) - // https://kotlinlang.org/docs/ksp-multiplatform.html - api(libs.google.auto.annotations) - ksp(libs.ksp.auto.service) + // attributes.attribute(mppTargetAttr, platformType.name) + // attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm) } - } - jvmTest { - dependencies { - api(project.dependencies.platform(libs.junit.bom)) - api(project.dependencies.platform(libs.testcontainers.bom)) - api(kotlin("test-junit5")) - api(libs.mockk) - api(libs.slf4j.simple) - api(libs.testcontainers.junit5) - api(libs.testcontainers.postgresql) - // api(kotlin("reflect")) - // api(libs.konsist) + sourceSets { + jvmMain { + // dependsOn(jvmCommon) + dependencies { + // api(libs.kotlin.stdlib) + api(libs.kotlin.metadata.jvm) + api(libs.ktor.client.java) + api(libs.slf4j.api) + api(libs.slf4j.jul) + api(libs.kotlinx.coroutines.slf4j) + api(libs.jspecify) + api(libs.bundles.keystore) + // https://kotlinlang.org/docs/ksp-multiplatform.html + api(libs.google.auto.annotations) + ksp(libs.ksp.auto.service) + } + } + + jvmTest { + dependencies { + api(project.dependencies.platform(libs.junit.bom)) + api(project.dependencies.platform(libs.testcontainers.bom)) + api(kotlin("test-junit5")) + api(libs.mockk) + api(libs.slf4j.simple) + api(libs.testcontainers.junit5) + api(libs.testcontainers.postgresql) + // api(kotlin("reflect")) + // api(libs.konsist) + } + } } } - } -} -context(Project) -fun KotlinMultiplatformExtension.jsTarget() { - js { - browser { - commonWebpackConfig { - cssSupport { enabled = true } - // outputFileName = "js-app.js" - // scssSupport { enabled = true } - // sourceMaps = true - } +fun KotlinMultiplatformExtension.jsTarget(project: Project) = + with(project) { + js { + browser { + commonWebpackConfig { + cssSupport { enabled = true } + // outputFileName = "js-app.js" + // scssSupport { enabled = true } + // sourceMaps = true + } + + runTask { sourceMaps = false } + testTask { + enabled = true + testLogging { configureLogEvents() } + useKarma { useChromeHeadless() } + } - runTask { sourceMaps = false } - testTask { - enabled = true - testLogging { configureLogEvents() } - useKarma { useChromeHeadless() } + // distribution { outputDirectory = file("$projectDir/docs") } + } + + if (isSharedProject.not()) { + binaries.executable() + } + generateTypeScriptDefinitions() + compilerOptions { configureKotlinJs() } + testRuns.configureEach { executionTask.configure {} } } - // distribution { outputDirectory = file("$projectDir/docs") } - } + sourceSets { + jsMain { + dependencies { + api(libs.ktor.client.js) + api(kotlinw("browser")) + api(kotlinw("css")) + // api(npm("@js-joda/timezone", libs.versions.npm.jsjoda.tz.get())) + // ksp(project(":meta:ksp:processor")) + } - if (isSharedProject.not()) { - binaries.executable() - } - generateTypeScriptDefinitions() - compilerOptions { configureKotlinJs() } - testRuns.configureEach { executionTask.configure { configureTestReport() } } - } + // kotlin.srcDir("src/main/kotlin") + // resources.srcDir("src/main/resources") + } - sourceSets { - jsMain { - dependencies { - api(libs.ktor.client.js) - api(kotlinw("browser")) - api(kotlinw("css")) - // api(npm("@js-joda/timezone", libs.versions.npm.jsjoda.tz.get())) - // ksp(project(":meta:ksp:processor")) + jsTest { kotlin {} } } - - // kotlin.srcDir("src/main/kotlin") - // resources.srcDir("src/main/resources") } - jsTest { kotlin {} } - } -} +fun KotlinMultiplatformExtension.wasmJsTarget(project: Project) = + with(project) { + wasmJs { + // moduleName = "wasm-app" + browser { + val rootDirPath = project.rootDir.path + val projectDirPath = project.projectDir.path + commonWebpackConfig { + cssSupport { enabled = true } + // outputFileName = "wasm-app.js" + // sourceMaps = true + devServer = + (devServer ?: KotlinWebpackConfig.DevServer()).apply { + static = + (static ?: mutableListOf()).apply { + // Serve sources to debug inside the browser + add(projectDirPath) + add(rootDirPath) + } + } + } -context(Project) -fun KotlinMultiplatformExtension.wasmJsTarget() { - wasmJs { - // moduleName = "wasm-app" - browser { - val rootDirPath = project.rootDir.path - val projectDirPath = project.projectDir.path - commonWebpackConfig { - cssSupport { enabled = true } - // outputFileName = "wasm-app.js" - // sourceMaps = true - devServer = - (devServer ?: KotlinWebpackConfig.DevServer()).apply { - static = - (static ?: mutableListOf()).apply { - // Serve sources to debug inside the browser - add(projectDirPath) - add(rootDirPath) - } - } - } + runTask { sourceMaps = false } + testTask { + enabled = true + testLogging { configureLogEvents() } + useKarma { useChromeHeadless() } + } + } - runTask { sourceMaps = false } - testTask { - enabled = true - testLogging { configureLogEvents() } - useKarma { useChromeHeadless() } + if (isSharedProject.not()) { + binaries.executable() + } + generateTypeScriptDefinitions() + compilerOptions { configureKotlinJs() } + testRuns.configureEach { executionTask.configure {} } } - } - if (isSharedProject.not()) { - binaries.executable() - } - generateTypeScriptDefinitions() - compilerOptions { configureKotlinJs() } - testRuns.configureEach { executionTask.configure { configureTestReport() } } - } - - sourceSets { - wasmJsMain { - dependencies { - // kotlinx-browser is only supported for WasmJs. - api(libs.kotlinx.browser) - api(libs.ktor.client.js) - // api(npm("@js-joda/timezone", libs.versions.npm.jsjoda.tz.get())) + sourceSets { + wasmJsMain { + dependencies { + // kotlinx-browser is only supported for WasmJs. + api(libs.kotlinx.browser) + api(libs.ktor.client.js) + // api(npm("@js-joda/timezone", libs.versions.npm.jsjoda.tz.get())) + } + } + wasmJsTest { kotlin {} } } } - wasmJsTest { kotlin {} } - } -} -context(Project) fun KotlinMultiplatformExtension.hostNativeTarget(configure: KotlinNativeTarget.() -> Unit = {}) = when { Platform.isMac -> { @@ -255,41 +257,46 @@ fun KotlinMultiplatformExtension.hostNativeTarget(configure: KotlinNativeTarget. } Platform.isWin -> mingwX64 { configure() } else -> - throw GradleException( - "Host OS '${Platform.currentOS}' is not supported in Kotlin/Native $project.") + throw GradleException("Host OS '${Platform.currentOS}' is not supported in Kotlin/Native") } -context(Project) -fun KotlinMultiplatformExtension.allNativeTargets(configure: KotlinNativeTarget.() -> Unit = {}) { - val nativeBuild: String? by project - if (nativeBuild.toBoolean()) { - macosX64 { configure() } - macosArm64 { configure() } - linuxX64 { configure() } - linuxArm64 { configure() } +fun KotlinNativeCompilerOptions.configureKotlinNative() { + freeCompilerArgs.addAll( + // "-Xverbose-phases=Linker" + // "-Xruntime-logs=gc=info" + ) +} - val nativeWinTarget: String? by project - if (nativeWinTarget.toBoolean()) { - mingwX64 { configure() } - } +fun KotlinMultiplatformExtension.allNativeTargets(configure: KotlinNativeTarget.() -> Unit = {}) { + fun KotlinNativeTarget.configureAll() { + // KotlinNativeTargetWithHostTests + compilerOptions { configureKotlinNative() } + configure() } + + macosX64 { configureAll() } + macosArm64 { configureAll() } + linuxX64 { configureAll() } + linuxArm64 { configureAll() } + mingwX64 { configureAll() } } -context(Project) fun KotlinMultiplatformExtension.addKspDependencyForAllTargets( + project: Project, dependencyNotation: Any, configurationNameSuffix: String = "" -) { - // val kotlin = extensions.getByType() - targets - .filter { target -> - // Don't add KSP for common target, only final platforms - target.platformType != KotlinPlatformType.common - } - .forEach { target -> - dependencies.add( - "ksp${target.targetName.replaceFirstChar { it.uppercaseChar() }}$configurationNameSuffix", - dependencyNotation, - ) - } -} +) = + with(project) { + // val kotlin = extensions.getByType() + targets + .filter { target -> + // Don't add KSP for common target, only final platforms + target.platformType != KotlinPlatformType.common + } + .forEach { target -> + dependencies.add( + "ksp${target.targetName.replaceFirstChar { it.uppercaseChar() }}$configurationNameSuffix", + dependencyNotation, + ) + } + } diff --git a/plugins/src/main/kotlin/common/ProjectExtns.kt b/plugins/src/main/kotlin/common/ProjectExtns.kt index de830f4..05c489a 100644 --- a/plugins/src/main/kotlin/common/ProjectExtns.kt +++ b/plugins/src/main/kotlin/common/ProjectExtns.kt @@ -18,7 +18,6 @@ import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.api.attributes.* import org.gradle.api.component.AdhocComponentWithVariants import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.api.provider.Provider import org.gradle.api.tasks.* import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.testing.* @@ -26,13 +25,10 @@ import org.gradle.api.tasks.testing.logging.* import org.gradle.internal.os.OperatingSystem import org.gradle.jvm.toolchain.* import org.gradle.kotlin.dsl.* -import org.gradle.plugin.use.PluginDependency -import org.jetbrains.dokka.gradle.AbstractDokkaTask import org.jetbrains.kotlin.gradle.dsl.* import org.jetbrains.kotlin.gradle.plugin.* import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import org.jetbrains.kotlin.gradle.testing.internal.KotlinTestReport // val logger = LoggerFactory.getLogger("build-logic") @@ -69,9 +65,6 @@ val Project.skipTest val Project.hasCleanTask get() = gradle.startParameter.taskNames.any { it in listOf("clean", "cleanAll") } -val Project.hasDokkaTasks - get() = gradle.taskGraph.allTasks.filterIsInstance().any() - val Project.isSnapshotVersion get() = version.toString().endsWith("SNAPSHOT", true) @@ -117,17 +110,19 @@ val Project.githubRepo get() = "https://github.com/${githubUser}/${rootProject.name}" /** For publishing to maven central and GitHub */ -val Project.signingKey - get() = providers.gradleProperty("signingKey") +val Project.signingInMemoryKey + get() = providers.gradleProperty("signingInMemoryKey") -val Project.signingKeyId - get() = providers.gradleProperty("signingKeyId") +val Project.signingInMemoryKeyId + get() = providers.gradleProperty("signingInMemoryKeyId") -val Project.signingPassword - get() = providers.gradleProperty("signingPassword") +val Project.signingInMemoryKeyPassword + get() = providers.gradleProperty("signingInMemoryKeyPassword") val Project.hasSigningKey - get() = signingKey.orNull.isNullOrBlank().not() && signingPassword.orNull.isNullOrBlank().not() + get() = + signingInMemoryKey.orNull.isNullOrBlank().not() && + signingInMemoryKeyPassword.orNull.isNullOrBlank().not() val Project.mavenCentralUsername get() = providers.gradleProperty("mavenCentralUsername") @@ -135,12 +130,11 @@ val Project.mavenCentralUsername val Project.mavenCentralPassword get() = providers.gradleProperty("mavenCentralPassword") -val Project.githubActor - get() = providers.gradleProperty("githubActor") - -val Project.githubToken - get() = providers.gradleProperty("githubToken") +val Project.githubPackagesUsername + get() = providers.gradleProperty("githubPackagesUsername") +val Project.githubPackagesPassword + get() = providers.gradleProperty("githubPackagesPassword") /** Kotlin Dependencies extension functions. */ val Project.isKotlinMultiplatformProject get() = plugins.hasPlugin("org.jetbrains.kotlin.multiplatform") @@ -193,7 +187,6 @@ fun Project.jvmArguments(appRun: Boolean = false, headless: Boolean = true) = bu "-XX:+PrintCommandLineFlags", "--enable-native-access=ALL-UNNAMED", "--illegal-native-access=warn", - "-Xms64M", "-Xmx128M", "-XX:+UseZGC", "-XX:+UseStringDeduplication", @@ -343,105 +336,97 @@ val Project.jvmRunArgs */ fun kotlinw(target: String) = "org.jetbrains.kotlin-wrappers:kotlin-$target" -/** Returns the dependency artifact for the given Gradle plugin. */ -fun Provider.toDep() = map { - "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version.requiredVersion}" -} - // https://kotlinlang.org/docs/multiplatform-set-up-targets.html#distinguish-several-targets-for-one-platform val mppTargetAttr = Attribute.of("mpp.target.name", String::class.java) -context(Project) fun KotlinTarget.setTargetAttribute() { attributes.attribute(mppTargetAttr, targetName) } -context(Project) -fun JavaToolchainSpec.configureJvmToolchain() { - languageVersion = toolchainVersion - // vendor = toolchainVendor -} +fun JavaToolchainSpec.configureJvmToolchain(project: Project) = + with(project) { + languageVersion = toolchainVersion + // vendor = toolchainVendor + } -context(Project) -fun JavaCompile.configureJavac() { - options.apply { - encoding = Charsets.UTF_8.name() - release = javaRelease - isIncremental = true - isFork = true - debugOptions.debugLevel = "source,lines,vars" - // For Gradle worker daemon. - forkOptions.jvmArgs?.addAll(jvmArguments()) - // Javac options - compilerArgs.addAll( - buildList { - addAll(jvmArguments()) - add("-Xlint:all") - add("-parameters") - // add("-Xlint:-deprecation") - // add("-Xlint:lossy-conversions") - // add("-XX:+IgnoreUnrecognizedVMOptions") - // add("--add-exports") - // add("java.base/sun.nio.ch=ALL-UNNAMED") - // add("--patch-module") - // add("$moduleName=${sourceSets.main.get().output.asPath}") - // add("-Xplugin:unchecked") // compiler plugin - }) - - // Add the Kotlin classes to the module path (compileKotlinJvm) - val compileKotlin = tasks.findByName("compileKotlin") as? KotlinCompile - if (compileKotlin != null) { - compilerArgumentProviders += - PatchModuleArgProvider( - provider { project.group.toString() }, compileKotlin.destinationDirectory) +fun JavaCompile.configureJavac(project: Project) = + with(project) { + options.apply { + encoding = Charsets.UTF_8.name() + release = javaRelease + isIncremental = true + isFork = true + debugOptions.debugLevel = "source,lines,vars" + // For Gradle worker daemon. + forkOptions.jvmArgs?.addAll(jvmArguments()) + // Javac options + compilerArgs.addAll( + buildList { + addAll(jvmArguments()) + add("-Xlint:all") + add("-parameters") + // add("-Xlint:-deprecation") + // add("-Xlint:lossy-conversions") + // add("-XX:+IgnoreUnrecognizedVMOptions") + // add("--add-exports") + // add("java.base/sun.nio.ch=ALL-UNNAMED") + // add("--patch-module") + // add("$moduleName=${sourceSets.main.get().output.asPath}") + // add("-Xplugin:unchecked") // compiler plugin + }) + + // Add the Kotlin classes to the module path (compileKotlinJvm) + val compileKotlin = tasks.findByName("compileKotlin") as? KotlinCompile + if (compileKotlin != null) { + compilerArgumentProviders += + PatchModuleArgProvider( + provider { project.group.toString() }, compileKotlin.destinationDirectory) + } + } } - } -} -context(Project) -fun KotlinCommonCompilerOptions.configureKotlinCommon() { - apiVersion = kotlinApiVersion - languageVersion = kotlinLangVersion - progressiveMode = true - allWarningsAsErrors = false - suppressWarnings = false - verbose = false - freeCompilerArgs.addAll( - "-Xcontext-receivers", - "-Xexpect-actual-classes", - "-Xskip-prerelease-check", - // "-XXLanguage:+ExplicitBackingFields", - // "-Xsuppress-version-warnings", - // "-Xsuppress-warning=CONTEXT_RECEIVERS_DEPRECATED" - // "-P", - // "plugin:...=..." - ) - optIn.addAll( - "kotlin.ExperimentalStdlibApi", - "kotlin.contracts.ExperimentalContracts", - "kotlin.ExperimentalUnsignedTypes", - "kotlin.io.encoding.ExperimentalEncodingApi", - "kotlin.time.ExperimentalTime", - "kotlinx.coroutines.ExperimentalCoroutinesApi", - "kotlinx.serialization.ExperimentalSerializationApi", - "kotlin.ExperimentalMultiplatform", - "kotlin.js.ExperimentalJsExport", - "kotlin.experimental.ExperimentalNativeApi", - "kotlinx.cinterop.ExperimentalForeignApi", - // "kotlin.uuid.ExperimentalUuidApi", - // "org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi", - ) -} +fun KotlinCommonCompilerOptions.configureKotlinCommon(project: Project) = + with(project) { + apiVersion = kotlinApiVersion + languageVersion = kotlinLangVersion + progressiveMode = true + allWarningsAsErrors = false + suppressWarnings = false + verbose = false + freeCompilerArgs.addAll( + "-Xexpect-actual-classes", + "-Xskip-prerelease-check", + // "-XXLanguage:+ExplicitBackingFields", + // "-Xsuppress-version-warnings", + // "-P", + // "plugin:...=..." + ) + optIn.addAll( + "kotlin.ExperimentalStdlibApi", + "kotlin.contracts.ExperimentalContracts", + "kotlin.ExperimentalUnsignedTypes", + "kotlin.io.encoding.ExperimentalEncodingApi", + "kotlin.time.ExperimentalTime", + "kotlinx.coroutines.ExperimentalCoroutinesApi", + "kotlinx.serialization.ExperimentalSerializationApi", + "kotlin.ExperimentalMultiplatform", + "kotlin.js.ExperimentalJsExport", + "kotlin.experimental.ExperimentalNativeApi", + "kotlinx.cinterop.ExperimentalForeignApi", + "kotlin.uuid.ExperimentalUuidApi", + // "org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi", + ) + } -context(Project) -fun KspAATask.configureKspConfig() { - kspConfig.apply { - apiVersion = kotlinApiVersion.map { it.version } - jvmTarget = kotlinJvmTarget.map { it.target } - languageVersion = kotlinLangVersion.map { it.version } - allWarningsAsErrors = false - } -} +fun KspAATask.configureKspConfig() = + with(project) { + kspConfig.apply { + apiVersion = kotlinApiVersion.map { it.version } + jvmTarget = kotlinJvmTarget.map { it.target } + languageVersion = kotlinLangVersion.map { it.version } + allWarningsAsErrors = false + } + } /** * JVM backend compiler options can be found in, @@ -452,59 +437,49 @@ fun KspAATask.configureKspConfig() { * Gradle Kotlin DSL Api/Lang versions, * - [KotlinDslCompilerPlugins.kt](https://github.com/gradle/gradle/blob/master/platforms/core-configuration/kotlin-dsl-plugins/src/main/kotlin/org/gradle/kotlin/dsl/plugins/dsl/KotlinDslCompilerPlugins.kt#L63-L64) */ -context(Project) -fun KotlinJvmCompilerOptions.configureKotlinJvm() { - jvmTarget = kotlinJvmTarget - apiVersion = kotlinApiVersion - languageVersion = kotlinLangVersion - javaParameters = true - verbose = true - allWarningsAsErrors = false - suppressWarnings = false - freeCompilerArgs.addAll( - "-Xadd-modules=$addModules", - "-Xjsr305=strict", - "-Xjvm-default=all", - "-Xassertions=jvm", - "-Xcontext-receivers", - "-Xemit-jvm-type-annotations", - "-Xjspecify-annotations=strict", - "-Xextended-compiler-checks", - "-Xskip-prerelease-check", - // Remove null check intrinsics from bytecode - "-Xno-param-assertions", - "-Xno-call-assertions", - "-Xno-receiver-assertions", - // "-Xjdk-release=${kotlinJvmTarget.get().target}", - // "-Xadd-modules=ALL-MODULE-PATH", - // "-Xmodule-path=", - // "-Xjvm-enable-preview", - // "-Xjavac-arguments=\"--add-exports java.base/sun.nio.ch=ALL-UNNAMED\"", - // "-Xexplicit-api={strict|warning|disable}", - // "-Xgenerate-strict-metadata-version", - // "-Xuse-kapt4", - ) -} - -context(Project) -fun KotlinNativeCompilerOptions.configureKotlinNative() { - freeCompilerArgs.addAll( - // "-Xverbose-phases=Linker" - // "-Xruntime-logs=gc=info" +fun KotlinJvmCompilerOptions.configureKotlinJvm(project: Project) = + with(project) { + jvmTarget = kotlinJvmTarget + apiVersion = kotlinApiVersion + languageVersion = kotlinLangVersion + javaParameters = true + verbose = true + allWarningsAsErrors = false + suppressWarnings = false + freeCompilerArgs.addAll( + "-Xadd-modules=$addModules", + "-Xjsr305=strict", + "-Xjvm-default=all", + "-Xassertions=jvm", + "-Xemit-jvm-type-annotations", + "-Xjspecify-annotations=strict", + "-Xextended-compiler-checks", + "-Xskip-prerelease-check", + // Remove null check intrinsics from bytecode + "-Xno-param-assertions", + "-Xno-call-assertions", + "-Xno-receiver-assertions", + // "-Xjdk-release=${kotlinJvmTarget.get().target}", + // "-Xadd-modules=ALL-MODULE-PATH", + // "-Xmodule-path=", + // "-Xjvm-enable-preview", + // "-Xjavac-arguments=\"--add-exports java.base/sun.nio.ch=ALL-UNNAMED\"", + // "-Xexplicit-api={strict|warning|disable}", + // "-Xgenerate-strict-metadata-version", + // "-Xuse-kapt4", ) -} + } -context(Project) fun Test.configureJavaTest() { useJUnitPlatform() - jvmArgs(jvmArguments()) + jvmArgs(project.jvmArguments()) // For JUnit5 @EnabledIfSystemProperty systemProperty("ktorTest", project.hasProperty("ktorTest")) systemProperty("k8sTest", project.hasProperty("k8sTest")) systemProperty("spring.classformat.ignore", true) // Custom hosts file for tests - val customHostFile = layout.projectDirectory.file("src/test/resources/hosts").asFile + val customHostFile = project.layout.projectDirectory.file("src/test/resources/hosts").asFile if (customHostFile.exists()) { systemProperty("jdk.net.hosts.file", customHostFile.absolutePath) } @@ -562,10 +537,6 @@ fun TestLoggingContainer.configureLogEvents() { } } -context(Project) -fun KotlinTestReport.configureTestReport() {} - -context(Project) fun KotlinJsCompilerOptions.configureKotlinJs() { // freeCompilerArgs.addAll("-Xir-per-file") // target = "es2015" @@ -573,7 +544,6 @@ fun KotlinJsCompilerOptions.configureKotlinJs() { // sourceMapEmbedSources = "always" } -context(Project) fun KotlinNpmInstallTask.configureKotlinNpm() { args.add("--ignore-engines") } @@ -583,7 +553,6 @@ fun KotlinNpmInstallTask.configureKotlinNpm() { * * @param dependencyNotation The notation of the dependency to add. */ -context(Project) fun KotlinSourceSet.ksp(dependencyNotation: Any) { val kspConfiguration = when { @@ -594,27 +563,24 @@ fun KotlinSourceSet.ksp(dependencyNotation: Any) { name.endsWith("Main") -> name.substringBeforeLast("Main") else -> name }.replaceFirstChar { it.uppercaseChar() } - dependencies.add("ksp$kspConfiguration", dependencyNotation) + project.dependencies.add("ksp$kspConfiguration", dependencyNotation) } -/** Returns the path of the dependency jar in runtime classpath. */ -context(Project) -val ExternalDependency.dependencyPath: Provider - get() = provider { - configurations - .named("runtimeClasspath") - .get() - .resolvedConfiguration - .resolvedArtifacts - .find { it.moduleVersion.id.module == module } - ?.file - ?.path - } +/** Returns the path of dependency jar in the runtime classpath. */ +fun Project.depPathOf(dep: ExternalDependency) = provider { + configurations + .named("runtimeClasspath") + .get() + .resolvedConfiguration + .resolvedArtifacts + .find { it.moduleVersion.id.module == dep.module } + ?.file + ?.path +} /** Returns the application `run` command. */ -context(Project) -fun Path.appRunCmd(args: List): String { - val path = layout.projectDirectory.asFile.toPath().relativize(this) +fun Project.appRunCmd(binary: Path, args: List): String { + val path = layout.projectDirectory.asFile.toPath().relativize(binary) val newLine = System.lineSeparator() val lineCont = """\""" // Bash line continuation val indent = "\t" @@ -643,7 +609,7 @@ val Project.javaToolchainPath val jLauncher = when (defToolchain != null) { true -> javaToolchainSvc?.launcherFor(defToolchain) - else -> javaToolchainSvc?.launcherFor { configureJvmToolchain() } + else -> javaToolchainSvc?.launcherFor { configureJvmToolchain(project) } }?.orNull return jLauncher?.metadata?.installationPath?.asFile?.toPath() @@ -655,14 +621,15 @@ val Project.incubatorModules get(): String { val javaCmd = project.javaToolchainPath.resolve("bin").resolve("java") val bos = ByteArrayOutputStream() - val execResult = exec { - workingDir = layout.buildDirectory.get().asFile - commandLine = listOf(javaCmd.toString()) - args = listOf("--list-modules") - standardOutput = bos - errorOutput = bos - } - execResult.assertNormalExitValue() + val execResult = + providers.exec { + workingDir = layout.buildDirectory.get().asFile + commandLine = listOf(javaCmd.toString()) + args = listOf("--list-modules") + standardOutput = bos + errorOutput = bos + } + execResult.result.get().assertNormalExitValue() return bos.toString(Charsets.UTF_8) .lines() .filter { it.startsWith("jdk.incubator") } diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.graalvm.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.graalvm.gradle.kts index c421a0b..41abc64 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.graalvm.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.graalvm.gradle.kts @@ -102,7 +102,7 @@ graalvmNative { jvmArgs = jvmArguments() systemProperties = mapOf("java.awt.headless" to "false") - javaLauncher = javaToolchains.launcherFor { configureJvmToolchain() } + javaLauncher = javaToolchains.launcherFor { configureJvmToolchain(project) } } agent { diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.benchmark.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.benchmark.gradle.kts index 21266f9..bce54e0 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.benchmark.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.benchmark.gradle.kts @@ -1,4 +1,4 @@ -import common.libs +import common.* import kotlinx.benchmark.gradle.BenchmarkTarget import kotlinx.benchmark.gradle.KotlinJvmBenchmarkTarget @@ -19,6 +19,8 @@ group = libs.versions.group.get() description = "Kotlin benchmarking tests" +kotlin { jvmTarget(project) } + allOpen { annotation("org.openjdk.jmh.annotations.State") } benchmark { diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts index d56c0a1..71d6779 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.docs.gradle.kts @@ -1,52 +1,28 @@ import common.* -import java.net.URI +import java.time.Year import org.hildan.github.changelog.plugin.GitHubChangelogExtension -import org.jetbrains.dokka.DokkaConfiguration.Visibility -import org.jetbrains.dokka.base.DokkaBase -import org.jetbrains.dokka.base.DokkaBaseConfiguration -import org.jetbrains.dokka.gradle.DokkaMultiModuleTask -import org.jetbrains.dokka.gradle.DokkaTaskPartial -import org.jetbrains.kotlin.gradle.tasks.KotlinTest +import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier plugins { org.jetbrains.dokka com.diffplug.spotless - `test-report-aggregation` + // org.jetbrains.`dokka-javadoc` + // `test-report-aggregation` } // The following plugins and config apply only to a root project. if (isRootProject) { apply(plugin = "org.hildan.github.changelog") - // Combined test report - dependencies { - allprojects.filter { !it.path.contains(":dep-mgmt") }.forEach { testReportAggregation(it) } - } - - // Dokka multi-module config. - tasks.withType().configureEach { - description = project.description.orEmpty() - moduleName = project.name - pluginConfiguration { - // Override the default dokka logo and styles - // val rootPath = rootProject.rootDir.toPath() - // customAssets = listOf(rootPath.resolve("app-logo.svg")) - // customStyleSheets = listOf(rootPath.resolve("logo-styles.css")) - // templatesDir = rootPath.resolve("templates") - footerMessage = "Copyright © 2024 suresh.dev" - homepageLink = githubRepo - separateInheritedMembers = false - mergeImplicitExpectActualDeclarations = false - } - } - // Combined test reports val allTestReports by tasks.registering(TestReport::class) { - destinationDirectory = layout.buildDirectory.dir("reports/tests/test") - allprojects.forEach { - testResults.from(it.tasks.withType(), it.tasks.withType()) - } + group = LifecycleBasePlugin.VERIFICATION_GROUP + description = "Generates aggregated test report for all tests." + destinationDirectory = layout.buildDirectory.dir("reports/allTests") + + // Include the results from the `test` task in all subprojects + allprojects.forEach { testResults.from(it.tasks.withType()) } doLast { logger.lifecycle("All test reports are aggregated in ${destinationDirectory.get()}") @@ -54,8 +30,55 @@ if (isRootProject) { } } -pluginManager.withPlugin("org.hildan.github.changelog") { - configure { githubUser = project.githubUser } +dokka { + moduleName = project.name + dokkaSourceSets.configureEach { + // includes.from("README.md") + jdkVersion = kotlinJvmTarget.map { it.target.toInt() } + enableKotlinStdLibDocumentationLink = true + enableJdkDocumentationLink = true + reportUndocumented = false + skipDeprecated = true + + sourceLink { + localDirectory = rootDir + remoteUrl = uri("${githubRepo}/tree/main") + remoteLineSuffix = "#L" + } + + perPackageOption { + matchingRegex = ".*internal.*" + suppress = true + } + + documentedVisibilities = setOf(VisibilityModifier.Public) + + samples.from("src/test/kotlin") + + externalDocumentationLinks { + register("kotlinx.coroutines") { url("https://kotlinlang.org/api/kotlinx.coroutines/") } + register("kotlinx.serialization") { url("https://kotlinlang.org/api/kotlinx.serialization/") } + register("kotlinx-datetime") { + url("https://kotlinlang.org/api/kotlinx-datetime/") + packageListUrl("https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/package-list") + } + register("ktor") { url("https://api.ktor.io/") } + } + + // dokkaPublicationDirectory = rootProject.layout.buildDirectory.dir("dokkaDir") + } + + pluginsConfiguration.html { + footerMessage = "Copyright © ${Year.now()} suresh.dev" + homepageLink = githubRepo + separateInheritedMembers = false + mergeImplicitExpectActualDeclarations = false + + // val rootPath = rootProject.rootDir + // customAssets.from(rootPath.resolve("app-logo.svg")) + // customStyleSheets.from(rootPath.resolve("logo-styles.css")) + // templatesDir = rootProject.file("dokka-templates") + } } spotless { @@ -70,10 +93,8 @@ spotless { val ktfmtVersion = libs.versions.ktfmt.get() kotlin { ktfmt(ktfmtVersion) - target("**/*.kt") - targetExclude("**/build/**", "**/Service.kt") + target("src/**/*.kts", "src/**/*.kt") trimTrailingWhitespace() - endWithNewline() // licenseHeader(rootProject.file("gradle/license-header.txt")) } @@ -82,56 +103,16 @@ spotless { target("**/*.gradle.kts") targetExclude("**/build/**") trimTrailingWhitespace() - endWithNewline() } format("misc") { - target("**/*.md", "**/.gitignore", "**/.kte") + target("**/*.md", "**/.kte") targetExclude("**/build/**") trimTrailingWhitespace() indentWithSpaces(2) - endWithNewline() } } -tasks { - withType().configureEach { - dokkaSourceSets.configureEach { - moduleName = project.name - jdkVersion = kotlinJvmTarget.map { it.target.toInt() } - noStdlibLink = false - noJdkLink = false - reportUndocumented = false - skipDeprecated = true - // includes.from("README.md") - documentedVisibilities = setOf(Visibility.PUBLIC, Visibility.PROTECTED) - - sourceLink { - localDirectory = rootProject.projectDir - remoteUrl = URI("${githubRepo}/tree/main").toURL() - remoteLineSuffix = "#L" - } - - samples.from("src/test/kotlin") - - perPackageOption { - matchingRegex = ".*internal.*" - suppress = true - } - // externalDocumentationLink(url = "https://kotlinlang.org/api/kotlinx.coroutines/") - // externalDocumentationLink(url = "https://kotlinlang.org/api/kotlinx.serialization/") - // externalDocumentationLink(url = "https://kotlinlang.org/api/kotlinx-datetime/", - // packageListUrl = - // "https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/package-list") - // externalDocumentationLink(url = "https://api.ktor.io/") - } - - // pluginsMapConfiguration = mapOf("org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" - // : "${projectDir.toString().replace('\\','/')}/../dokka-templates" }""") - - pluginConfiguration { - footerMessage = "Copyright © 2024 suresh.dev" - homepageLink = githubRepo - } - } +pluginManager.withPlugin("org.hildan.github.changelog") { + configure { githubUser = project.githubUser } } diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts index ecfc5a1..893bc7f 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.jvm.gradle.kts @@ -36,14 +36,14 @@ apply(plugin = "dev.suresh.plugin.depreports") java { withSourcesJar() withJavadocJar() - toolchain { configureJvmToolchain() } + toolchain { configureJvmToolchain(project) } } kotlin { - jvmToolchain { configureJvmToolchain() } + jvmToolchain { configureJvmToolchain(project) } compilerOptions { - configureKotlinCommon() - configureKotlinJvm() + configureKotlinCommon(project) + configureKotlinJvm(project) } // sourceSets.all { kotlin.setSrcDirs(listOf("src/kotlin")) } } @@ -59,7 +59,6 @@ testing { atomicfu { transformJvm = true - transformJs = true jvmVariant = "VH" } @@ -83,7 +82,7 @@ val javaAgent by configurations.registering { isTransitive = false } tasks { // Configure "compileJava" and "compileTestJava" tasks. - withType().configureEach { configureJavac() } + withType().configureEach { configureJavac(project) } // withType().configureEach { finalizedBy("spotlessApply") } @@ -184,8 +183,8 @@ tasks { """ |Application modules for OpenJDK-${javaRelease.get()} are, |${modules.split(",") - .mapIndexed { i, module -> " ${(i + 1).toString().padStart(2)}) $module" } - .joinToString(System.lineSeparator())} + .mapIndexed { i, module -> " ${(i + 1).toString().padStart(2)}) $module" } + .joinToString(System.lineSeparator())} """ .trimMargin()) } diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts index a88f844..dfd4cf9 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.kotlin.mpp.gradle.kts @@ -1,4 +1,5 @@ @file:Suppress("UnstableApiUsage") +@file:OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalBCVApi::class) import com.google.devtools.ksp.gradle.KspAATask import common.* @@ -7,6 +8,7 @@ import java.time.format.DateTimeFormatter import java.util.jar.Attributes import kotlinx.validation.* import org.gradle.internal.os.OperatingSystem +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.targets.js.nodejs.* import org.jetbrains.kotlin.gradle.targets.js.npm.* import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask @@ -31,26 +33,25 @@ plugins { // dev.mokkery } +val nativeBuild: String? by project + kotlin { - commonTarget() + commonTarget(project) when (project.name) { sharedProjectName -> { - jvmTarget() - jsTarget() - wasmJsTarget() - allNativeTargets { compilerOptions { configureKotlinNative() } } - } - "native" -> allNativeTargets { compilerOptions { configureKotlinNative() } } - "web" -> { - jsTarget() - wasmJsTarget() + jvmTarget(project) + jsTarget(project) + wasmJsTarget(project) + if (nativeBuild.toBoolean()) { + allNativeTargets {} + } } - "cmp" -> { - jvmTarget() - wasmJsTarget() + + "web", + "frontend" -> { + jsTarget(project) + wasmJsTarget(project) } - "html" -> jsTarget() - else -> jvmTarget() } applyDefaultHierarchyTemplate { @@ -78,7 +79,6 @@ kotlin { atomicfu { transformJvm = true - transformJs = true jvmVariant = "VH" } @@ -99,8 +99,7 @@ redacted { // kopy { functions = KopyFunctions.Copy } tasks { - // Register buildConfig task only for project's common module - if (project.isSharedProject) { + if (isSharedProject) { val buildConfigExtn = extensions.create("buildConfig") val buildConfig by register("buildConfig", buildConfigExtn) kotlin.sourceSets.commonMain { kotlin.srcDirs(buildConfig) } @@ -112,7 +111,7 @@ tasks { withType().configureEach { configureKotlinNpm() } - // withType().configureEach { } + // withType().configureEach {} withType().configureEach { manifest { diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.publishing.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.publishing.gradle.kts index 43c6df1..f2383d2 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.publishing.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.publishing.gradle.kts @@ -8,20 +8,6 @@ plugins { `maven-publish` signing com.gradleup.nmcp - // org.cyclonedx.bom -} - -// Nexus plugin needs to apply to the root project only -if (isRootProject) { - apply(plugin = "io.github.gradle-nexus.publish-plugin") - - nmcp { - publishAggregation { - username = mavenCentralUsername - password = mavenCentralPassword - publicationType = "AUTOMATIC" - } - } } group = libs.versions.group.get() @@ -37,9 +23,8 @@ publishing { name = "GitHubPackages" url = uri(githubPackage(libs.versions.dev.name.get(), rootProject.name)) credentials { - // findProperty("githubActor") - username = githubActor.orNull ?: System.getenv("GITHUB_ACTOR") - password = githubToken.orNull ?: System.getenv("GITHUB_TOKEN") + username = githubPackagesUsername.orNull + password = githubPackagesPassword.orNull } } } @@ -96,13 +81,13 @@ publishing { // Add Dokka html doc to all publications pluginManager.withPlugin("org.jetbrains.dokka") { - val dokkaHtmlJar by + val dokkaGenerateJar by tasks.registering(Jar::class) { - from(tasks.named("dokkaHtml")) + from(tasks.named("dokkaGenerate")) archiveClassifier = "html-docs" } - withType().configureEach { artifact(dokkaHtmlJar) } + withType().configureEach { artifact(dokkaGenerateJar) } } } } @@ -113,8 +98,8 @@ pluginManager.withPlugin("com.google.cloud.tools.jib") { to { if (image.orEmpty().startsWith("ghcr.io", ignoreCase = true)) { auth { - username = githubActor.orNull ?: System.getenv("GITHUB_ACTOR") - password = githubToken.orNull ?: System.getenv("GITHUB_TOKEN") + username = githubPackagesUsername.orNull + password = githubPackagesPassword.orNull } } } @@ -124,10 +109,10 @@ pluginManager.withPlugin("com.google.cloud.tools.jib") { signing { setRequired { hasSigningKey } if (hasSigningKey) { - useInMemoryPgpKeys(signingKeyId.orNull, signingKey.orNull, signingPassword.orNull) + useInMemoryPgpKeys( + signingInMemoryKeyId.orNull, signingInMemoryKey.orNull, signingInMemoryKeyPassword.orNull) + sign(publishing.publications) } - sign(publishing.publications) - // gradle.taskGraph.allTasks.any { it.name.startsWith("publish") } } nmcp { @@ -179,12 +164,4 @@ tasks { // For publishing kotlin native binaries withType().configureEach { mustRunAfter(withType()) } - - // cyclonedxBom { - // includeConfigs = listOf("runtimeClasspath") - // skipConfigs = listOf("compileClasspath", "testCompileClasspath") - // destination = project.layout.buildDirectory.dir("sbom").map { it.asFile } - // outputFormat = "json" - // includeLicenseText = true - // } } diff --git a/plugins/src/main/kotlin/dev.suresh.plugin.root.gradle.kts b/plugins/src/main/kotlin/dev.suresh.plugin.root.gradle.kts index b92d23d..b2ec501 100644 --- a/plugins/src/main/kotlin/dev.suresh.plugin.root.gradle.kts +++ b/plugins/src/main/kotlin/dev.suresh.plugin.root.gradle.kts @@ -82,14 +82,8 @@ tasks { withType().configureEach { isPreserveFileTimestamps = false isReproducibleFileOrder = true - dirPermissions { - // 0b111111101 - unix("rwxrwxr-x") - } - filePermissions { - // 0b110110100 - unix("rw-rw-r--") - } + dirPermissions { unix("rwxrwxr-x") } + filePermissions { unix("rw-rw-r--") } } val githubActionOutput by registering { @@ -113,12 +107,7 @@ tasks { group = BasePlugin.BUILD_GROUP dependsOn(allprojects.map { it.tasks.build }) - dependsOn( - ":allTestReports", - ":dokkaHtmlMultiModule", - ":koverHtmlReport", - /*":testAggregateTestReport"*/ - ) + dependsOn(":allTestReports", ":dokkaGenerate", ":koverHtmlReport") when { // Publishing to all repos on GitHub Action tag build @@ -183,7 +172,7 @@ tasks { // distributionUrl = "${Repo.GRADLE_DISTRO}/gradle-$gradleVersion-bin.zip" } - // dependencyAnalysis { issues { this.all { onAny { severity("warn") } } } } + // withType { jvmVersion = gradleDaemonJvm } defaultTasks("clean", "tasks", "--all") } diff --git a/sandbox/gradle.properties b/sandbox/gradle.properties index 2669988..67c5aa4 100644 --- a/sandbox/gradle.properties +++ b/sandbox/gradle.properties @@ -12,13 +12,48 @@ org.gradle.unsafe.isolated-projects=false ## Kotlin kotlin.code.style=official +kotlin.daemon.jvmargs=--enable-native-access=ALL-UNNAMED kotlin.jvm.target.validation.mode=warning +kotlinx.atomicfu.enableJvmIrTransformation=true +kotlinx.atomicfu.enableNativeIrTransformation=true +kotlinx.atomicfu.enableJsIrTransformation=true + +## Kotlin/JS +kotlin.js.yarn=false + +## KotlinNative +kotlin.incremental.native=true +kotlin.native.binary.gc=cms +kotlin.native.ignoreDisabledTargets=true +kotlin.mpp.enableCInteropCommonization=true + +## Dokka +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true + +## KSP +ksp.useKSP2=true +ksp.version.check=false + +# Compose +org.jetbrains.compose.experimental.wasm.enabled=true +org.jetbrains.compose.experimental.macos.enabled=true +kotlin.mpp.filterResourcesByExtension=true +# compose.resources.always.generate.accessors=true # Project +semver.tagPrefix=v semver.project.tagPrefix=v semver.checkClean=false semver.commitsMaxCount=100 -# semver.logOnlyOnRootProject=true +semver.logOnlyOnRootProject=true +# semver.stage=dev|alpha|beta|rc|snapshot|final|auto +# semver.scope=auto|major|minor|patch +# semver.remote=origin + +# Snapshot Repo +enableMavenSnapshot=false +debug=false # Sandbox Testing -test.version=0.11.0 \ No newline at end of file +test.version=0.11.0.1+6f8a608 \ No newline at end of file diff --git a/sandbox/gradle/libs.versions.toml b/sandbox/gradle/libs.versions.toml index 59fafa9..9a458d5 100644 --- a/sandbox/gradle/libs.versions.toml +++ b/sandbox/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] java = "21" -kotlin = "2.1.0-Beta1" -kotlin-ksp = "2.1.0-Beta1-1.0.25" +kotlin = "2.1.0-Beta2" +kotlin-ksp = "2.1.0-Beta2-1.0.25" kotlin-jvmtarget = "21" kotlin-dsl-jvmtarget = "21" -kotlin-api-version = "1.9" +kotlin-api-version = "2.1" kotlin-lang-version = "2.1" -gradle = "8.10.2" +gradle = "8.11-rc-1" java-vendor = "Oracle" java-jvmArguments = "--enable-preview" java-addModules = "jdk.incubator.vector" @@ -22,7 +22,7 @@ org-url = "https://suresh.dev" # Gradle Dependencies Versions kotlinx-kover = "0.9.0-RC" kotlinx-io = "0.5.4" -kotlinx-atomicfu = "0.25.0" +kotlinx-atomicfu = "0.26.0" kotlinx-coroutines = "1.9.0" kotlinx-datetime = "0.6.1" kotlinx-serialization = "1.7.3" @@ -31,19 +31,19 @@ kotlinx-collections-immutable = "0.3.8" kotlinx-lincheck = "2.34" kotlinx-html = "0.11.0" kotlinx-browser = "0.2" -kotlinx-benchmark = "0.4.11" +kotlinx-benchmark = "0.4.12" kotlinx-metadata = "0.9.0" kotlinx-reflect-lite = "1.1.0" kotlinx-bcv = "0.16.3" -kotlin-dokka = "1.9.20" -kotlin-wrappers = "1.0.0-pre.817" +kotlin-dokka = "2.0.0-Beta" +kotlin-wrappers = "1.0.0-pre.820" kotlin-redacted = "1.11.0-alpha01" kotlinx-multik = "0.2.3" kotlinx-dataframe = "0.13.1" kotlinx-kandy = "0.5.0" evas = "1.1.0" -kopy = "0.11.0+2.0.20" -poko = "0.17.1" +kopy = "0.12.0+2.0.21" +poko = "0.17.2" mappie = "0.8.0" akkurate = "0.10.0" konsist = "0.16.1" @@ -53,11 +53,11 @@ spring-boot = "3.3.4" spring-depmgmt = "1.1.6" ktor = "3.0.0" ktor-cohort = "2.5.1" -otel = "1.42.1" -otel-instr = "2.8.0" -otel-instr-alpha = "2.8.0-alpha" -otel-semconv = "1.27.0-alpha" -otel-samplers = "1.39.0-alpha" +otel = "1.43.0" +otel-instr = "2.9.0" +otel-instr-alpha = "2.9.0-alpha" +otel-semconv = "1.28.0-alpha" +otel-samplers = "1.40.0-alpha" elastic-otel = "0.4.0" okio = "3.9.1" sslcontext-kickstart = "8.3.7" @@ -76,17 +76,17 @@ jte = "3.1.13" jimfs = "1.3.0" sshj = "0.38.0" jsch = "0.2.20" -pty4j = "0.13.0" -junit = "5.11.2" +pty4j = "0.13.2" +junit = "5.11.3" koin = "4.0.0" kotest = "6.0.0.M1" mockk = "1.13.13" mokkery = "2.4.0" -wiremock = "3.9.1" +wiremock = "3.9.2" wiremock-kotlin = "2.1.1" okhttp = "5.0.0-alpha.14" slf4j = "2.1.0-alpha1" -logback = "1.5.9" +logback = "1.5.11" logback-tyler = "0.7" log4j = "3.0.0-beta2" jmh = "1.37" @@ -107,11 +107,11 @@ kotlin-diff = "0.7.0" kotlin-retry = "2.0.1" kotlinx-jsonpath = "3.0.2" kotlinx-json-schema = "0.2.3" -kotlin-cryptography = "0.3.1" +kotlin-cryptography = "0.4.0" uri-kmp = "0.0.18" urlencoder = "1.5.0" bytesize = "2.0.0-beta04" -cash-turbine = "1.1.0" +cash-turbine = "1.2.0" cardiologist = "0.2.2" kmp-store5 = "5.1.0-alpha04" kmp-settings = "1.2.0" @@ -137,17 +137,17 @@ expiringmap = "0.5.10" otp = "2.0.3" password4j = "1.8.2" apache-commons-imaging = "1.0-alpha3" -testcontainers = "1.20.2" +testcontainers = "1.20.3" sourceBuddy = "2.5.0" tcp-javanioproxy = "1.6" -kubernetes-client = "21.0.1" +kubernetes-client = "21.0.2" reflect-typeparamresolver = "1.0.2" reflect-typetools = "0.6.3" async-profiler = "3.0" ap-loader-all = "3.0-9" openjdk-jmc = "9.0.0" airlift-aircompressor = "2.0.2" -airlift-security = "273" +airlift-security = "275" directory-keystore = "1.1.0" maven-mima = "3.0.0-alpha-3" maven-archeologist = "0.0.10" @@ -155,7 +155,7 @@ jfree-chart = "1.5.4" jfree-svg = "5.0.6" xchart = "3.8.7" batik = "1.17" -twelvemonkeys = "3.10.1" +twelvemonkeys = "3.12.0" okapibarcode = "0.4.1" chasm = "0.7.1" kfswatch = "1.3.0" @@ -165,16 +165,16 @@ ldaptive = "2.3.2" chicory = "0.0.12" # Compose -jetbrains-compose = "1.7.0-rc01" -jetbrains-compose-viewmodel = "2.8.3-rc01" +jetbrains-compose = "1.7.0" +jetbrains-compose-viewmodel = "2.8.3" jetbrains-compose-nav = "2.8.0-alpha10" -jetbrains-compose-adaptive = "1.0.0-rc01" +jetbrains-compose-adaptive = "1.0.0" kobweb = "0.19.2" detekt = "1.23.7" -detekt-compose-rules = "0.4.12" +detekt-compose-rules = "0.4.16" compose-icons = "1.1.0" compose-routing = "0.4.0" -kottie = "2.0.0" +kottie = "2.0.1" mosaic = "0.14.0" # NPM Dependencies @@ -191,14 +191,14 @@ foojay-resolver = "0.8.0" gradle-develocity = "3.18.1" nmcp = "0.0.9" nexus-publish = "2.0.0" -vanniktech-publish = "0.29.0" +vanniktech-publish = "0.30.0" shadow = "8.3.3" -spotless = "7.0.0.BETA2" +spotless = "7.0.0.BETA3" semver-plugin = "0.8.0" tasktree = "4.0.0" sigstore = "1.0.0" reproducible-builds = "1.0" -autonomousapps-depanalysis = "2.1.4" +autonomousapps-depanalysis = "2.2.0" autonomousapps-bestpractices = "0.10" graalvm-nativeimage = "0.10.3" github-depgraph = "0.1.0" @@ -211,7 +211,7 @@ modulegraph = "0.10.1" cash-molecule = "1.4.3" npm-publish-plugin = "3.4.3" exposed-plugin = "0.2.1" -jib-plugin = "3.4.3" +jib-plugin = "3.4.4" jib-nativeimage-extn = "0.1.0" includegit-plugin = "0.1.6" kmp-hierarchy = "1.1" @@ -238,7 +238,6 @@ build-kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicf build-kotlinx-benchmark = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-plugin" , version.ref = "kotlinx-benchmark"} build-kotlin-dsl = { module = "org.gradle.kotlin:gradle-kotlin-dsl-plugins" , version.ref = "gradle-kotlin-dsl"} build-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin" , version.ref = "kotlin-dokka"} -build-dokka-base = { module = "org.jetbrains.dokka:dokka-base" , version.ref = "kotlin-dokka"} build-kotlin-ksp = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin" , version.ref = "kotlin-ksp"} build-kopy-plugin = { module = "com.javiersc.kotlin:kopy-gradle-plugin" , version.ref = "kopy"} build-redacted-plugin = { module = "dev.zacsweers.redacted:redacted-compiler-plugin-gradle" , version.ref = "kotlin-redacted"} @@ -613,25 +612,25 @@ ldaptive = { module = "org.ldaptive:ldaptive" [bundles] ajalt = ["ajalt-colormath", - "ajalt-mordant", - "ajalt-mordant-coroutines", - "ajalt-mordant-markdown", - "ajalt-clikt-core", - "ajalt-clikt", - "ajalt-clikt-markdown"] + "ajalt-mordant", + "ajalt-mordant-coroutines", + "ajalt-mordant-markdown", + "ajalt-clikt-core", + "ajalt-clikt", + "ajalt-clikt-markdown"] json-extra = ["kotlinx-jsonpath", "kotlinx-json-schema"] keystore = ["sslcontext-kickstart", "directory-keystore"] otel = ["otel-instr-annotations", - "otel-autoconfigure", - "otel-semconv", - "otel-instr-ktor", - "otel-instr-logback-mdc", - "otel-instr-logback-appender"] + "otel-autoconfigure", + "otel-semconv", + "otel-instr-ktor", + "otel-instr-logback-mdc", + "otel-instr-logback-appender"] otel-agent-extn = ["otel-autoconfigure-spi", - "otel-instr-api", - "otel-instr-extension-api", - "otel-semconv"] + "otel-instr-api", + "otel-instr-extension-api", + "otel-semconv"] [plugins]