Skip to content

Commit 0b9da3d

Browse files
committed
Try to deploy javadocs
1 parent 3921da9 commit 0b9da3d

File tree

3 files changed

+27
-84
lines changed

3 files changed

+27
-84
lines changed

.github/workflows/javadocs.yml

-80
This file was deleted.

Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM gradle:8.13-jdk21 as build-docs
2+
3+
WORKDIR /build/docs
4+
5+
COPY . ./
6+
7+
RUN ./gradlew dokkaHtml
8+
9+
FROM node:lts-alpine AS serve-docs
10+
11+
WORKDIR /build/docs
12+
13+
RUN npm install -g http-server
14+
RUN http-server

build.gradle.kts

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
55
import java.net.HttpURLConnection
66
import java.net.URL
77
import java.io.ByteArrayOutputStream
8+
import kotlin.io.path.Path
9+
import kotlin.io.path.exists
10+
import kotlin.io.path.readBytes
11+
import kotlin.io.path.readText
812

913
buildscript {
1014
dependencies {
@@ -164,12 +168,17 @@ tasks {
164168
}
165169

166170
doFirst {
167-
val archiveBase = "https://www.chattriggers.com/javadocs-archive/"
168-
val versions = String(downloadFile(archiveBase + "versions")).lines().map(String::trim)
171+
val javadocsArchive = projectDir.resolve("javadocs-archive")
172+
if (!javadocsArchive.exists())
173+
return@doFirst
174+
169175
val tmpFile = File(temporaryDir, "oldVersionsZip.zip")
170176

171-
versions.filter(String::isNotEmpty).map(String::trim).forEach { version ->
172-
val zipBytes = downloadFile("$archiveBase$version.zip")
177+
javadocsArchive.listFiles()?.forEach {
178+
if (it.extension != "zip")
179+
return@forEach
180+
181+
val zipBytes = it.readBytes()
173182
tmpFile.writeBytes(zipBytes)
174183
unzipTo(docVersionsDir, tmpFile)
175184
}

0 commit comments

Comments
 (0)