From eae34369a577b1164260acf9c2eea9df62c41d52 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Mon, 8 Jun 2026 17:28:48 -0400 Subject: [PATCH] Fix website publishing --- .../okhttp.dokka-multimodule-conventions.gradle.kts | 4 +--- .../src/main/kotlin/okhttp.publish-conventions.gradle.kts | 5 +++++ deploy_website.sh | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build-logic/src/main/kotlin/okhttp.dokka-multimodule-conventions.gradle.kts b/build-logic/src/main/kotlin/okhttp.dokka-multimodule-conventions.gradle.kts index 0c7b1460b177..319fa56bb49d 100644 --- a/build-logic/src/main/kotlin/okhttp.dokka-multimodule-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/okhttp.dokka-multimodule-conventions.gradle.kts @@ -1,7 +1,5 @@ val okhttpDokka: String? by project -val dokkaBuild = okhttpDokka?.toBoolean() == true - -if (dokkaBuild) { +if (okhttpDokka?.toBoolean() == true) { apply(plugin = "org.jetbrains.dokka") dependencies { diff --git a/build-logic/src/main/kotlin/okhttp.publish-conventions.gradle.kts b/build-logic/src/main/kotlin/okhttp.publish-conventions.gradle.kts index d00227dd255f..18379db31c2d 100644 --- a/build-logic/src/main/kotlin/okhttp.publish-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/okhttp.publish-conventions.gradle.kts @@ -11,6 +11,11 @@ plugins { id("binary-compatibility-validator") } +val okhttpDokka: String? by project +if (okhttpDokka?.toBoolean() == true) { + apply(plugin = "org.jetbrains.dokka") +} + configure { publishToMavenCentral(automaticRelease = true) signAllPublications() diff --git a/deploy_website.sh b/deploy_website.sh index 0e780ea02a8d..c2b01177d7f5 100755 --- a/deploy_website.sh +++ b/deploy_website.sh @@ -22,9 +22,8 @@ git clone $REPO $DIR cd $DIR # Generate the API docs -./gradlew dokkaHtmlMultiModule - -mv ./build/dokka/htmlMultiModule docs/5.x +./gradlew dokkaGeneratePublicationHtml -PokhttpDokka=true +mv ./build/dokka/html docs/5.x # Copy in special files that GitHub wants in the project root. cat README.md | grep -v 'project website' > docs/index.md @@ -37,10 +36,11 @@ source venv/bin/activate pip install mkdocs-material mkdocs-redirects mkdocs gh-deploy -# Restore Javadocs from 1.x, 2.x, and 3.x. +# Restore Javadocs from 1.x, 2.x, 3.x, and 4.x. git checkout gh-pages git cherry-pick bb229b9dcc9a21a73edbf8d936bea88f52e0a3ff git cherry-pick c695732f1d4aea103b826876c077fbfea630e244 +git cherry-pick e2c9cb1d012882bb1182a45ab7265d94c40d5532 git push --set-upstream origin gh-pages # Delete our temp folder