Skip to content

Commit

Permalink
gradle: per-module api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hero Dela Cruz committed Jun 23, 2023
1 parent 416f12d commit a1ab7de
Show file tree
Hide file tree
Showing 105 changed files with 38 additions and 9,560 deletions.
4 changes: 2 additions & 2 deletions .run/Dokka [kipher].run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
</option>
<option name="taskNames">
<list>
<option value="dokkaHtmlMultiModule" />
<option value="dokkaHtml" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<ForceTestExec>false</ForceTestExec>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
66 changes: 36 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.versioning.VersioningConfiguration
import org.jetbrains.dokka.versioning.VersioningPlugin
import java.util.Calendar
Expand Down Expand Up @@ -28,36 +29,6 @@ group = rootProject.property("GROUP")
version = rootProject.property("VERSION")
?: throw GradleException("Project version property is missing")

tasks {
dokkaHtmlMultiModule {
moduleName.set("Kipher")

val docVersionsDir = projectDir.resolve("docs/api")
val currentVersion = rootProject.version.toString()

val currentDocsDir = docVersionsDir.resolve(currentVersion)
outputDirectory.set(currentDocsDir)

pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
olderVersionsDir = docVersionsDir
version = currentVersion
}

pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
includes.from(
files(
"README.md",
),
)
footerMessage =
// get current year
"© ${Calendar.getInstance().get(Calendar.YEAR)}" +
" Kipher Author & Contributors | " +
"Licensed under <a href='https://github.com/jhdcruz/kipher/blob/main/LICENSE.txt'>The Apache 2.0 License</a>"
}
}
}

nexusPublishing {
repositories {
sonatype {
Expand Down Expand Up @@ -88,3 +59,38 @@ allprojects {
config.setFrom("${rootProject.projectDir}/detekt.yml")
}
}

subprojects {
// TODO: Move this into composite builds once dokka
// plugins are available to be used there,
tasks.withType<DokkaTask>().configureEach {
val docVersionsDir = rootProject.projectDir.resolve("docs/api/${project.name}")
val currentVersion = rootProject.version.toString()

val currentDocsDir = docVersionsDir.resolve(currentVersion)
outputDirectory.set(currentDocsDir)

pluginConfiguration<VersioningPlugin, VersioningConfiguration> {
olderVersionsDir = docVersionsDir
version = currentVersion
}

pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
footerMessage =
// get current year
"© ${Calendar.getInstance().get(Calendar.YEAR)}" +
" Kipher Author & Contributors | " +
"Licensed under <a href='https://github.com/jhdcruz/kipher/blob/main/LICENSE.txt'>The Apache 2.0 License</a>"
}

dokkaSourceSets {
configureEach {
includes.from(
files(
"README.md"
)
)
}
}
}
}
4 changes: 0 additions & 4 deletions docs/api/1.0.0-SNAPSHOT/images/anchor-copy-button.svg

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/1.0.0-SNAPSHOT/images/arrow_down.svg

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/1.0.0-SNAPSHOT/images/copy-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/1.0.0-SNAPSHOT/images/copy-successful-icon.svg

This file was deleted.

3 changes: 0 additions & 3 deletions docs/api/1.0.0-SNAPSHOT/images/footer-go-to-link.svg

This file was deleted.

4 changes: 0 additions & 4 deletions docs/api/1.0.0-SNAPSHOT/images/go-to-top-icon.svg

This file was deleted.

10 changes: 0 additions & 10 deletions docs/api/1.0.0-SNAPSHOT/images/logo-icon.svg

This file was deleted.

22 changes: 0 additions & 22 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/abstract-class-kotlin.svg

This file was deleted.

20 changes: 0 additions & 20 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/abstract-class.svg

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/annotation.svg

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/class-kotlin.svg

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/class.svg

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/enum-kotlin.svg

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/enum.svg

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/exception-class.svg

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/field-value.svg

This file was deleted.

6 changes: 0 additions & 6 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/field-variable.svg

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/function.svg

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/interface-kotlin.svg

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/1.0.0-SNAPSHOT/images/nav-icons/interface.svg

This file was deleted.

Loading

0 comments on commit a1ab7de

Please sign in to comment.