Skip to content

Commit bd0bfc9

Browse files
committed
updated dokka to v2
1 parent 66f076f commit bd0bfc9

File tree

16 files changed

+305
-53
lines changed

16 files changed

+305
-53
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ jobs:
6969
- name: Grant execute permission for gradlew
7070
run: chmod +x gradlew
7171
- name: Generate documentation
72-
run: ./gradlew dokkaHtmlMultiModule
72+
run: ./gradlew dokkaGenerate
7373
- name: Uploading build folder
7474
uses: actions/upload-artifact@v4
7575
with:
7676
name: artefact
77-
path: build/dokka/htmlMultiModule
77+
path: build/dokka/html
7878
- name: Deploy API documentation to Github Pages
7979
uses: JamesIves/github-pages-deploy-action@v4
8080
with:
8181
branch: gh-pages
82-
folder: build/dokka/htmlMultiModule
82+
folder: build/dokka/html
8383
target-folder: docs

build.gradle.kts

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import org.apache.tools.ant.taskdefs.condition.Os
22
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
import org.gradle.api.tasks.testing.logging.TestLogEvent
44
import org.jetbrains.dokka.DokkaConfiguration
5-
import org.jetbrains.dokka.base.DokkaBase
6-
import org.jetbrains.dokka.base.DokkaBaseConfiguration
7-
import org.jetbrains.dokka.gradle.AbstractDokkaTask
85
import org.jetbrains.dokka.gradle.DokkaTaskPartial
96
import java.net.URL
107
import java.io.InputStream
@@ -20,16 +17,11 @@ plugins {
2017
alias(libs.plugins.kotlinter) apply false
2118
alias(libs.plugins.kotlinx.binarycompatibilityvalidator)
2219
alias(libs.plugins.dokka)
20+
alias(libs.plugins.publish) apply false
2321
id("base")
2422
id("testOptionsConvention")
2523
}
2624

27-
buildscript {
28-
dependencies {
29-
classpath(libs.dokka.base)
30-
}
31-
}
32-
3325
val compileSdkVersion by extra(36)
3426
val targetSdkVersion by extra(36)
3527
val minSdkVersion by extra(23)
@@ -54,59 +46,40 @@ tasks {
5446
}
5547

5648
private val dokkaCopyrightMessage = "© 2024 GitLive Ltd."
57-
private val dokkaHomepageUrl = "https://github.com/GitLiveApp/firebase-kotlin-sdk"
49+
private val dokkaHomepageUrl = "https://github.com/DatL4g/firebase-kotlin-sdk"
5850

59-
tasks.withType<AbstractDokkaTask>().configureEach {
51+
dokka {
6052
val version = project.property("firebase-app.version") as String
6153
moduleVersion.set(version)
6254
moduleName.set("Firebase Kotlin SDK")
6355

64-
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
65-
customAssets = listOf(file("documentation/gitlive-logo.png"), file("documentation/homepage.svg"))
66-
customStyleSheets = listOf(file("documentation/logo-styles.css"))
67-
footerMessage = dokkaCopyrightMessage
68-
homepageLink = dokkaHomepageUrl
56+
pluginsConfiguration.html {
57+
customAssets.from("documentation/gitlive-logo.png", "documentation/homepage.svg")
58+
customStyleSheets.from("documentation/logo-styles.css")
59+
footerMessage.set(dokkaCopyrightMessage)
60+
homepageLink.set(dokkaHomepageUrl)
6961
}
7062
}
7163

64+
dependencies {
65+
dokka(project(":firebase-analytics"))
66+
dokka(project(":firebase-app"))
67+
dokka(project(":firebase-auth"))
68+
dokka(project(":firebase-config"))
69+
dokka(project(":firebase-crashlytics"))
70+
dokka(project(":firebase-database"))
71+
dokka(project(":firebase-firestore"))
72+
dokka(project(":firebase-functions"))
73+
dokka(project(":firebase-installations"))
74+
dokka(project(":firebase-messaging"))
75+
dokka(project(":firebase-perf"))
76+
dokka(project(":firebase-storage"))
77+
}
78+
7279
subprojects {
7380

7481
group = "dev.gitlive"
7582

76-
val nonDocumentationList = listOf("test-utils", "firebase-common", "firebase-common-internal")
77-
val skipDocumentation = nonDocumentationList.contains(project.name)
78-
if (!skipDocumentation) {
79-
apply(plugin = "org.jetbrains.dokka")
80-
}
81-
82-
this.tasks.withType<DokkaTaskPartial>().configureEach {
83-
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
84-
footerMessage = dokkaCopyrightMessage
85-
separateInheritedMembers = false
86-
homepageLink = dokkaHomepageUrl
87-
}
88-
dokkaSourceSets {
89-
configureEach {
90-
documentedVisibilities.set(setOf(DokkaConfiguration.Visibility.PUBLIC))
91-
includes.setFrom("documentation.md")
92-
93-
sourceLink {
94-
localDirectory.set(projectDir.resolve("src"))
95-
remoteUrl.set(URL("$dokkaHomepageUrl/tree/master/${project.name}/src"))
96-
}
97-
}
98-
if (this.names.contains("jsMain")) {
99-
named("jsMain") {
100-
perPackageOption {
101-
// External files for JS should not be documented since they will not be available
102-
matchingRegex.set(".*.externals.*")
103-
suppress.set(true)
104-
}
105-
}
106-
}
107-
}
108-
}
109-
11083
apply(plugin = "com.adarshr.test-logger")
11184
apply(plugin = "org.jmailen.kotlinter")
11285

firebase-analytics/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -13,9 +14,31 @@ plugins {
1314
alias(libs.plugins.android.library)
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
17+
alias(libs.plugins.dokka)
1618
id("testOptionsConvention")
1719
}
1820

21+
dokka {
22+
dokkaSourceSets {
23+
configureEach {
24+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
25+
includes.setFrom("documentation.md")
26+
27+
sourceLink {
28+
localDirectory.set(file("src"))
29+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
30+
}
31+
if (this.name == "jsMain") {
32+
perPackageOption {
33+
// External files for JS should not be documented since they will not be available
34+
matchingRegex.set(".*.externals.*")
35+
suppress.set(true)
36+
}
37+
}
38+
}
39+
}
40+
}
41+
1942
android {
2043
val minSdkVersion: Int by project
2144
val compileSdkVersion: Int by project

firebase-app/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -13,9 +14,31 @@ plugins {
1314
alias(libs.plugins.android.library)
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
17+
alias(libs.plugins.dokka)
1618
id("testOptionsConvention")
1719
}
1820

21+
dokka {
22+
dokkaSourceSets {
23+
configureEach {
24+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
25+
includes.setFrom("documentation.md")
26+
27+
sourceLink {
28+
localDirectory.set(file("src"))
29+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
30+
}
31+
if (this.name == "jsMain") {
32+
perPackageOption {
33+
// External files for JS should not be documented since they will not be available
34+
matchingRegex.set(".*.externals.*")
35+
suppress.set(true)
36+
}
37+
}
38+
}
39+
}
40+
}
41+
1942
android {
2043
val minSdkVersion: Int by project
2144
val compileSdkVersion: Int by project

firebase-auth/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -15,9 +16,31 @@ plugins {
1516
alias(libs.plugins.android.library)
1617
alias(libs.plugins.native.cocoapods)
1718
alias(libs.plugins.multiplatform)
19+
alias(libs.plugins.dokka)
1820
id("testOptionsConvention")
1921
}
2022

23+
dokka {
24+
dokkaSourceSets {
25+
configureEach {
26+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
27+
includes.setFrom("documentation.md")
28+
29+
sourceLink {
30+
localDirectory.set(file("src"))
31+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
32+
}
33+
if (this.name == "jsMain") {
34+
perPackageOption {
35+
// External files for JS should not be documented since they will not be available
36+
matchingRegex.set(".*.externals.*")
37+
suppress.set(true)
38+
}
39+
}
40+
}
41+
}
42+
}
43+
2144
android {
2245
val compileSdkVersion: Int by project
2346

firebase-config/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -13,9 +14,31 @@ plugins {
1314
alias(libs.plugins.android.library)
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
17+
alias(libs.plugins.dokka)
1618
id("testOptionsConvention")
1719
}
1820

21+
dokka {
22+
dokkaSourceSets {
23+
configureEach {
24+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
25+
includes.setFrom("documentation.md")
26+
27+
sourceLink {
28+
localDirectory.set(file("src"))
29+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
30+
}
31+
if (this.name == "jsMain") {
32+
perPackageOption {
33+
// External files for JS should not be documented since they will not be available
34+
matchingRegex.set(".*.externals.*")
35+
suppress.set(true)
36+
}
37+
}
38+
}
39+
}
40+
}
41+
1942
android {
2043
val minSdkVersion: Int by project
2144
val compileSdkVersion: Int by project

firebase-crashlytics/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -13,9 +14,31 @@ plugins {
1314
alias(libs.plugins.android.library)
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
17+
alias(libs.plugins.dokka)
1618
id("testOptionsConvention")
1719
}
1820

21+
dokka {
22+
dokkaSourceSets {
23+
configureEach {
24+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
25+
includes.setFrom("documentation.md")
26+
27+
sourceLink {
28+
localDirectory.set(file("src"))
29+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
30+
}
31+
if (this.name == "jsMain") {
32+
perPackageOption {
33+
// External files for JS should not be documented since they will not be available
34+
matchingRegex.set(".*.externals.*")
35+
suppress.set(true)
36+
}
37+
}
38+
}
39+
}
40+
}
41+
1942
android {
2043
val minSdkVersion: Int by project
2144
val compileSdkVersion: Int by project

firebase-database/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -14,9 +15,31 @@ plugins {
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
1617
alias(libs.plugins.kotlinx.serialization)
18+
alias(libs.plugins.dokka)
1719
id("testOptionsConvention")
1820
}
1921

22+
dokka {
23+
dokkaSourceSets {
24+
configureEach {
25+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
26+
includes.setFrom("documentation.md")
27+
28+
sourceLink {
29+
localDirectory.set(file("src"))
30+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
31+
}
32+
if (this.name == "jsMain") {
33+
perPackageOption {
34+
// External files for JS should not be documented since they will not be available
35+
matchingRegex.set(".*.externals.*")
36+
suppress.set(true)
37+
}
38+
}
39+
}
40+
}
41+
}
42+
2043
android {
2144
val minSdkVersion: Int by project
2245
val compileSdkVersion: Int by project

firebase-firestore/build.gradle.kts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
12
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
23
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
@@ -14,9 +15,31 @@ plugins {
1415
alias(libs.plugins.native.cocoapods)
1516
alias(libs.plugins.multiplatform)
1617
alias(libs.plugins.kotlinx.serialization)
18+
alias(libs.plugins.dokka)
1719
id("testOptionsConvention")
1820
}
1921

22+
dokka {
23+
dokkaSourceSets {
24+
configureEach {
25+
documentedVisibilities.set(setOf(VisibilityModifier.Public))
26+
includes.setFrom("documentation.md")
27+
28+
sourceLink {
29+
localDirectory.set(file("src"))
30+
remoteUrl("https://github.com/DatL4g/firebase-kotlin-sdk/tree/master/${project.name}/src")
31+
}
32+
if (this.name == "jsMain") {
33+
perPackageOption {
34+
// External files for JS should not be documented since they will not be available
35+
matchingRegex.set(".*.externals.*")
36+
suppress.set(true)
37+
}
38+
}
39+
}
40+
}
41+
}
42+
2043
android {
2144
val minSdkVersion: Int by project
2245
val compileSdkVersion: Int by project

0 commit comments

Comments
 (0)