Skip to content

Commit

Permalink
Configure the Dokka Gradle plugin, its tasks, and the GitHub Actions …
Browse files Browse the repository at this point in the history
…workflow, with code copied and adapted from "exposed-adt-mapping"

A source commit: huanshankeji/exposed-gadt-mapping@18800b7
  • Loading branch information
ShreckYe committed Nov 6, 2024
1 parent 7f60a99 commit 16aa231
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/dokka-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy the API documentation to GitHub Pages with Dokka

on:
push:
branches: [ "plugins-release" ]
pull_request:
branches: [ "plugins-release" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "temurin"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build the distribution with Gradle Wrapper
run: ./gradlew :dokkaGeneratePublicationHtml

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/dokka/html/

# Deployment job
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
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}

plugins {
id("org.jetbrains.dokka")
}

dependencies {
dokka(project(":exposed-vertx-sql-client-postgresql"))
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ dependencies {
implementation(kotlin("gradle-plugin", "2.0.10"))
implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch
implementation("com.huanshankeji.team:gradle-plugins:0.6.0") // don't use a snapshot version in a main branch
implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0-Beta")
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# for Dokka
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
12 changes: 11 additions & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
conventions
id("com.huanshankeji.benchmark.kotlinx-benchmark-jvm-conventions")
id("org.jetbrains.dokka")
}

dependencies {
Expand Down Expand Up @@ -40,4 +41,13 @@ afterEvaluate {
}
"benchmarksImplementation"(commonDependencies.slf4j.simple())
}
}
}

dokka {
dokkaSourceSets.all {
sourceLink {
remoteUrl("https://github.com/huanshankeji/exposed-vertx-sql-client/tree/v${version}/lib")
remoteLineSuffix.set("#L")
}
}
}
8 changes: 8 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
rootProject.name = "exposed-vertx-sql-client"
include("lib")
project(":lib").name = rootProject.name + "-postgresql"

// for Dokka
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

0 comments on commit 16aa231

Please sign in to comment.