From 8049b9cd4183c09bacbfdeaaf798c516b1b90a18 Mon Sep 17 00:00:00 2001 From: Ben Woodworth Date: Sun, 5 Nov 2023 00:00:28 -0400 Subject: [PATCH] Add Dokka and KDoc publishing workflow --- .github/workflows/publish.yml | 19 ++++++++++++++++++- build.gradle.kts | 6 ++++++ src/commonMain/kotlin/ParameterDelegate.kt | 3 +++ src/commonMain/kotlin/Parameterize.kt | 6 ++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 252a0ed..e6556c8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Publish on: push: tags: [ 'v*' ] - branches: [ 'main' ] + branches: [ 'main', 'publishing' ] env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} @@ -31,3 +31,20 @@ jobs: - name: Publish to Maven run: ./gradlew ciPublish + + docs: + needs: publish + + permissions: + pages: write + id-token: write + + environment: + name: Publish KDoc + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/build.gradle.kts b/build.gradle.kts index 6113ed9..c043c07 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,10 @@ import org.gradle.kotlin.dsl.support.uppercaseFirstChar +import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.kotlin.gradle.plugin.KotlinTargetWithTests plugins { kotlin("multiplatform") version "1.9.20" + id("org.jetbrains.dokka") version "1.9.10" id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" id("parameterize.library-conventions") } @@ -11,6 +13,10 @@ repositories { mavenCentral() } +tasks.withType { + throw Throwable(suppressObviousFunctions.get().toString()) +} + kotlin { explicitApi() diff --git a/src/commonMain/kotlin/ParameterDelegate.kt b/src/commonMain/kotlin/ParameterDelegate.kt index 99d2220..6e701b8 100644 --- a/src/commonMain/kotlin/ParameterDelegate.kt +++ b/src/commonMain/kotlin/ParameterDelegate.kt @@ -32,6 +32,9 @@ import kotlin.reflect.KProperty * through the current iterator. */ +/** + * @suppress bleh + */ public class ParameterDelegate<@Suppress("unused") out T> internal constructor() { /* * The internal state does not use the generic type, so T is purely for diff --git a/src/commonMain/kotlin/Parameterize.kt b/src/commonMain/kotlin/Parameterize.kt index 37f8763..66464cf 100644 --- a/src/commonMain/kotlin/Parameterize.kt +++ b/src/commonMain/kotlin/Parameterize.kt @@ -131,6 +131,9 @@ internal class ParameterizeException(override val message: String) : Exception(m public class ParameterizeScope internal constructor( private val state: ParameterizeState, ) { + /** + * @suppress + */ override fun toString(): String = state.getFailureArguments().joinToString( prefix = "ParameterizeScope(", @@ -170,6 +173,9 @@ public class ParameterizeScope internal constructor( state.getParameterArgument(this, property as KProperty) + /** + * @suppress + */ @JvmInline public value class Parameter internal constructor( internal val arguments: Iterable