mirror of
https://github.com/square/okhttp.git
synced 2025-07-29 17:41:17 +03:00
Switch to Vanniktech for Maven publishing (#6929)
* Switch to Vanniktech for Maven publishing Steal configuration from Okio, which already works nicely. * Update mockwebserver-junit5/build.gradle.kts Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com> Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>
This commit is contained in:
@ -58,7 +58,7 @@ dependencies {
|
||||
androidTestImplementation(Dependencies.bouncycastle)
|
||||
androidTestImplementation(Dependencies.bouncycastletls)
|
||||
androidTestImplementation(Dependencies.conscryptAndroid)
|
||||
androidTestImplementation(project(":mockwebserver-junit5"))
|
||||
androidTestImplementation(project(":mockwebserver3-junit5"))
|
||||
androidTestImplementation(project(":okhttp-brotli"))
|
||||
androidTestImplementation(project(":okhttp-dnsoverhttps"))
|
||||
androidTestImplementation(project(":okhttp-logging-interceptor"))
|
||||
|
102
build.gradle.kts
102
build.gradle.kts
@ -1,4 +1,5 @@
|
||||
import java.net.URI
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import com.vanniktech.maven.publish.SonatypeHost
|
||||
import java.net.URL
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.jetbrains.dokka.gradle.DokkaTask
|
||||
@ -18,6 +19,7 @@ buildscript {
|
||||
classpath(Dependencies.animalsnifferPlugin)
|
||||
classpath(Dependencies.errorpronePlugin)
|
||||
classpath(Dependencies.spotlessPlugin)
|
||||
classpath(Dependencies.vanniktechPublishPlugin)
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -27,9 +29,10 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply(plugin = "com.vanniktech.maven.publish.base")
|
||||
|
||||
allprojects {
|
||||
group = "com.squareup.okhttp3"
|
||||
project.ext["artifactId"] = project.name.publishedArtifactId()
|
||||
version = "5.0.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
@ -176,62 +179,37 @@ subprojects {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
|
||||
targetCompatibility = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
|
||||
tasks.withType<DokkaTask> {
|
||||
configuration {
|
||||
reportUndocumented = false
|
||||
skipDeprecated = true
|
||||
jdkVersion = 8
|
||||
perPackageOption {
|
||||
prefix = "okhttp3.internal"
|
||||
suppress = true
|
||||
}
|
||||
perPackageOption {
|
||||
prefix = "mockwebserver3.internal"
|
||||
suppress = true
|
||||
}
|
||||
if (project.file("Module.md").exists()) {
|
||||
includes = listOf("Module.md")
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url = URL("https://square.github.io/okio/2.x/okio/")
|
||||
packageListUrl = URL("https://square.github.io/okio/2.x/okio/package-list")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Configure publishing and signing for published Java and JavaPlatform subprojects. */
|
||||
subprojects {
|
||||
val project = this@subprojects
|
||||
if (project.ext.get("artifactId") == null) return@subprojects
|
||||
val bom = project.ext["artifactId"] == "okhttp-bom"
|
||||
|
||||
if (bom) {
|
||||
apply(plugin = "java-platform")
|
||||
tasks.withType<DokkaTask>().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.*")
|
||||
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"))
|
||||
}
|
||||
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "signing")
|
||||
|
||||
configure<PublishingExtension> {
|
||||
if (!bom) {
|
||||
configure<JavaPluginExtension> {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = project.group.toString()
|
||||
artifactId = project.ext["artifactId"].toString()
|
||||
version = project.version.toString()
|
||||
if (bom) {
|
||||
from(components["javaPlatform"])
|
||||
} else {
|
||||
from(components["java"])
|
||||
}
|
||||
plugins.withId("com.vanniktech.maven.publish.base") {
|
||||
configure<MavenPublishBaseExtension> {
|
||||
publishToMavenCentral(SonatypeHost.DEFAULT)
|
||||
signAllPublications()
|
||||
pom {
|
||||
name.set(project.name)
|
||||
description.set("Square’s meticulous HTTP client for Java and Kotlin.")
|
||||
@ -240,11 +218,7 @@ subprojects {
|
||||
license {
|
||||
name.set("The Apache Software License, Version 2.0")
|
||||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
name.set("Square, Inc.")
|
||||
distribution.set("repo")
|
||||
}
|
||||
}
|
||||
scm {
|
||||
@ -252,25 +226,13 @@ subprojects {
|
||||
developerConnection.set("scm:git:ssh://git@github.com/square/okhttp.git")
|
||||
url.set("https://github.com/square/okhttp")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "mavencentral"
|
||||
url = URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||
credentials {
|
||||
username = System.getenv("SONATYPE_NEXUS_USERNAME")
|
||||
password = System.getenv("SONATYPE_NEXUS_PASSWORD")
|
||||
developers {
|
||||
developer {
|
||||
name.set("Square, Inc.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val publishing = extensions.getByType<PublishingExtension>()
|
||||
configure<SigningExtension> {
|
||||
sign(publishing.publications["maven"])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,29 +20,9 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.ExtensionAware
|
||||
import org.gradle.api.tasks.SourceSetContainer
|
||||
import org.gradle.kotlin.dsl.apply
|
||||
import org.gradle.kotlin.dsl.extra
|
||||
import org.gradle.kotlin.dsl.get
|
||||
import org.gradle.kotlin.dsl.withConvention
|
||||
|
||||
fun String.publishedArtifactId(): String? {
|
||||
return when (this) {
|
||||
"okhttp-logging-interceptor" -> "logging-interceptor"
|
||||
"mockwebserver" -> "mockwebserver3"
|
||||
"mockwebserver-junit4" -> "mockwebserver3-junit4"
|
||||
"mockwebserver-junit5" -> "mockwebserver3-junit5"
|
||||
"mockwebserver-deprecated" -> "mockwebserver"
|
||||
"okcurl",
|
||||
"okhttp",
|
||||
"okhttp-bom",
|
||||
"okhttp-brotli",
|
||||
"okhttp-dnsoverhttps",
|
||||
"okhttp-sse",
|
||||
"okhttp-tls",
|
||||
"okhttp-urlconnection" -> this
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.applyOsgi(vararg bndProperties: String) {
|
||||
apply(plugin = "biz.aQute.bnd.builder")
|
||||
sourceSets.create("osgi")
|
||||
@ -59,11 +39,10 @@ fun Project.applyOsgi(vararg bndProperties: String) {
|
||||
*/
|
||||
fun Project.baselineJar(version: String = "3.14.1"): File? {
|
||||
val originalGroup = group
|
||||
val artifactId = extra["artifactId"]
|
||||
return try {
|
||||
val jarFile = "$artifactId-${version}.jar"
|
||||
val jarFile = "$name-$version.jar"
|
||||
group = "virtual_group_for_japicmp"
|
||||
val dependency = dependencies.create("$originalGroup:$artifactId:$version@jar")
|
||||
val dependency = dependencies.create("$originalGroup:$name:$version@jar")
|
||||
configurations.detachedConfiguration(dependency).files.find { (it.name == jarFile) }
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
|
@ -29,7 +29,7 @@ object Versions {
|
||||
|
||||
object Dependencies {
|
||||
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
|
||||
const val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1"
|
||||
const val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.5.31"
|
||||
const val androidPlugin = "com.android.tools.build:gradle:7.0.2"
|
||||
const val androidJunit5Plugin = "de.mannodermaus.gradle.plugins:android-junit5:1.8.0.0"
|
||||
const val graalPlugin = "gradle.plugin.com.palantir.graal:gradle-graal:0.9.0"
|
||||
@ -39,6 +39,7 @@ object Dependencies {
|
||||
const val animalsnifferPlugin = "ru.vyarus:gradle-animalsniffer-plugin:1.5.3"
|
||||
const val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:2.0.2"
|
||||
const val spotlessPlugin = "com.diffplug.spotless:spotless-plugin-gradle:5.15.0"
|
||||
const val vanniktechPublishPlugin = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
|
||||
|
||||
const val android = "org.robolectric:android-all:12-robolectric-7732740"
|
||||
const val animalSniffer = "org.codehaus.mojo:animal-sniffer-annotations:1.20"
|
||||
|
@ -1,10 +1,14 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
@ -15,7 +19,7 @@ tasks.jar {
|
||||
|
||||
dependencies {
|
||||
api(project(":okhttp"))
|
||||
api(project(":mockwebserver"))
|
||||
api(project(":mockwebserver3"))
|
||||
api(Dependencies.junit)
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
@ -23,13 +27,6 @@ dependencies {
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath = files(project.baselineJar())
|
||||
@ -49,3 +46,8 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
"okhttp3.mockwebserver.QueueDispatcher"
|
||||
)
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
@ -10,15 +15,12 @@ tasks.jar {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":mockwebserver"))
|
||||
api(project(":mockwebserver3"))
|
||||
api(Dependencies.junit)
|
||||
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
}
|
||||
|
||||
tasks {
|
||||
@ -16,7 +21,7 @@ tasks {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":mockwebserver"))
|
||||
api(project(":mockwebserver3"))
|
||||
api(Dependencies.junit5Api)
|
||||
compileOnly(Dependencies.animalSniffer)
|
||||
|
||||
@ -25,9 +30,6 @@ dependencies {
|
||||
testImplementation(Dependencies.kotlinJunit5)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,5 +1,11 @@
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
@ -13,14 +19,11 @@ dependencies {
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":okhttp-tls"))
|
||||
testRuntimeOnly(project(":mockwebserver-junit5"))
|
||||
testRuntimeOnly(project(":mockwebserver3-junit5"))
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -19,11 +19,11 @@ dependencies {
|
||||
implementation(project(":okhttp-testing-support"))
|
||||
implementation(project(":okhttp-tls"))
|
||||
implementation(Dependencies.assertj)
|
||||
implementation(project(":mockwebserver3"))
|
||||
implementation(project(":mockwebserver"))
|
||||
implementation(project(":mockwebserver-deprecated"))
|
||||
implementation(project(":okhttp-urlconnection"))
|
||||
implementation(project(":mockwebserver-junit4"))
|
||||
implementation(project(":mockwebserver-junit5"))
|
||||
implementation(project(":mockwebserver3-junit4"))
|
||||
implementation(project(":mockwebserver3-junit5"))
|
||||
implementation(Dependencies.bndResolve)
|
||||
implementation(Dependencies.junit5Api)
|
||||
implementation(Dependencies.junit5JupiterParams)
|
||||
|
@ -1,10 +1,15 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import java.nio.charset.StandardCharsets
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
kotlin("kapt")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("com.palantir.graal")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
@ -23,19 +28,9 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Copy>("copyResourcesTemplates") {
|
||||
from("src/main/resources-templates")
|
||||
into("$buildDir/generated/resources-templates")
|
||||
expand("projectVersion" to "${project.version}")
|
||||
filteringCharset = StandardCharsets.UTF_8.toString()
|
||||
}.let {
|
||||
tasks.processResources.dependsOn(it)
|
||||
tasks.named("sourcesJar").dependsOn(it)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":okhttp"))
|
||||
api(project(":okhttp-logging-interceptor"))
|
||||
api(project(":logging-interceptor"))
|
||||
implementation(Dependencies.picocli)
|
||||
implementation(Dependencies.guava)
|
||||
|
||||
@ -66,3 +61,17 @@ graal {
|
||||
windowsVsVarsPath("C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat")
|
||||
}
|
||||
}
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
||||
tasks.register<Copy>("copyResourcesTemplates") {
|
||||
from("src/main/resources-templates")
|
||||
into("$buildDir/generated/resources-templates")
|
||||
expand("projectVersion" to "${project.version}")
|
||||
filteringCharset = StandardCharsets.UTF_8.toString()
|
||||
}.let {
|
||||
tasks.processResources.dependsOn(it)
|
||||
tasks.named("javaSourcesJar").dependsOn(it)
|
||||
}
|
||||
|
@ -1,14 +1,20 @@
|
||||
plugins {
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("java-platform")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
project.rootProject.subprojects.forEach { subproject ->
|
||||
val artifactId = subproject.name.publishedArtifactId()
|
||||
if (artifactId != null && artifactId != "okhttp-bom") {
|
||||
if (subproject.name != "okhttp-bom") {
|
||||
api(subproject)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extensions.configure<PublishingExtension> {
|
||||
publications.create("maven", MavenPublication::class) {
|
||||
from(project.components.getByName("javaPlatform"))
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
}
|
||||
|
||||
project.applyOsgi(
|
||||
@ -20,9 +25,6 @@ dependencies {
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,6 +1,11 @@
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
}
|
||||
|
||||
project.applyOsgi(
|
||||
@ -14,17 +19,14 @@ dependencies {
|
||||
compileOnly(Dependencies.jsr305)
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":mockwebserver-deprecated"))
|
||||
testImplementation(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(project(":mockwebserver3-junit5"))
|
||||
testImplementation(Dependencies.okioFakeFileSystem)
|
||||
testImplementation(Dependencies.conscrypt)
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ dependencies {
|
||||
testImplementation(Dependencies.moshi)
|
||||
testImplementation(project(":okhttp"))
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":mockwebserver-deprecated"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
}
|
||||
|
||||
@ -19,20 +23,13 @@ dependencies {
|
||||
|
||||
testCompileOnly(Dependencies.jsr305)
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver3"))
|
||||
testImplementation(project(":mockwebserver3-junit5"))
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":okhttp-tls"))
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath = files(project.baselineJar())
|
||||
@ -43,3 +40,7 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
isIgnoreMissingClasses = true
|
||||
isIncludeSynthetic = true
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
}
|
||||
|
||||
@ -18,20 +22,13 @@ dependencies {
|
||||
compileOnly(Dependencies.jsr305)
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver3"))
|
||||
testImplementation(project(":mockwebserver3-junit5"))
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
testCompileOnly(Dependencies.jsr305)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath = files(project.baselineJar())
|
||||
@ -45,3 +42,7 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
"okhttp3.internal.sse"
|
||||
)
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
project.applyOsgi(
|
||||
@ -21,18 +25,11 @@ dependencies {
|
||||
compileOnly(Dependencies.animalSniffer)
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver3-junit5"))
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
animalsniffer {
|
||||
// InsecureExtendedTrustManager (API 24+)
|
||||
ignore = listOf("javax.net.ssl.X509ExtendedTrustManager")
|
||||
@ -51,3 +48,7 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
"okhttp3.tls.internal"
|
||||
)
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
}
|
||||
|
||||
@ -23,18 +27,11 @@ dependencies {
|
||||
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":okhttp-tls"))
|
||||
testImplementation(project(":mockwebserver-deprecated"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.assertj)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath = files(project.baselineJar())
|
||||
@ -45,3 +42,8 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
isIgnoreMissingClasses = true
|
||||
isIncludeSynthetic = true
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.vanniktech.maven.publish.JavadocJar
|
||||
import com.vanniktech.maven.publish.KotlinJvm
|
||||
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||
import java.nio.charset.StandardCharsets
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
id("org.jetbrains.dokka")
|
||||
id("com.vanniktech.maven.publish.base")
|
||||
id("me.champeau.gradle.japicmp")
|
||||
}
|
||||
|
||||
project.applyOsgi(
|
||||
@ -56,16 +60,6 @@ normalization {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<Copy>("copyJavaTemplates") {
|
||||
from("src/main/java-templates")
|
||||
into("$buildDir/generated/sources/java-templates/java/main")
|
||||
expand("projectVersion" to project.version)
|
||||
filteringCharset = StandardCharsets.UTF_8.toString()
|
||||
}.let {
|
||||
tasks.compileKotlin.dependsOn(it)
|
||||
tasks.named("sourcesJar").dependsOn(it)
|
||||
}
|
||||
|
||||
// Expose OSGi jars to the test environment.
|
||||
configurations {
|
||||
create("osgiTestDeploy")
|
||||
@ -95,11 +89,11 @@ dependencies {
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(project(":okhttp-tls"))
|
||||
testImplementation(project(":okhttp-urlconnection"))
|
||||
testImplementation(project(":mockwebserver3"))
|
||||
testImplementation(project(":mockwebserver3-junit4"))
|
||||
testImplementation(project(":mockwebserver3-junit5"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testImplementation(project(":mockwebserver-junit4"))
|
||||
testImplementation(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver-deprecated"))
|
||||
testImplementation(project(":okhttp-logging-interceptor"))
|
||||
testImplementation(project(":logging-interceptor"))
|
||||
testImplementation(project(":okhttp-brotli"))
|
||||
testImplementation(project(":okhttp-dnsoverhttps"))
|
||||
testImplementation(project(":okhttp-sse"))
|
||||
@ -116,13 +110,6 @@ dependencies {
|
||||
testCompileOnly(Dependencies.jsr305)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
tasks.dokka {
|
||||
outputDirectory = "$rootDir/docs/4.x"
|
||||
outputFormat = "gfm"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register<JapicmpTask>("japicmp") {
|
||||
dependsOn("jar")
|
||||
oldClasspath = files(project.baselineJar())
|
||||
@ -185,3 +172,18 @@ tasks.register<JapicmpTask>("japicmp") {
|
||||
"okhttp3.Request\$Builder#delete()",
|
||||
)
|
||||
}.let(tasks.check::dependsOn)
|
||||
|
||||
configure<MavenPublishBaseExtension> {
|
||||
configure(KotlinJvm(javadocJar = JavadocJar.Dokka("dokkaGfm")))
|
||||
}
|
||||
|
||||
tasks.register<Copy>("copyJavaTemplates") {
|
||||
from("src/main/java-templates")
|
||||
into("$buildDir/generated/sources/java-templates/java/main")
|
||||
expand("projectVersion" to project.version)
|
||||
filteringCharset = StandardCharsets.UTF_8.toString()
|
||||
}.let {
|
||||
tasks.compileKotlin.dependsOn(it)
|
||||
tasks.named("javaSourcesJar").dependsOn(it)
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,8 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
testImplementation(project(":okhttp"))
|
||||
testImplementation(project(":mockwebserver"))
|
||||
testRuntimeOnly(project(":mockwebserver-junit5"))
|
||||
testImplementation(project(":mockwebserver3"))
|
||||
testRuntimeOnly(project(":mockwebserver3-junit5"))
|
||||
testImplementation(project(":okhttp-tls"))
|
||||
testImplementation(project(":okhttp-testing-support"))
|
||||
testImplementation(Dependencies.httpclient5)
|
||||
|
@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(project(":okhttp"))
|
||||
implementation(project(":mockwebserver-deprecated"))
|
||||
implementation(project(":mockwebserver"))
|
||||
implementation(project(":okhttp-testing-support"))
|
||||
implementation(project(":okhttp-tls"))
|
||||
implementation(Dependencies.animalSniffer)
|
||||
|
@ -3,6 +3,6 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":mockwebserver-deprecated"))
|
||||
implementation(project(":mockwebserver"))
|
||||
implementation(Dependencies.moshi)
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ tasks.jar {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":mockwebserver-deprecated"))
|
||||
implementation(project(":mockwebserver"))
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
|
@ -4,6 +4,6 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(project(":okhttp"))
|
||||
implementation(project(":mockwebserver-deprecated"))
|
||||
implementation(project(":mockwebserver"))
|
||||
implementation(Dependencies.jnrUnixsocket)
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
rootProject.name = "okhttp-parent"
|
||||
|
||||
include(":mockwebserver")
|
||||
project(":mockwebserver").name = "mockwebserver3"
|
||||
include(":mockwebserver-deprecated")
|
||||
project(":mockwebserver-deprecated").name = "mockwebserver"
|
||||
include(":mockwebserver-junit4")
|
||||
project(":mockwebserver-junit4").name = "mockwebserver3-junit4"
|
||||
include(":mockwebserver-junit5")
|
||||
project(":mockwebserver-junit5").name = "mockwebserver3-junit5"
|
||||
|
||||
val androidBuild: String? by settings
|
||||
val graalBuild: String? by settings
|
||||
@ -24,6 +28,7 @@ include(":okhttp-brotli")
|
||||
include(":okhttp-dnsoverhttps")
|
||||
include(":okhttp-hpacktests")
|
||||
include(":okhttp-logging-interceptor")
|
||||
project(":okhttp-logging-interceptor").name = "logging-interceptor"
|
||||
include(":okhttp-sse")
|
||||
include(":okhttp-testing-support")
|
||||
include(":okhttp-tls")
|
||||
|
Reference in New Issue
Block a user