11import com.squareup.workflow1.buildsrc.shardConnectedCheckTasks
22import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
3- import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
4- import java.net.URL
53
64buildscript {
75 dependencies {
@@ -27,6 +25,7 @@ plugins {
2725 base
2826 id(" artifacts-check" )
2927 id(" dependency-guard" )
28+ alias(libs.plugins.dokka)
3029 alias(libs.plugins.ktlint)
3130 alias(libs.plugins.compose.compiler) apply false
3231}
@@ -35,63 +34,29 @@ shardConnectedCheckTasks(project)
3534
3635apply (from = rootProject.file(" .buildscript/binary-validation.gradle" ))
3736
38- // This plugin needs to be applied to the root projects for the dokkaGfmCollector task we use to
39- // generate the documentation site.
40- apply (plugin = " org.jetbrains.dokka" )
41-
42- // Configuration that applies to all dokka tasks, both those used for generating javadoc artifacts
43- // and the documentation site.
44- subprojects {
45- tasks.withType<AbstractDokkaLeafTask > {
46-
47- // This is the displayed name for the module, like in the Html sidebar.
48- // artifact id: workflow-internal-testing-utils
49- // path: internal-testing-utils
50- moduleName.set(
51- provider {
52- findProperty(" POM_ARTIFACT_ID" ) as ? String
53- ? : project.path.removePrefix(" :" )
54- }
55- )
56-
57- dokkaSourceSets.configureEach {
58-
59- val dokkaSourceSet = this
60-
61- reportUndocumented.set(false )
62- skipDeprecated.set(true )
63-
64- if (file(" src/${dokkaSourceSet.name} " ).exists()) {
65-
66- val readmeFile = file(" $projectDir /README.md" )
67- // If the module has a README, add it to the module's index
68- if (readmeFile.exists()) {
69- includes.from(readmeFile)
70- }
71-
72- sourceLink {
73- localDirectory.set(file(" src/${dokkaSourceSet.name} " ))
74-
75- val modulePath = projectDir.relativeTo(rootDir).path
37+ dependencies {
38+ dokka(project(" :workflow-core" ))
39+ dokka(project(" :workflow-runtime" ))
40+ dokka(project(" :workflow-runtime-android" ))
41+ dokka(project(" :workflow-rx2" ))
42+ dokka(project(" :workflow-testing" ))
43+ dokka(project(" :workflow-ui:compose" ))
44+ dokka(project(" :workflow-ui:compose-tooling" ))
45+ dokka(project(" :workflow-ui:core-android" ))
46+ dokka(project(" :workflow-ui:core-common" ))
47+ dokka(project(" :workflow-ui:radiography" ))
48+ }
7649
77- // URL showing where the source code can be accessed through the web browser
78- remoteUrl.set(
79- @Suppress(" ktlint:standard:max-line-length" )
80- URL (
81- " https://github.com/square/workflow-kotlin/blob/main/$modulePath /src/${dokkaSourceSet.name} "
82- )
83- )
84- // Suffix which is used to append the line number to the URL. Use #L for GitHub
85- remoteLineSuffix.set(" #L" )
86- }
87- }
88- perPackageOption {
89- // Will match all .internal packages and sub-packages, regardless of module.
90- matchingRegex.set(""" .*\.internal.*""" )
91- suppress.set(true )
92- }
50+ dokka {
51+ // This is the displayed name for the module, like in the Html sidebar.
52+ // artifact id: workflow-internal-testing-utils
53+ // path: internal-testing-utils
54+ moduleName.set(
55+ provider {
56+ findProperty(" POM_ARTIFACT_ID" ) as ? String
57+ ? : project.path.removePrefix(" :" )
9358 }
94- }
59+ )
9560}
9661
9762// Publish tasks use the output of Sign tasks, but don't actually declare a dependency upon it,
@@ -118,11 +83,11 @@ subprojects {
11883tasks.register<Copy >(" siteDokka" ) {
11984 description = " Generate dokka Html for the documentation site."
12085 group = " documentation"
121- dependsOn(" :dokkaHtmlMultiModule " )
86+ dependsOn(" :dokkaGenerate " )
12287
12388 // Copy the files instead of configuring a different output directory on the dokka task itself
12489 // since the default output directories disambiguate between different types of outputs, and our
12590 // custom directory doesn't.
126- from(layout.buildDirectory.file(" dokka/htmlMultiModule/workflow " ))
91+ from(layout.buildDirectory.file(" dokka/html " ))
12792 into(layout.buildDirectory.file(" dokka/workflow" ))
12893}
0 commit comments