Skip to content

Commit

Permalink
Fixup some deploy_website problems (#8063)
Browse files Browse the repository at this point in the history
* Fixup some deploy_website problems

* Skip all internal packages
  • Loading branch information
squarejesse authored Nov 20, 2023
1 parent 6132f27 commit 0343ff8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
17 changes: 5 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import groovy.util.NodeList
import java.net.URL
import kotlinx.validation.ApiValidationExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
Expand Down Expand Up @@ -219,30 +219,23 @@ subprojects {

/** Configure publishing and signing for published Java and JavaPlatform subprojects. */
subprojects {
tasks.withType<DokkaTask>().configureEach {
tasks.withType<DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(8)
perPackageOption {
matchingRegex.set("okhttp3\\.internal.*")
suppress.set(true)
}
perPackageOption {
matchingRegex.set("mockwebserver3\\.internal.*")
matchingRegex.set(".*\\.internal.*")
suppress.set(true)
}
if (project.file("Module.md").exists()) {
includes.from(project.file("Module.md"))
}
externalDocumentationLink {
url.set(URL("https://square.github.io/okio/2.x/okio/"))
packageListUrl.set(URL("https://square.github.io/okio/2.x/okio/package-list"))
url.set(URL("https://square.github.io/okio/3.x/okio/"))
packageListUrl.set(URL("https://square.github.io/okio/3.x/okio/okio/package-list"))
}
}
if (name == "dokkaGfm") {
outputDirectory.set(file("${rootDir}/docs/4.x"))
}
}

plugins.withId("com.vanniktech.maven.publish.base") {
Expand Down
9 changes: 5 additions & 4 deletions deploy_website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

# The website is built using MkDocs with the Material theme.
# https://squidfunk.github.io/mkdocs-material/
# It requires Python to run.
# Install the packages with the following command:
# pip install mkdocs mkdocs-material mkdocs-redirects
# It requires python3 to run.

set -ex

Expand All @@ -26,14 +24,17 @@ cd $DIR
# Generate the API docs
./gradlew dokkaHtmlMultiModule

mv ./build/dokka/htmlMultiModule docs/4.x
mv ./build/dokka/htmlMultiModule docs/5.x

# Copy in special files that GitHub wants in the project root.
cat README.md | grep -v 'project website' > docs/index.md
cp CHANGELOG.md docs/changelogs/changelog.md
cp CONTRIBUTING.md docs/contribute/contributing.md

# Build the site and push the new files up to GitHub
python3 -m venv venv
source venv/bin/activate
pip install mkdocs-material mkdocs-redirects
mkdocs gh-deploy

# Restore Javadocs from 1.x, 2.x, and 3.x.
Expand Down
11 changes: 1 addition & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,7 @@ nav:
- 'Providers': security/security_providers.md
- 'Configuration History': security/tls_configuration_history.md
- 'Works with OkHttp': works_with_okhttp.md
- 'API':
- 'okhttp': 4.x/okhttp/okhttp3/index.html
- 'brotli': 4.x/okhttp-brotli/okhttp3.brotli/index.html
- 'dnsoverhttps': 4.x/okhttp-dnsoverhttps/okhttp3.dnsoverhttps/index.html
- 'logging-interceptor': 4.x/logging-interceptor/okhttp3.logging/index.html
- 'sse': 4.x/okhttp-sse/okhttp3.sse/index.html
- 'tls': 4.x/okhttp-tls/okhttp3.tls/index.html
- 'urlconnection': 4.x/okhttp-urlconnection/okhttp3/index.html
- 'mockwebserver': 4.x/mockwebserver/okhttp3.mockwebserver/index.html
- 'API': 5.x/okhttp/okhttp3/
- 'Change Logs':
- 'Change Log': changelogs/changelog.md
- '4.x Change Log': changelogs/changelog_4x.md
Expand All @@ -123,4 +115,3 @@ nav:
- 'Code of Conduct': contribute/code_of_conduct.md
- 'Concurrency': contribute/concurrency.md
- 'Debug Logging': contribute/debug_logging.md

0 comments on commit 0343ff8

Please sign in to comment.