From 731430d7d64fc81bb7fde00e5f92117ae1bfc8ed Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Fri, 9 Jan 2026 09:40:00 -0600 Subject: [PATCH] refactor(build): Centralize Dokka configuration into convention plugin (#4173) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- app/build.gradle.kts | 4 - build-logic/convention/build.gradle.kts | 12 ++ .../AndroidApplicationConventionPlugin.kt | 2 + .../kotlin/AndroidLibraryConventionPlugin.kt | 3 +- .../src/main/kotlin/DokkaConventionPlugin.kt | 39 ++++++ .../main/kotlin/KmpLibraryConventionPlugin.kt | 2 + .../src/main/kotlin/KoverConventionPlugin.kt | 30 +++++ .../src/main/kotlin/RootConventionPlugin.kt | 15 ++- .../kotlin/org/meshtastic/buildlogic/Dokka.kt | 102 ++++++++++++++++ .../kotlin/org/meshtastic/buildlogic/Kover.kt | 65 ++++++++++ build.gradle.kts | 112 +----------------- core/common/build.gradle.kts | 7 +- core/data/build.gradle.kts | 3 +- core/datastore/build.gradle.kts | 3 +- core/model/build.gradle.kts | 3 +- core/navigation/build.gradle.kts | 3 +- core/network/build.gradle.kts | 2 - core/prefs/build.gradle.kts | 3 +- core/service/build.gradle.kts | 2 +- core/ui/build.gradle.kts | 1 - feature/firmware/build.gradle.kts | 1 - feature/intro/build.gradle.kts | 3 +- feature/map/build.gradle.kts | 1 - feature/messaging/build.gradle.kts | 1 - feature/node/build.gradle.kts | 1 - feature/settings/build.gradle.kts | 1 - gradle.properties | 3 - gradle/libs.versions.toml | 5 +- mesh_service_example/build.gradle.kts | 3 +- 29 files changed, 283 insertions(+), 149 deletions(-) create mode 100644 build-logic/convention/src/main/kotlin/DokkaConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/KoverConventionPlugin.kt create mode 100644 build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Dokka.kt create mode 100644 build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Kover.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b707b365f..783bb1fa8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -33,8 +33,6 @@ plugins { alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.devtools.ksp) alias(libs.plugins.secrets) - alias(libs.plugins.dokka) - alias(libs.plugins.kover) alias(libs.plugins.aboutlibraries) } @@ -250,8 +248,6 @@ dependencies { testImplementation(libs.junit) testImplementation(libs.kotlinx.coroutines.test) - - dokkaPlugin(libs.dokka.android.documentation.plugin) } aboutLibraries { diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 74b92f0fa..407b25cb5 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -50,9 +50,11 @@ dependencies { compileOnly(libs.compose.multiplatform.gradlePlugin) compileOnly(libs.datadog.gradlePlugin) compileOnly(libs.detekt.gradlePlugin) + compileOnly(libs.dokka.gradlePlugin) compileOnly(libs.firebase.crashlytics.gradlePlugin) compileOnly(libs.google.services.gradlePlugin) compileOnly(libs.hilt.gradlePlugin) + implementation(libs.kover.gradlePlugin) compileOnly(libs.kotlin.gradlePlugin) compileOnly(libs.ksp.gradlePlugin) compileOnly(libs.androidx.room.gradlePlugin) @@ -165,6 +167,16 @@ gradlePlugin { id = "meshtastic.kmp.library.compose" implementationClass = "KmpLibraryComposeConventionPlugin" } + + register("dokka") { + id = "meshtastic.dokka" + implementationClass = "DokkaConventionPlugin" + } + + register("kover") { + id = "meshtastic.kover" + implementationClass = "KoverConventionPlugin" + } register("root") { id = "meshtastic.root" diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt index f3c8785c0..a87f19b0d 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt @@ -31,6 +31,8 @@ class AndroidApplicationConventionPlugin : Plugin { apply(plugin = "meshtastic.detekt") apply(plugin = "meshtastic.spotless") apply(plugin = "meshtastic.analytics") + apply(plugin = "meshtastic.kover") + apply(plugin = "meshtastic.dokka") extensions.configure { configureKotlinAndroid(this) diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt index 2d725c049..f00852d37 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -32,7 +32,8 @@ class AndroidLibraryConventionPlugin : Plugin { apply(plugin = "meshtastic.android.lint") apply(plugin = "meshtastic.detekt") apply(plugin = "meshtastic.spotless") - apply(plugin = "org.jetbrains.dokka") + apply(plugin = "meshtastic.dokka") + apply(plugin = "meshtastic.kover") extensions.configure { configureKotlinAndroid(this) diff --git a/build-logic/convention/src/main/kotlin/DokkaConventionPlugin.kt b/build-logic/convention/src/main/kotlin/DokkaConventionPlugin.kt new file mode 100644 index 000000000..6de272506 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/DokkaConventionPlugin.kt @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2025-2026 Meshtastic LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.dependencies +import org.meshtastic.buildlogic.configureDokka +import org.meshtastic.buildlogic.library +import org.meshtastic.buildlogic.libs + +class DokkaConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "org.jetbrains.dokka") + + // Ensure the Android documentation plugin is available in all modules for better Android support + dependencies { + add("dokkaPlugin", libs.library("dokka-android-documentation-plugin")) + } + + configureDokka() + } + } +} diff --git a/build-logic/convention/src/main/kotlin/KmpLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KmpLibraryConventionPlugin.kt index f28e695c5..687f70fe7 100644 --- a/build-logic/convention/src/main/kotlin/KmpLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/KmpLibraryConventionPlugin.kt @@ -30,6 +30,8 @@ class KmpLibraryConventionPlugin : Plugin { apply(plugin = "meshtastic.android.lint") apply(plugin = "meshtastic.detekt") apply(plugin = "meshtastic.spotless") + apply(plugin = "meshtastic.dokka") + apply(plugin = "meshtastic.kover") configureKotlinMultiplatform() } diff --git a/build-logic/convention/src/main/kotlin/KoverConventionPlugin.kt b/build-logic/convention/src/main/kotlin/KoverConventionPlugin.kt new file mode 100644 index 000000000..ae2e7293b --- /dev/null +++ b/build-logic/convention/src/main/kotlin/KoverConventionPlugin.kt @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Meshtastic LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.meshtastic.buildlogic.configureKover + +class KoverConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = "org.jetbrains.kotlinx.kover") + configureKover() + } + } +} diff --git a/build-logic/convention/src/main/kotlin/RootConventionPlugin.kt b/build-logic/convention/src/main/kotlin/RootConventionPlugin.kt index 6cb891173..4f027414b 100644 --- a/build-logic/convention/src/main/kotlin/RootConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/RootConventionPlugin.kt @@ -17,11 +17,24 @@ import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.meshtastic.buildlogic.configureDokkaAggregation import org.meshtastic.buildlogic.configureGraphTasks +import org.meshtastic.buildlogic.configureKover +import org.meshtastic.buildlogic.configureKoverAggregation class RootConventionPlugin : Plugin { override fun apply(target: Project) { require(target.path == ":") - target.subprojects { configureGraphTasks() } + with(target) { + apply(plugin = "org.jetbrains.dokka") + configureDokkaAggregation() + + apply(plugin = "org.jetbrains.kotlinx.kover") + configureKover() + configureKoverAggregation() + + subprojects { configureGraphTasks() } + } } } diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Dokka.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Dokka.kt new file mode 100644 index 000000000..6de949425 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Dokka.kt @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2025 Meshtastic LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.meshtastic.buildlogic + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.jetbrains.dokka.gradle.DokkaExtension +import java.io.File +import java.net.URI + +fun Project.configureDokka() { + extensions.configure { + // Use the full project path as the module name to ensure uniqueness + moduleName.set(project.path.removePrefix(":").replace(":", "-").ifEmpty { project.name }) + + // Discover and register Android source sets (main + flavors) + val registerAndroidSourceSets = { + project.file("src").listFiles() + ?.filter { it.isDirectory && !it.name.contains("test", ignoreCase = true) } + ?.forEach { sourceDir -> + val sourceSetName = sourceDir.name + val ktDir = File(sourceDir, "kotlin") + val javaDir = File(sourceDir, "java") + if (ktDir.exists() || javaDir.exists()) { + dokkaSourceSets.maybeCreate(sourceSetName).apply { + if (ktDir.exists()) sourceRoots.from(ktDir) + if (javaDir.exists()) sourceRoots.from(javaDir) + suppress.set(false) + } + } + } + } + + pluginManager.withPlugin("com.android.library") { + if (!plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) { + registerAndroidSourceSets() + } + } + pluginManager.withPlugin("com.android.application") { + registerAndroidSourceSets() + } + + dokkaSourceSets.configureEach { + perPackageOption { + matchingRegex.set("hilt_aggregated_deps") + suppress.set(true) + } + perPackageOption { + matchingRegex.set("org.meshtastic.core.strings.*") + suppress.set(true) + } + + // Ensure source sets containing core logic are not suppressed + val isCoreSourceSet = name in listOf("main", "commonMain", "androidMain", "fdroid", "google") + if (isCoreSourceSet) { + suppress.set(false) + } + + sourceLink { + enableJdkDocumentationLink.set(true) + enableKotlinStdLibDocumentationLink.set(true) + reportUndocumented.set(true) + + // Standardized repo-root based source links + localDirectory.set(project.projectDir) + val relativePath = project.projectDir.relativeTo(rootProject.projectDir).path.replace("\\", "/") + remoteUrl.set(URI("https://github.com/meshtastic/Meshtastic-Android/blob/main/$relativePath")) + remoteLineSuffix.set("#L") + } + } + } +} + +fun Project.configureDokkaAggregation() { + extensions.configure { + moduleName.set("Meshtastic App") + dokkaPublications.configureEach { + suppressInheritedMembers.set(true) + } + } + + subprojects.forEach { subproject -> + subproject.pluginManager.withPlugin("org.jetbrains.dokka") { + dependencies.add("dokka", subproject) + } + } +} diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Kover.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Kover.kt new file mode 100644 index 000000000..6375dec7b --- /dev/null +++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/Kover.kt @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2025 Meshtastic LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.meshtastic.buildlogic + +import kotlinx.kover.gradle.plugin.dsl.KoverProjectExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure + +fun Project.configureKover() { + extensions.configure { + reports { + filters { + excludes { + // Exclude generated classes + classes("*_Impl") + classes("*Binding") + classes("*Factory") + classes("*.BuildConfig") + classes("*.R") + classes("*.R$*") + + // Exclude UI components + annotatedBy("*Preview") + + // Exclude declarations + annotatedBy( + "*.HiltAndroidApp", + "*.AndroidEntryPoint", + "*.Module", + "*.Provides", + "*.Binds", + "*.Composable", + ) + + // Suppress generated code + packages("hilt_aggregated_deps") + packages("org.meshtastic.core.strings") + } + } + } + } +} + +fun Project.configureKoverAggregation() { + subprojects.forEach { subproject -> + subproject.plugins.withId("org.jetbrains.kotlinx.kover") { + dependencies.add("kover", subproject) + } + } +} diff --git a/build.gradle.kts b/build.gradle.kts index 3abd4240e..9df788634 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,116 +45,6 @@ plugins { -kover { - reports { - filters { - excludes { - // Exclude generated classes - classes("*_Impl") - classes("*Binding") - classes("*Factory") - classes("*.BuildConfig") - classes("*.R") - classes("*.R$*") - - // Exclude UI components - annotatedBy("*Preview") - - // Exclude declarations - annotatedBy( - "*.HiltAndroidApp", - "*.AndroidEntryPoint", - "*.Module", - "*.Provides", - "*.Binds", - "*.Composable", - ) - - // Suppress generated code - packages("hilt_aggregated_deps") - packages("org.meshtastic.core.strings") - } - } - } -} - -subprojects { - // Apply Dokka to all subprojects to ensure they are available for aggregation - apply(plugin = "org.jetbrains.dokka") - - dokka { - dokkaSourceSets.configureEach { - perPackageOption { - matchingRegex.set("hilt_aggregated_deps") - suppress.set(true) - } - perPackageOption { - matchingRegex.set("org.meshtastic.core.strings.*") - suppress.set(true) - } - listOf("java", "kotlin").forEach { lang -> - val dir = file("src/main/$lang") - if (dir.exists()) { - sourceLink { - enableJdkDocumentationLink.set(true) - enableKotlinStdLibDocumentationLink.set(true) - reportUndocumented.set(true) - localDirectory.set(dir) - - val relativePath = project.projectDir.relativeTo(rootProject.projectDir).path.replace("\\", "/") - remoteUrl("https://github.com/meshtastic/Meshtastic-Android/blob/main/$relativePath/src/main/$lang") - remoteLineSuffix.set("#L") - } - } - } - } - } -} - dependencies { - kover(projects.app) - - kover(projects.core.analytics) - kover(projects.core.common) - kover(projects.core.data) - kover(projects.core.datastore) - kover(projects.core.model) - kover(projects.core.navigation) - kover(projects.core.network) - kover(projects.core.prefs) - kover(projects.core.ui) - kover(projects.feature.intro) - kover(projects.feature.messaging) - kover(projects.feature.map) - kover(projects.feature.node) - kover(projects.feature.settings) - - dokka(project(":app")) - dokka(project(":core:analytics")) - dokka(project(":core:common")) - dokka(project(":core:data")) - dokka(project(":core:database")) - dokka(project(":core:datastore")) - dokka(project(":core:di")) - dokka(project(":core:model")) - dokka(project(":core:navigation")) - dokka(project(":core:network")) - dokka(project(":core:prefs")) - dokka(project(":core:proto")) - dokka(project(":core:service")) - dokka(project(":core:ui")) - dokka(project(":feature:intro")) - dokka(project(":feature:messaging")) - dokka(project(":feature:map")) - dokka(project(":feature:node")) - dokka(project(":feature:settings")) + dokkaPlugin(libs.dokka.android.documentation.plugin) } - -dokka { - moduleName.set("Meshtastic App") - dokkaPublications.html { - suppressInheritedMembers.set(true) - } -} - - diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index 35acab069..3b28d64fd 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,10 +15,7 @@ * along with this program. If not, see . */ -plugins { - alias(libs.plugins.meshtastic.kmp.library) - alias(libs.plugins.kover) -} +plugins { alias(libs.plugins.meshtastic.kmp.library) } kotlin { @Suppress("UnstableApiUsage") diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 3f11c5cb9..ecc20f4b0 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,6 @@ plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.hilt) alias(libs.plugins.meshtastic.kotlinx.serialization) - alias(libs.plugins.kover) } configure { namespace = "org.meshtastic.core.data" } diff --git a/core/datastore/build.gradle.kts b/core/datastore/build.gradle.kts index ac23e9b57..40c3a389d 100644 --- a/core/datastore/build.gradle.kts +++ b/core/datastore/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,6 @@ plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.hilt) alias(libs.plugins.meshtastic.kotlinx.serialization) - alias(libs.plugins.kover) } configure { namespace = "org.meshtastic.core.datastore" } diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 2fbf17116..74597b543 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.kotlinx.serialization) alias(libs.plugins.kotlin.parcelize) diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 8ac94db34..4d7f209df 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,6 @@ import com.android.build.api.dsl.LibraryExtension plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.kotlinx.serialization) - alias(libs.plugins.kover) } configure { namespace = "org.meshtastic.core.navigation" } diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index 54a7fd9fb..6fca0f3cc 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -37,8 +37,6 @@ plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.hilt) alias(libs.plugins.kotlin.serialization) - alias(libs.plugins.dokka) - alias(libs.plugins.kover) alias(libs.plugins.protobuf) } diff --git a/core/prefs/build.gradle.kts b/core/prefs/build.gradle.kts index 8238c6b27..d6278a86f 100644 --- a/core/prefs/build.gradle.kts +++ b/core/prefs/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,6 @@ import com.android.build.api.dsl.LibraryExtension plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.hilt) - alias(libs.plugins.kover) } configure { namespace = "org.meshtastic.core.prefs" } diff --git a/core/service/build.gradle.kts b/core/service/build.gradle.kts index 4d4235083..2fe88c680 100644 --- a/core/service/build.gradle.kts +++ b/core/service/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index be5b55ecb..e1f1278e1 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -37,7 +37,6 @@ plugins { alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) - alias(libs.plugins.kover) } configure { namespace = "org.meshtastic.core.ui" } diff --git a/feature/firmware/build.gradle.kts b/feature/firmware/build.gradle.kts index a71bdd345..746fab955 100644 --- a/feature/firmware/build.gradle.kts +++ b/feature/firmware/build.gradle.kts @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) diff --git a/feature/intro/build.gradle.kts b/feature/intro/build.gradle.kts index 84fb5f4f5..627bcaa7d 100644 --- a/feature/intro/build.gradle.kts +++ b/feature/intro/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.kotlinx.serialization) diff --git a/feature/map/build.gradle.kts b/feature/map/build.gradle.kts index e3f08cb2f..78f2849c6 100644 --- a/feature/map/build.gradle.kts +++ b/feature/map/build.gradle.kts @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) diff --git a/feature/messaging/build.gradle.kts b/feature/messaging/build.gradle.kts index 52bf9bd02..268ef7c42 100644 --- a/feature/messaging/build.gradle.kts +++ b/feature/messaging/build.gradle.kts @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) diff --git a/feature/node/build.gradle.kts b/feature/node/build.gradle.kts index 4415373ea..e9ff1df1f 100644 --- a/feature/node/build.gradle.kts +++ b/feature/node/build.gradle.kts @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index 49d8ad187..9fe391f99 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -34,7 +34,6 @@ import com.android.build.api.dsl.LibraryExtension */ plugins { - alias(libs.plugins.kover) alias(libs.plugins.meshtastic.android.library) alias(libs.plugins.meshtastic.android.library.compose) alias(libs.plugins.meshtastic.hilt) diff --git a/gradle.properties b/gradle.properties index 3e2780b6b..78baed821 100644 --- a/gradle.properties +++ b/gradle.properties @@ -58,9 +58,6 @@ kotlin.code.style=official # https://developer.android.com/build/releases/gradle-plugin#default-changes android.nonTransitiveRClass=true -org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled -org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true - dependency.analysis.print.build.health=true ksp.incremental=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dfa36134c..45b9162cc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,7 @@ kotlin = "2.3.0" kotlinx-coroutines-android = "1.10.2" kotlinx-serialization = "1.9.0" ktlint = "1.7.1" +kover = "0.9.4" # Compose Multiplatform compose-multiplatform = "1.9.3" @@ -115,6 +116,7 @@ truth = { module = "com.google.truth:truth", version = "1.4.5" } # Jetbrains kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +dokka-gradlePlugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "2.1.0" } # fixme remove when hilt updates to support kotlin 2.3.x kotlin-metadata-jvm = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version.ref = "kotlin"} @@ -184,6 +186,7 @@ detekt-gradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plug firebase-crashlytics-gradlePlugin = { module = "com.google.firebase:firebase-crashlytics-gradle", version = "3.0.6" } google-services-gradlePlugin = { module = "com.google.gms.google-services:com.google.gms.google-services.gradle.plugin", version = "4.4.4" } hilt-gradlePlugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" } +kover-gradlePlugin = { module = "org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin", version.ref = "kover" } ksp-gradlePlugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "devtools-ksp" } secrets-gradlePlugin = {module = "com.google.android.secrets-gradle-plugin:com.google.android.secrets-gradle-plugin.gradle.plugin", version = "1.1.0"} serialization-gradlePlugin = { module = "org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin", version.ref = "kotlin" } @@ -203,7 +206,7 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.4" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } # Google devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "devtools-ksp" } diff --git a/mesh_service_example/build.gradle.kts b/mesh_service_example/build.gradle.kts index 5bf8f8bcd..12610e8ac 100644 --- a/mesh_service_example/build.gradle.kts +++ b/mesh_service_example/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Meshtastic LLC + * Copyright (c) 2025-2026 Meshtastic LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ plugins { alias(libs.plugins.meshtastic.android.application.compose) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.serialization) - alias(libs.plugins.kover) } configure {