diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index 7566aa642d..0a7781d2cf 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -28,7 +28,8 @@ jobs: - run: pip install mkdocs-material - name: 'Dokka' run: | - ./gradlew :AndroidLib:dokkaGfm :ApiLib:dokkaGfm + ./gradlew :dokkaGfmMultiModule + cp -R build/dokka/gfmMultiModule docs/kdoc - name: 'Set version' run: echo "VERSION=$(grep -hnr 'selekt.versionName' gradle.properties | sed 's/.*=//')" >> $GITHUB_ENV - name: 'Mkdocs' diff --git a/AndroidLib/build.gradle.kts b/AndroidLib/build.gradle.kts index f9618b8dbf..4d9d84a6b3 100644 --- a/AndroidLib/build.gradle.kts +++ b/AndroidLib/build.gradle.kts @@ -100,6 +100,7 @@ afterEvaluate { tasks.register("assembleSelekt") { dependsOn("assembleRelease") dependsOn("sourcesJar") + dependsOn("dokkaHtmlJar") } tasks.register("sourcesJar") { @@ -108,6 +109,13 @@ tasks.register("sourcesJar") { setProperty("archiveClassifier", "sources") } +tasks.register("dokkaHtmlJar") { + dependsOn("dokkaHtml") + setProperty("archiveBaseName", "selekt") + setProperty("archiveClassifier", "kdoc") + from("$buildDir/dokka/html") +} + licensee { allow("Apache-2.0") } @@ -124,6 +132,7 @@ afterEvaluate { description.set("Selekt Android SQLite library.") } artifact("$buildDir/libs/selekt-sources.jar") { classifier = "sources" } + artifact("$buildDir/libs/selekt-kdoc.jar") { classifier = "javadoc" } }.also { signing { sign(it) } } diff --git a/SQLite3/build.gradle.kts b/SQLite3/build.gradle.kts index bb6a34c530..4af0009b04 100644 --- a/SQLite3/build.gradle.kts +++ b/SQLite3/build.gradle.kts @@ -23,7 +23,6 @@ repositories { plugins { kotlin("jvm") - id("org.jetbrains.dokka") `maven-publish` signing } diff --git a/build.gradle.kts b/build.gradle.kts index 00911cd1f3..db6168c4f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,6 +15,7 @@ */ import io.gitlab.arturbosch.detekt.Detekt +import java.net.URL import java.util.Locale import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -150,9 +151,10 @@ subprojects { pluginManager.withPlugin("org.jetbrains.dokka") { tasks.withType().configureEach { + moduleName.set("Selekt") dokkaSourceSets.named("main") { sourceLink { - remoteUrl.set(java.net.URL("https://github.com/bloomberg/selekt/tree/master/" + + remoteUrl.set(URL("https://github.com/bloomberg/selekt/tree/master/" + "${this@configureEach.project.name}/src/main/kotlin")) localDirectory.set(file("src/main/kotlin")) } @@ -161,7 +163,6 @@ subprojects { noAndroidSdkLink.set(false) noJdkLink.set(false) noStdlibLink.set(false) - outputDirectory.set(File("$rootDir/docs/kdoc")) } } } diff --git a/mkdocs.yml b/mkdocs.yml index 8103a937c1..aec4625fb0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,6 +34,4 @@ nav: - 'Overview': index.md - 'Getting started': getting_started.md - 'Native libraries': native_libraries.md - - 'API': - - 'Android': kdoc/-android-lib/com.bloomberg.selekt.android/index.md - - 'Room': kdoc/-android-lib/com.bloomberg.selekt.android.support/index.md + - 'API': kdoc/AndroidLib/index.md