fix(ci): unblock Dokka documentation generation (#5496)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich
2026-05-19 13:00:45 -05:00
committed by GitHub
parent 418861d356
commit 228765a159
6 changed files with 31 additions and 7 deletions

6
.gitignore vendored
View File

@@ -70,9 +70,9 @@ firebase-debug.log
/kable/
.opencode/
# Synced docs in composeResources (generated from docs/ source by syncDocsToComposeResources task)
feature/docs/src/commonMain/composeResources/files/docs/user/
feature/docs/src/commonMain/composeResources/files/docs/developer/
feature/docs/src/commonMain/composeResources/files/docs/assets/
feature/docs/src/commonMain/composeResources/files/docs/
# Synced translated docs (generated from docs/{locale}/ by syncTranslatedDocsToComposeResources task)
feature/docs/src/commonMain/composeResources/files/*/docs/
/desktop/bin/
/build-logic/convention/bin/

View File

@@ -17,6 +17,7 @@
package org.meshtastic.app.di
import android.content.Context
import okio.FileSystem
import okio.Path.Companion.toOkioPath
import org.koin.core.annotation.Module
import org.koin.core.annotation.Single
@@ -37,7 +38,7 @@ class GoogleAiModule {
@Single
fun docTranslationCache(context: Context): DocTranslationCache =
DocTranslationCache(cacheDir = context.cacheDir.toOkioPath())
DocTranslationCache(cacheDir = context.cacheDir.toOkioPath(), fileSystem = FileSystem.SYSTEM)
@Single fun docTranslationService(cache: DocTranslationCache): DocTranslationService = MlKitDocTranslator(cache)
}

View File

@@ -37,7 +37,7 @@ class RootConventionPlugin : Plugin<Project> {
val modules = allModules()
apply(plugin = "org.jetbrains.dokka")
configureDokkaAggregation(modules)
configureDokkaAggregation(modules.filter { it !in DOKKA_EXCLUDED_MODULES })
apply(plugin = "org.jetbrains.kotlinx.kover")
configureKover()
@@ -117,6 +117,13 @@ private val ALL_MODULES_FULL =
/** Android-only modules that don't apply the KMP plugin. */
private val ANDROID_ONLY_MODULES = setOf(":androidApp", ":core:api", ":core:barcode", ":feature:widget")
/**
* Modules excluded from Dokka aggregation. :core:proto contains only auto-generated Wire classes (no KDoc value) and
* its TAKPacket-SDK dependency doesn't publish iOS metadata JARs to JitPack, causing
* `transformCommonMainDependenciesMetadata` to fail during Dokka resolution.
*/
private val DOKKA_EXCLUDED_MODULES = setOf(":core:proto")
private fun allModules(): List<String> = ALL_MODULES_FULL
/**

View File

@@ -122,6 +122,22 @@ internal fun Project.configureKotlinMultiplatform() {
}
}
// TAKPacket-SDK doesn't publish iOS metadata JARs on JitPack (the .klib exists but
// the metadata .jar returns 404). iOS native compilation resolves fine via .klib, but
// `transformCommonMainDependenciesMetadata` (triggered by Dokka/publishing) fails.
// Exclude the SDK only from the CompilationDependenciesMetadata configs that feed
// the metadata transform — NOT from Implementation/Resolvable configs which feed the
// actual compiler classpath.
val iosMetadataConfigs = setOf(
"iosArm64CompilationDependenciesMetadata",
"iosSimulatorArm64CompilationDependenciesMetadata",
)
configurations.configureEach {
if (name in iosMetadataConfigs) {
exclude(mapOf("group" to "com.github.meshtastic.TAKPacket-SDK", "module" to "takpacket-sdk"))
}
}
configureMokkery()
configureKotlin<KotlinMultiplatformExtension>()
}

View File

@@ -509,7 +509,7 @@ class TAKMeshIntegration(
"""<precisionLocation[^>]*/>""", // iTAK camelCase variant
"""<precisionLocation[^>]*>.*?</precisionLocation>""",
)
.map { Regex(it, RegexOption.DOT_MATCHES_ALL) }
.map { Regex("(?s)$it") }
// Strip any attribute with value "???" — unknown/placeholder metadata
private val UNKNOWN_ATTR_PATTERN = Regex("""\s+\w+\s*=\s*"[?]{3}"""")

View File

@@ -33,7 +33,7 @@ import okio.buffer
*/
class DocTranslationCache(
private val cacheDir: Path,
private val fileSystem: FileSystem = FileSystem.SYSTEM,
private val fileSystem: FileSystem,
private val maxCacheSizeBytes: Long = MAX_CACHE_SIZE_BYTES,
) {
companion object {