From 6886f3314cbf01084bea7308aa78cb9714457721 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 2 Sep 2024 09:27:07 +0200 Subject: [PATCH] Add api docs --- .github/workflows/dokka.yml | 58 +++++++++++++++++++++++++++++++++++ assets/logo-icon.svg | 48 +++++++++++++++++++++++++++++ designsystem/build.gradle.kts | 20 ++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 .github/workflows/dokka.yml create mode 100644 assets/logo-icon.svg diff --git a/.github/workflows/dokka.yml b/.github/workflows/dokka.yml new file mode 100644 index 000000000..ea776bdd0 --- /dev/null +++ b/.github/workflows/dokka.yml @@ -0,0 +1,58 @@ +name: Deploy API docs + +on: + push: + branches: + - main + + pull_request: + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: 'gradle' + - name: Change wrapper permission + run: chmod +x ./gradlew + + - name: Build Java docs + run: ./gradlew :designsystem:dokkaHtml -PremoveSnapshotSuffix + + - name: Organize pages structure + run: | + mkdir _site && mkdir _site/api + cp -r designsystem/build/dokka/html/* _site/api + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/assets/logo-icon.svg b/assets/logo-icon.svg new file mode 100644 index 000000000..423ad405d --- /dev/null +++ b/assets/logo-icon.svg @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/designsystem/build.gradle.kts b/designsystem/build.gradle.kts index 11d614fda..86da7ef40 100644 --- a/designsystem/build.gradle.kts +++ b/designsystem/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.dokka.gradle.DokkaTask + version = rootProject.version group = rootProject.group @@ -81,3 +83,21 @@ android { jvmToolchain(17) } } + +tasks.withType(DokkaTask::class).configureEach { + dokkaSourceSets { + configureEach { + moduleName.set("Mobile UI") + } + } + val dokkaBaseConfiguration = """ + { + "customAssets": ["${file("../assets/logo-icon.svg")}"] + } + """ + pluginsMapConfiguration.set( + mapOf( + "org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration + ) + ) +}