From 1d088cf84c3fa759eb9906c8e92228ccad3fcae1 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Fri, 16 Jul 2021 10:54:08 +0100 Subject: [PATCH 1/4] Publish multi-module GFM. Signed-off-by: Kenneth J. Shackleton --- .github/workflows/publish-documentation.yml | 3 ++- build.gradle.kts | 4 ++-- mkdocs.yml | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) 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/build.gradle.kts b/build.gradle.kts index 00911cd1f3..2e9b6d2717 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 @@ -152,7 +153,7 @@ subprojects { tasks.withType().configureEach { 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 +162,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..ac4901e990 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/index.md From 9a0874f86bf410cda3b3b7c9ff93f3f91392ffe4 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Fri, 16 Jul 2021 11:27:41 +0100 Subject: [PATCH 2/4] Publish kdoc as Javadoc for AndroidLib. Signed-off-by: Kenneth J. Shackleton --- AndroidLib/build.gradle.kts | 9 +++++++++ SQLite3/build.gradle.kts | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AndroidLib/build.gradle.kts b/AndroidLib/build.gradle.kts index 9bb60f2be7..4429d20b99 100644 --- a/AndroidLib/build.gradle.kts +++ b/AndroidLib/build.gradle.kts @@ -99,6 +99,7 @@ afterEvaluate { tasks.register("assembleSelekt") { dependsOn("assembleRelease") dependsOn("sourcesJar") + dependsOn("dokkaHtmlJar") } tasks.register("sourcesJar") { @@ -107,6 +108,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") } @@ -123,6 +131,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 } From 72cc4ac5c5698ebb716db08051632500fc98b42f Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Fri, 16 Jul 2021 11:54:23 +0100 Subject: [PATCH 3/4] Common module name. Signed-off-by: Kenneth J. Shackleton --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index 2e9b6d2717..db6168c4f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -151,6 +151,7 @@ subprojects { pluginManager.withPlugin("org.jetbrains.dokka") { tasks.withType().configureEach { + moduleName.set("Selekt") dokkaSourceSets.named("main") { sourceLink { remoteUrl.set(URL("https://github.com/bloomberg/selekt/tree/master/" + From f800e87ea89475c46ff456aca6df7a8ad0899510 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Fri, 16 Jul 2021 12:20:21 +0100 Subject: [PATCH 4/4] Point to AndroidLib in mkdocs. Signed-off-by: Kenneth J. Shackleton --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index ac4901e990..aec4625fb0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,4 +34,4 @@ nav: - 'Overview': index.md - 'Getting started': getting_started.md - 'Native libraries': native_libraries.md - - 'API': kdoc/index.md + - 'API': kdoc/AndroidLib/index.md