Skip to content

Dokka #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: platforms
Choose a base branch
from
Open

Dokka #357

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/images/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,34 @@ jobs:
needs: [ build, test ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Move API docs to the publication directory
run:
mkdir __docs_publication_dir
cp -r docs/pages/api __docs_publication_dir/api

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: kotlinx-rpc

- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d dir
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d __docs_publication_dir

- name: Update sitemap.xml
run: chmod +x updateSitemap.sh && ./updateSitemap.sh __docs_publication_dir/sitemap.xml __docs_publication_dir/api

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir
path: __docs_publication_dir

- name: Deploy to GitHub Pages
id: deployment
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Verify API Docs

on:
pull_request:

permissions:
contents: read

jobs:
verify-api-docs:
name: Up-To-Date Check
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Check Dokka generation is up-to-date
run: ./gradlew dokkaGenerate
- name: Check Dokka HTML output is up-to-date
run: git status --porcelain | grep "docs/pages/api/" && echo "Run `./gradlew dokkaGenerate` to update API docs and commit changes" && exit 1 || exit 0
38 changes: 38 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,60 @@
*/

import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
import util.asDokkaVersion
import util.configureApiValidation
import util.configureNpm
import util.configureProjectReport
import util.registerDumpPlatformTableTask
import util.libs
import util.registerVerifyPlatformTableTask
import java.time.Year

plugins {
alias(libs.plugins.serialization) apply false
alias(libs.plugins.kotlinx.rpc) apply false
alias(libs.plugins.conventions.kover)
alias(libs.plugins.conventions.gradle.doctor)
alias(libs.plugins.dokka)
alias(libs.plugins.atomicfu)
id("build-util")
}

dokka {
val libDokkaVersion = libs.versions.kotlinx.rpc.get().asDokkaVersion()

moduleVersion.set(libDokkaVersion)

val dokkaVersionsDirectory = layout.projectDirectory
.dir("docs")
.dir("pages")
.dir("api")
.asFile


pluginsConfiguration {
html {
customAssets.from(".github/images/logo-icon.svg")
footerMessage = "© ${Year.now()} JetBrains s.r.o and contributors. Apache License 2.0"
}

// enable versioning for stable
// versioning {
// version = libDokkaVersion
// olderVersionsDir = dokkaVersionsDirectory
// }
}

dokkaPublications.html {
outputDirectory = dokkaVersionsDirectory
}

dokkaGeneratorIsolation = ProcessIsolation {
// Configures heap size, use if start to fail with OOM on CI
// maxHeapSize = "4g"
}
}

configureProjectReport()
configureNpm()
configureApiValidation()
Expand Down
Loading
Loading