diff --git a/build.gradle b/build.gradle index d1742da5b..8a162573f 100644 --- a/build.gradle +++ b/build.gradle @@ -107,11 +107,11 @@ subprojects { project -> signature 'net.sf.androidscents.signature:android-api-level-21:5.0.1_r2@signature' signature 'org.codehaus.mojo.signature:java18:1.0@signature' } - + spotless { kotlin { target "**/*.kt" - ktlint(versions.ktlint).userData(['indent_size': '2', 'continuation_indent_size' : '2']) + ktlint(versions.ktlint).userData(['indent_size': '2', 'continuation_indent_size': '2']) } } @@ -159,9 +159,9 @@ subprojects { project -> // We have to set the dokka configuration after evaluation since the com.vanniktech.maven.publish // plugin overwrites our dokka configuration on projects where it's applied. afterEvaluate { p -> - p.tasks.dokka { - reportUndocumented = false - skipDeprecated = true + p.tasks.dokka { + reportUndocumented = false + skipDeprecated = true jdkVersion = 8 packageOptions { prefix = "okhttp3.internal" diff --git a/deploy_website.sh b/deploy_website.sh index 106ddb519..688732fd0 100755 --- a/deploy_website.sh +++ b/deploy_website.sh @@ -21,11 +21,23 @@ git clone $REPO $DIR cd $DIR # Generate the API docs -./gradlew :okhttp:dokka +./gradlew \ + :mockwebserver:dokka \ + :okhttp-dnsoverhttps:dokka \ + :okhttp-logging-interceptor:dokka \ + :okhttp-sse:dokka \ + :okhttp-tls:dokka \ + :okhttp-urlconnection:dokka \ + :okhttp:dokka # Build the site and push the new files up to GitHub mkdocs gh-deploy +# Restore Javadocs from 1.x, 2.x, and 3.x. +git checkout gh-pages +git cherry-pick bb229b9dcc9a21a73edbf8d936bea88f52e0a3ff +git push + # Delete our temp folder cd .. rm -rf $DIR diff --git a/mkdocs.yml b/mkdocs.yml index 05bfd4085..d643e9524 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -47,4 +47,20 @@ nav: - 'Upgrading to OkHttp 4': upgrading_to_okhttp_4.md - 'Works with OkHttp': works_with_okhttp.md - 'Stack Overflow': https://stackoverflow.com/questions/tagged/okhttp?sort=active - - 'API Docs': api/okhttp/okhttp3/index.md + - '4.x API': + - 'okhttp': api/okhttp/okhttp3/index.md + - 'dnsoverhttps': api/okhttp-dnsoverhttps/okhttp3.dnsoverhttps/index.md + - 'logging-interceptor': api/okhttp-logging-interceptor/okhttp3.logging/index.md + - 'sse': api/okhttp-sse/okhttp3.sse/index.md + - 'tls': api/okhttp-tls/okhttp3.tls/index.md + - 'urlconnection': api/okhttp-urlconnection/okhttp3/index.md + - 'mockwebserver': api/mockwebserver/okhttp3.mockwebserver/index.md + - '3.x API': + - 'okhttp': https://square.github.io/okhttp/3.x/okhttp/ + - 'dnsoverhttps': https://square.github.io/okhttp/3.x/okhttp-dnsoverhttps/ + - 'logging-interceptor': https://square.github.io/okhttp/3.x/logging-interceptor/ + - 'sse': https://square.github.io/okhttp/3.x/okhttp-sse/ + - 'tls': https://square.github.io/okhttp/3.x/okhttp-tls/ + - 'urlconnection': https://square.github.io/okhttp/3.x/okhttp-urlconnection/ + - 'mockwebserver': https://square.github.io/okhttp/3.x/mockwebserver/ + diff --git a/mockwebserver/build.gradle b/mockwebserver/build.gradle index bf6bddde2..78644e927 100644 --- a/mockwebserver/build.gradle +++ b/mockwebserver/build.gradle @@ -16,6 +16,13 @@ dependencies { testImplementation deps.assertj } +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} + task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') { oldClasspath = files(baselineJar(project, baselineVersion)) newClasspath = files(jar.archivePath) diff --git a/okhttp-dnsoverhttps/build.gradle b/okhttp-dnsoverhttps/build.gradle index 1a9f10409..be16589de 100644 --- a/okhttp-dnsoverhttps/build.gradle +++ b/okhttp-dnsoverhttps/build.gradle @@ -16,3 +16,10 @@ dependencies { testImplementation deps.junit testImplementation deps.assertj } + +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} diff --git a/okhttp-logging-interceptor/build.gradle b/okhttp-logging-interceptor/build.gradle index 538190388..b96034803 100644 --- a/okhttp-logging-interceptor/build.gradle +++ b/okhttp-logging-interceptor/build.gradle @@ -19,6 +19,13 @@ dependencies { testImplementation deps.assertj } +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} + task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') { oldClasspath = files(baselineJar(project, baselineVersion)) newClasspath = files(jar.archivePath) diff --git a/okhttp-sse/build.gradle b/okhttp-sse/build.gradle index a6a478907..594eb2c1d 100644 --- a/okhttp-sse/build.gradle +++ b/okhttp-sse/build.gradle @@ -18,6 +18,13 @@ dependencies { testCompileOnly deps.jsr305 } +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} + task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') { oldClasspath = files(baselineJar(project, baselineVersion)) newClasspath = files(jar.archivePath) diff --git a/okhttp-tls/build.gradle b/okhttp-tls/build.gradle index 3ea56bc9e..a0d9194d6 100644 --- a/okhttp-tls/build.gradle +++ b/okhttp-tls/build.gradle @@ -18,6 +18,13 @@ dependencies { testImplementation deps.assertj } +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} + task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') { oldClasspath = files(baselineJar(project, baselineVersion)) newClasspath = files(jar.archivePath) diff --git a/okhttp-urlconnection/build.gradle b/okhttp-urlconnection/build.gradle index 4b997f571..e94507e0c 100644 --- a/okhttp-urlconnection/build.gradle +++ b/okhttp-urlconnection/build.gradle @@ -19,6 +19,13 @@ dependencies { testImplementation deps.assertj } +afterEvaluate { project -> + project.tasks.dokka { + outputDirectory = "$rootDir/docs/api" + outputFormat = 'gfm' + } +} + task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') { oldClasspath = files(baselineJar(project, baselineVersion)) newClasspath = files(jar.archivePath)