Skip to content

Commit 1693149

Browse files
docs
1 parent 130e5c3 commit 1693149

File tree

8 files changed

+990
-34
lines changed

8 files changed

+990
-34
lines changed

.github/workflows/docs-deploy.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [ 'api-ref', 'main' ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Validate Gradle Wrapper
18+
uses: gradle/wrapper-validation-action@v1
19+
- uses: actions/cache@v3
20+
with:
21+
path: ~/.konan
22+
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
- name: Set up Gradle
29+
uses: gradle/actions/setup-gradle@v4
30+
- name: Gradle publish
31+
run: |
32+
./gradlew dokkaGenerate
33+
shell: bash
34+
- name: Upload static files as artifact
35+
id: deployment
36+
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
37+
with:
38+
path: build/dokka/html
39+
40+
# Deployment job
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

build.gradle.kts

+7-20
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ plugins {
2323
alias(libs.plugins.keeper) apply false
2424
alias(libs.plugins.kotlin.atomicfu) apply false
2525
id("org.jetbrains.dokka") version "2.0.0"
26+
id("dokka-convention")
2627
}
2728

2829
allprojects {
@@ -65,32 +66,18 @@ tasks.getByName<Delete>("clean") {
6566
delete(rootProject.layout.buildDirectory)
6667
}
6768

68-
buildscript {
69-
dependencies {
70-
classpath("org.jetbrains.dokka:dokka-base:2.0.0")
71-
}
72-
}
73-
74-
dokka {
75-
pluginsConfiguration.html {
76-
customAssets.from("./docs/assets/powersync-logo.png")
77-
customAssets.from("./docs/assets/discord.svg")
78-
customAssets.from("./docs/assets/github.svg")
79-
customAssets.from("./docs/assets/web.svg")
80-
customAssets.from("./docs/assets/x.svg")
81-
customAssets.from("./docs/assets/youtube.svg")
82-
customAssets.from("./docs/assets/linkedin.svg")
83-
customStyleSheets.from("./docs/assets/doc-styles.css")
84-
templatesDir = file("./docs/assets/dokka-templates")
85-
}
86-
}
87-
8869
// Merges individual module docs into a single HTML output
8970
dependencies {
9071
dokka(project(":core:"))
9172
dokka(project(":connectors:supabase"))
9273
}
9374

75+
dokka {
76+
moduleName.set("PowerSync Kotlin")
77+
}
78+
79+
// Serve the generated Dokka documentation using a simple HTTP server
80+
// File changes are not watched here
9481
tasks.register("serveDokka") {
9582
dependsOn("dokkaGenerate")
9683
doLast {

connectors/supabase/build.gradle.kts

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins {
99
alias(libs.plugins.kotlinter)
1010
id("com.powersync.plugins.sonatype")
1111
id("org.jetbrains.dokka") version "2.0.0"
12+
id("dokka-convention")
1213
}
1314

1415
kotlin {
@@ -52,3 +53,7 @@ android {
5253
}
5354

5455
setupGithubRepository()
56+
57+
dokka {
58+
moduleName.set("PowerSync Supabase Connector")
59+
}

core/build.gradle.kts

+2-12
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
id("com.powersync.plugins.sharedbuild")
2020
alias(libs.plugins.mokkery)
2121
alias(libs.plugins.kotlin.atomicfu)
22-
id("org.jetbrains.dokka") version "2.0.0"
22+
id("dokka-convention")
2323
}
2424

2525
val binariesFolder = project.layout.buildDirectory.dir("binaries/desktop")
@@ -298,15 +298,5 @@ tasks.withType<KotlinTest> {
298298
setupGithubRepository()
299299

300300
dokka {
301-
pluginsConfiguration.html {
302-
customAssets.from("../docs/assets/powersync-logo.png")
303-
customAssets.from("../docs/assets/discord.svg")
304-
customAssets.from("../docs/assets/github.svg")
305-
customAssets.from("../docs/assets/web.svg")
306-
customAssets.from("../docs/assets/x.svg")
307-
customAssets.from("../docs/assets/youtube.svg")
308-
customAssets.from("../docs/assets/linkedin.svg")
309-
customStyleSheets.from("../docs/assets/doc-styles.css")
310-
templatesDir = file("../docs/assets/dokka-templates")
311-
}
301+
moduleName.set("PowerSync Core")
312302
}

docs/assets/logo-icon.svg

+899
Loading

gradle/libs.versions.toml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ android-minSdk = "24"
44
android-targetSdk = "35"
55
android-compileSdk = "35"
66
configurationAnnotations = "0.9.5"
7+
dokkaBase = "2.0.0"
78
gradleDownloadTask = "5.5.0"
89
java = "17"
910
idea = "243.22562.218" # Meerkat | 2024.3.1 (see https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html)
@@ -56,6 +57,8 @@ junitVersion = "1.2.1"
5657

5758
[libraries]
5859
configuration-annotations = { module = "co.touchlab.skie:configuration-annotations", version.ref = "configurationAnnotations" }
60+
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokkaBase" }
61+
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokkaBase" }
5962
gradle-download-task = { module = "de.undercouch:gradle-download-task", version.ref = "gradleDownloadTask" }
6063
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
6164
kermit-test = { module = "co.touchlab:kermit-test", version.ref = "kermit" }

plugins/build-plugin/build.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ plugins {
33
}
44

55
gradlePlugin {
6-
// Define the plugin
7-
val sonatypeCentralUpload by plugins.creating {
6+
// Define the plugin
7+
val sharedBuild by plugins.creating {
88
id = "com.powersync.plugins.sharedbuild"
99
implementationClass = "com.powersync.plugins.sharedbuild.SharedBuildPlugin"
1010
}
@@ -13,4 +13,5 @@ gradlePlugin {
1313
dependencies {
1414
implementation(libs.gradle.download.task)
1515
implementation(libs.kotlin.gradle.plugin)
16+
implementation(libs.dokka.gradle.plugin)
1617
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id("org.jetbrains.dokka")
3+
}
4+
5+
// Shared Dokka config
6+
dokka {
7+
pluginsConfiguration.html {
8+
val docsAssetsDir = rootProject.file("docs/assets")
9+
10+
customAssets.from(docsAssetsDir.resolve("powersync-logo.png"))
11+
customAssets.from(docsAssetsDir.resolve("logo-icon.svg"))
12+
customAssets.from(docsAssetsDir.resolve("discord.svg"))
13+
customAssets.from(docsAssetsDir.resolve("github.svg"))
14+
customAssets.from(docsAssetsDir.resolve("web.svg"))
15+
customAssets.from(docsAssetsDir.resolve("x.svg"))
16+
customAssets.from(docsAssetsDir.resolve("youtube.svg"))
17+
customAssets.from(docsAssetsDir.resolve("linkedin.svg"))
18+
customStyleSheets.from(docsAssetsDir.resolve("doc-styles.css"))
19+
templatesDir = file(docsAssetsDir.resolve("dokka-templates"))
20+
}
21+
}

0 commit comments

Comments
 (0)