1
0
mirror of https://github.com/square/okhttp.git synced 2025-07-06 01:01:14 +03:00

Adopt Version Catalog and Updates plugin (#7075)

This commit is contained in:
Yuri Schimke
2022-02-15 23:38:32 +00:00
committed by GitHub
parent edcaa9fade
commit 362f53546d
27 changed files with 306 additions and 254 deletions

View File

@ -46,8 +46,8 @@ android {
}
dependencies {
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.playServicesSafetynet)
implementation(libs.kotlin.reflect)
implementation(libs.playservices.safetynet)
implementation(projects.okhttp)
androidTestImplementation(projects.okhttpTestingSupport) {
@ -55,25 +55,24 @@ dependencies {
exclude("org.conscrypt", "conscrypt-openjdk-uber")
exclude("software.amazon.cryptools", "AmazonCorrettoCryptoProvider")
}
androidTestImplementation(Dependencies.bouncycastle)
androidTestImplementation(Dependencies.bouncycastletls)
androidTestImplementation(Dependencies.conscryptAndroid)
androidTestImplementation(libs.bouncycastle.bcprov)
androidTestImplementation(libs.bouncycastle.bctls)
androidTestImplementation(libs.conscrypt.android)
androidTestImplementation(projects.mockwebserver3Junit5)
androidTestImplementation(projects.okhttpBrotli)
androidTestImplementation(projects.okhttpDnsoverhttps)
androidTestImplementation(projects.loggingInterceptor)
androidTestImplementation(projects.okhttpSse)
androidTestImplementation(projects.okhttpTestingSupport)
androidTestImplementation(projects.okhttpTls)
androidTestImplementation(Dependencies.androidxExtJunit)
androidTestImplementation(Dependencies.androidxEspressoCore)
androidTestImplementation(Dependencies.httpclient5)
androidTestImplementation(Dependencies.moshi)
androidTestImplementation(Dependencies.moshiKotlin)
androidTestImplementation(Dependencies.okioFakeFileSystem)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.httpcomponents.httpclient5)
androidTestImplementation(libs.squareup.moshi)
androidTestImplementation(libs.squareup.moshi.kotlin)
androidTestImplementation(libs.squareup.okio.fakefilesystem)
androidTestImplementation(Dependencies.androidxTestRunner)
androidTestImplementation(Dependencies.junit5Api)
androidTestImplementation(Dependencies.junit5AndroidCore)
androidTestRuntimeOnly(Dependencies.junit5AndroidRunner)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.junit.jupiter.api)
androidTestImplementation(libs.junit5android.core)
androidTestRuntimeOnly(libs.junit5android.runner)
}

View File

@ -1,6 +1,7 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import java.net.URL
import nl.littlerobots.vcu.plugin.versionCatalogUpdate
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@ -8,18 +9,20 @@ import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension
buildscript {
dependencies {
classpath(Dependencies.kotlinPlugin)
classpath(Dependencies.dokkaPlugin)
classpath(Dependencies.androidPlugin)
classpath(Dependencies.androidJunit5Plugin)
classpath(Dependencies.graalPlugin)
classpath(Dependencies.bndPlugin)
classpath(Dependencies.shadowPlugin)
classpath(Dependencies.japicmpPlugin)
classpath(Dependencies.animalsnifferPlugin)
classpath(Dependencies.errorpronePlugin)
classpath(Dependencies.spotlessPlugin)
classpath(Dependencies.vanniktechPublishPlugin)
classpath(libs.gradleplugin.dokka)
classpath(libs.gradleplugin.kotlin)
classpath(libs.gradleplugin.android.junit5)
classpath(libs.gradleplugin.android)
classpath(libs.gradleplugin.palantir.graal)
classpath(libs.gradleplugin.aqute.bnd)
classpath(libs.gradleplugin.johnrengelman.shadow)
classpath(libs.gradleplugin.japicmp)
classpath(libs.gradleplugin.animalsniffer)
classpath(libs.gradleplugin.errorprone)
classpath(libs.gradleplugin.spotless)
classpath(libs.gradleplugin.vanniktech)
classpath(libs.gradleplugin.benmanes.versions)
classpath(libs.gradleplugin.littlerobots.vcu)
}
repositories {
@ -30,6 +33,8 @@ buildscript {
}
apply(plugin = "com.vanniktech.maven.publish.base")
apply(plugin = "com.github.ben-manes.versions")
apply(plugin = "nl.littlerobots.version-catalog-update")
allprojects {
group = "com.squareup.okhttp3"
@ -87,30 +92,31 @@ subprojects {
exclude("**/CipherSuite.java")
}
val checkstyleConfig: Configuration by configurations.creating
dependencies {
checkstyleConfig(Dependencies.checkStyle) {
isTransitive = false
}
}
afterEvaluate {
val checkstyleConfig: Configuration by configurations.creating
dependencies {
checkstyleConfig(libs.checkStyle) {
isTransitive = false
}
}
configure<CheckstyleExtension> {
config = resources.text.fromArchiveEntry(checkstyleConfig, "google_checks.xml")
toolVersion = Versions.checkStyle
toolVersion = libs.versions.checkStyle.get()
sourceSets = listOf(project.sourceSets["main"])
}
}
// Animal Sniffer confirms we generally don't use APIs not on Java 8.
configure<AnimalSnifferExtension> {
annotation = "okhttp3.internal.SuppressSignatureCheck"
sourceSets = listOf(project.sourceSets["main"])
}
val signature: Configuration by configurations.getting
dependencies {
signature(Dependencies.signatureAndroid21)
signature(Dependencies.signatureJava18)
// Animal Sniffer confirms we generally don't use APIs not on Java 8.
configure<AnimalSnifferExtension> {
annotation = "okhttp3.internal.SuppressSignatureCheck"
sourceSets = listOf(project.sourceSets["main"])
}
val signature: Configuration by configurations.getting
dependencies {
signature(libs.signature.android.apilevel21)
signature(libs.codehaus.signature.java18)
}
}
tasks.withType<KotlinCompile> {
@ -127,9 +133,12 @@ subprojects {
val testJavaVersion = System.getProperty("test.java.version", "11").toInt()
val testRuntimeOnly: Configuration by configurations.getting
dependencies {
testRuntimeOnly(Dependencies.junit5JupiterEngine)
testRuntimeOnly(Dependencies.junit5VintageEngine)
afterEvaluate {
dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.vintage.engine)
}
}
tasks.withType<Test> {
@ -166,11 +175,11 @@ subprojects {
}
} else if (platform == "conscrypt") {
dependencies {
testRuntimeOnly(Dependencies.conscrypt)
testRuntimeOnly(libs.conscrypt)
}
} else if (platform == "openjsse") {
dependencies {
testRuntimeOnly(Dependencies.openjsse)
testRuntimeOnly(libs.openjsse)
}
}
@ -241,3 +250,24 @@ subprojects {
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
versionCatalogUpdate {
sortByKey = true
keep {
// gradle profiles are used to enable/disable some modules so keep all
keepUnusedVersions.set(true)
keepUnusedLibraries.set(true)
keepUnusedPlugins.set(true)
}
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
candidate.run {
version.contains("alpha") ||
version.contains("beta") ||
version.contains("1.6.20-M")
}
}
}

View File

@ -45,7 +45,7 @@ private fun Project.applyOsgi(
val osgi = project.sourceSets.create("osgi")
val osgiApi = project.configurations.getByName(osgiApiConfigurationName)
project.dependencies {
osgiApi(Dependencies.kotlinStdlibOsgi)
osgiApi("org.jetbrains.kotlin:kotlin-osgi-bundle:1.6.10")
}
val jarTask = tasks.getByName<Jar>(jarTaskName)

View File

@ -17,84 +17,3 @@
// If false - JS targets will not be configured in multiplatform projects.
val kmpJsEnabled = System.getProperty("kjs", "true").toBoolean()
object Versions {
const val bnd = "6.1.0"
const val bouncyCastle = "1.70"
const val checkStyle = "9.2"
const val conscrypt = "2.5.2"
const val junit5 = "5.8.2"
const val junit5Android = "1.3.0"
const val kotlin = "1.6.10"
const val moshi = "1.13.0"
const val okio = "3.0.0"
const val picocli = "4.6.2"
const val graal = "22.0.0.2"
}
object Dependencies {
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
const val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.6.0"
const val androidPlugin = "com.android.tools.build:gradle:7.0.4"
const val androidJunit5Plugin = "de.mannodermaus.gradle.plugins:android-junit5:1.8.0.0"
const val graalPlugin = "gradle.plugin.com.palantir.graal:gradle-graal:0.10.0"
const val bndPlugin = "biz.aQute.bnd:biz.aQute.bnd.gradle:${Versions.bnd}"
const val shadowPlugin = "gradle.plugin.com.github.johnrengelman:shadow:7.1.0"
const val japicmpPlugin = "me.champeau.gradle:japicmp-gradle-plugin:0.3.0"
const val animalsnifferPlugin = "ru.vyarus:gradle-animalsniffer-plugin:1.5.4"
const val errorpronePlugin = "net.ltgt.gradle:gradle-errorprone-plugin:2.0.2"
const val spotlessPlugin = "com.diffplug.spotless:spotless-plugin-gradle:6.0.4"
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"
const val assertj = "org.assertj:assertj-core:3.21.0"
const val bndResolve = "biz.aQute.bnd:biz.aQute.resolve:${Versions.bnd}"
const val bouncycastle = "org.bouncycastle:bcprov-jdk15to18:${Versions.bouncyCastle}"
const val bouncycastlepkix = "org.bouncycastle:bcpkix-jdk15to18:${Versions.bouncyCastle}"
const val bouncycastletls = "org.bouncycastle:bctls-jdk15to18:${Versions.bouncyCastle}"
const val brotli = "org.brotli:dec:0.1.2"
const val conscrypt = "org.conscrypt:conscrypt-openjdk-uber:${Versions.conscrypt}"
const val conscryptAndroid = "org.conscrypt:conscrypt-android:${Versions.conscrypt}"
const val corretto = "software.amazon.cryptools:AmazonCorrettoCryptoProvider:1.6.1:linux-x86_64"
const val equinox = "org.eclipse.platform:org.eclipse.osgi:3.17.100"
const val guava = "com.google.guava:guava:31.0.1-jre"
const val hamcrest = "org.hamcrest:hamcrest-library:2.2"
const val jnrUnixsocket = "com.github.jnr:jnr-unixsocket:0.38.15"
const val jsoup = "org.jsoup:jsoup:1.14.3"
const val jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
const val junit = "junit:junit:4.13.2"
const val junit5Api = "org.junit.jupiter:junit-jupiter-api:${Versions.junit5}"
const val junit5JupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit5}"
const val junit5JupiterParams = "org.junit.jupiter:junit-jupiter-params:${Versions.junit5}"
const val junit5VintageEngine = "org.junit.vintage:junit-vintage-engine:${Versions.junit5}"
const val junit5AndroidCore = "de.mannodermaus.junit5:android-test-core:${Versions.junit5Android}"
const val junit5AndroidRunner = "de.mannodermaus.junit5:android-test-runner:${Versions.junit5Android}"
const val junitPlatformConsole = "org.junit.platform:junit-platform-console:1.7.2"
const val kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
const val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}"
const val kotlinStdlibOsgi = "org.jetbrains.kotlin:kotlin-osgi-bundle:${Versions.kotlin}"
const val kotlinJunit5 = "org.jetbrains.kotlin:kotlin-test-junit5:${Versions.kotlin}"
const val kotlinTest = "org.jetbrains.kotlin:kotlin-test-common:${Versions.kotlin}"
const val kotlinTestAnnotations ="org.jetbrains.kotlin:kotlin-test-annotations-common:${Versions.kotlin}"
const val kotlinTestJunit ="org.jetbrains.kotlin:kotlin-test-junit:${Versions.kotlin}"
const val kotlinTestJs ="org.jetbrains.kotlin:kotlin-test-js:${Versions.kotlin}"
const val moshi = "com.squareup.moshi:moshi:${Versions.moshi}"
const val moshiKotlin = "com.squareup.moshi:moshi-kotlin:${Versions.moshi}"
const val moshiCompiler = "com.squareup.moshi:moshi-kotlin-codegen:${Versions.moshi}"
const val okio = "com.squareup.okio:okio:${Versions.okio}"
const val okioFakeFileSystem = "com.squareup.okio:okio-fakefilesystem:${Versions.okio}"
const val openjsse = "org.openjsse:openjsse:1.1.8"
const val picocli = "info.picocli:picocli:${Versions.picocli}"
const val picocliCompiler = "info.picocli:picocli-codegen:${Versions.picocli}"
const val playServicesSafetynet = "com.google.android.gms:play-services-safetynet:17.0.1"
const val androidxExtJunit = "androidx.test.ext:junit:1.1.3"
const val androidxEspressoCore = "androidx.test.espresso:espresso-core:3.4.0"
const val androidxTestRunner = "androidx.test:runner:1.4.0"
const val httpclient5 = "org.apache.httpcomponents.client5:httpclient5:5.0"
const val nativeImageSvm = "org.graalvm.nativeimage:svm:${Versions.graal}"
const val jettyClient = "org.eclipse.jetty:jetty-client:9.4.27.v20200227"
const val checkStyle = "com.puppycrawl.tools:checkstyle:${Versions.checkStyle}"
const val signatureAndroid21 = "net.sf.androidscents.signature:android-api-level-21:5.0.1_r2@signature"
const val signatureJava18 = "org.codehaus.mojo.signature:java18:1.0@signature"
const val assertk = "com.willowtreeapps.assertk:assertk:0.25"
}

100
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,100 @@
[versions]
biz-aQute-bnd = "6.1.0"
checkStyle = "9.2"
com-squareup-moshi = "1.13.0"
com-squareup-okio = "3.0.0"
conscrypt = "2.5.2"
de-mannodermaus-junit5 = "1.3.0"
graalvm = "22.0.0.2"
info-picocli = "4.6.3"
junit5 = "5.8.2"
junit5Android = "1.3.0"
org-bouncycastle = "1.70"
org-conscrypt = "2.5.2"
org-eclipse-platform = "3.17.100"
org-jetbrains-dokka = "1.6.10"
org-jetbrains-kotlin = "1.6.10"
org-junit-jupiter = "5.8.2"
picocli = "4.6.2"
[libraries]
amazon-corretto = "software.amazon.cryptools:AmazonCorrettoCryptoProvider:1.6.1"
androidx-espresso-core = "androidx.test.espresso:espresso-core:3.4.0"
androidx-junit = "androidx.test.ext:junit:1.1.3"
androidx-test-runner = "androidx.test:runner:1.4.0"
animalsniffer-annotations = "org.codehaus.mojo:animal-sniffer-annotations:1.21"
aqute-resolve = { module = "biz.aQute.bnd:biz.aQute.resolve", version.ref = "biz-aQute-bnd" }
assertj-core = "org.assertj:assertj-core:3.22.0"
assertk = "com.willowtreeapps.assertk:assertk:0.25"
bouncycastle-bcpkix = { module = "org.bouncycastle:bcpkix-jdk15to18", version.ref = "org-bouncycastle" }
bouncycastle-bcprov = { module = "org.bouncycastle:bcprov-jdk15to18", version.ref = "org-bouncycastle" }
bouncycastle-bctls = { module = "org.bouncycastle:bctls-jdk15to18", version.ref = "org-bouncycastle" }
brotli-dec = "org.brotli:dec:0.1.2"
checkStyle = "com.puppycrawl.tools:checkstyle:9.2"
codehaus-signature-java18 = "org.codehaus.mojo.signature:java18:1.0"
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "org-conscrypt" }
conscrypt-openjdk = { module = "org.conscrypt:conscrypt-openjdk-uber", version.ref = "org-conscrypt" }
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "org-jetbrains-dokka" }
eclipse-jetty-client = "org.eclipse.jetty:jetty-client:9.4.27.v20200227"
eclipse-osgi = { module = "org.eclipse.platform:org.eclipse.osgi", version.ref = "org-eclipse-platform" }
equinox = { module = "org.eclipse.platform:org.eclipse.osgi", version.ref = "org-eclipse-platform" }
findbugs-jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
graalvm-nativeimage-svm = { module = "org.graalvm.nativeimage:svm", version.ref = "graalvm" }
gradleplugin-android = "com.android.tools.build:gradle:7.1.1"
gradleplugin-android-junit5 = "de.mannodermaus.gradle.plugins:android-junit5:1.8.0.0"
gradleplugin-animalsniffer = "ru.vyarus:gradle-animalsniffer-plugin:1.5.4"
gradleplugin-aqute-bnd = { module = "biz.aQute.bnd:biz.aQute.bnd.gradle", version.ref = "biz-aQute-bnd" }
gradleplugin-benmanes-versions = "com.github.ben-manes:gradle-versions-plugin:0.42.0"
gradleplugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "org-jetbrains-dokka" }
gradleplugin-dokka-all-modules-page = { module = "org.jetbrains.dokka:all-modules-page-plugin", version.ref = "org-jetbrains-dokka" }
gradleplugin-dokka-gfm-template-processing = { module = "org.jetbrains.dokka:gfm-template-processing-plugin", version.ref = "org-jetbrains-dokka" }
gradleplugin-dokka-jekyll-template-processing = { module = "org.jetbrains.dokka:jekyll-template-processing-plugin", version.ref = "org-jetbrains-dokka" }
gradleplugin-errorprone = "net.ltgt.gradle:gradle-errorprone-plugin:2.0.2"
gradleplugin-japicmp = "me.champeau.gradle:japicmp-gradle-plugin:0.3.0"
gradleplugin-johnrengelman-shadow = "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
gradleplugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "org-jetbrains-kotlin" }
gradleplugin-littlerobots-vcu = "nl.littlerobots.vcu:plugin:0.3.0"
gradleplugin-mannodermaus-androidjunit5 = "de.mannodermaus.gradle.plugins:android-junit5:1.8.2.0"
gradleplugin-palantir-graal = "gradle.plugin.com.palantir.graal:gradle-graal:0.10.0"
gradleplugin-spotless = "com.diffplug.spotless:spotless-plugin-gradle:6.2.2"
gradleplugin-vanniktech = "com.vanniktech:gradle-maven-publish-plugin:0.18.0"
guava-jre = "com.google.guava:guava:31.0.1-jre"
hamcrest-library = "org.hamcrest:hamcrest-library:2.2"
httpcomponents-httpclient5 = "org.apache.httpcomponents.client5:httpclient5:5.1.3"
info-picocli = { module = "info.picocli:picocli", version.ref = "info-picocli" }
info-picocli-codegen = { module = "info.picocli:picocli-codegen", version.ref = "info-picocli" }
jetty-client = "org.eclipse.jetty:jetty-client:11.0.8"
jnr-unixsocket = "com.github.jnr:jnr-unixsocket:0.38.17"
jsoup = "org.jsoup:jsoup:1.14.3"
junit = "junit:junit:4.13.2"
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "org-junit-jupiter" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "org-junit-jupiter" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "org-junit-jupiter" }
junit-platform-console = "org.junit.platform:junit-platform-console:1.7.2"
junit-vintage-engine = "org.junit.vintage:junit-vintage-engine:5.8.2"
junit5android-core = { module = "de.mannodermaus.junit5:android-test-core", version.ref = "de-mannodermaus-junit5" }
junit5android-runner = { module = "de.mannodermaus.junit5:android-test-runner", version.ref = "de-mannodermaus-junit5" }
kotlin-annotation-processing-gradle = { module = "org.jetbrains.kotlin:kotlin-annotation-processing-gradle", version.ref = "org-jetbrains-kotlin" }
kotlin-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "org-jetbrains-kotlin" }
kotlin-osgi-bundle = { module = "org.jetbrains.kotlin:kotlin-osgi-bundle", version.ref = "org-jetbrains-kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "org-jetbrains-kotlin" }
kotlin-scripting-compiler-embeddable = { module = "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable", version.ref = "org-jetbrains-kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "org-jetbrains-kotlin" }
kotlin-stdlib-osgi = { module = "org.jetbrains.kotlin:kotlin-osgi-bundle", version.ref = "org-jetbrains-kotlin" }
kotlin-test-annotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "org-jetbrains-kotlin" }
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "org-jetbrains-kotlin" }
kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "org-jetbrains-kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "org-jetbrains-kotlin" }
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "org-jetbrains-kotlin" }
moshiCompiler = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "com-squareup-moshi" }
openjsse = "org.openjsse:openjsse:1.1.9"
picocli = { module = "info.picocli:picocli", version.ref = "info-picocli" }
picocli-compiler = { module = "info.picocli:picocli-codegen", version.ref = "info-picocli" }
playservices-safetynet = "com.google.android.gms:play-services-safetynet:17.0.1"
puppycrawl-checkstyle = "com.puppycrawl.tools:checkstyle:9.3"
robolectric-android = "org.robolectric:android-all:12-robolectric-7732740"
signature-android-apilevel21 = "net.sf.androidscents.signature:android-api-level-21:5.0.1_r2"
squareup-moshi = { module = "com.squareup.moshi:moshi", version.ref = "com-squareup-moshi" }
squareup-moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "com-squareup-moshi" }
squareup-okio = { module = "com.squareup.okio:okio", version.ref = "com-squareup-okio" }
squareup-okio-fakefilesystem = { module = "com.squareup.okio:okio-fakefilesystem", version.ref = "com-squareup-okio" }

View File

@ -19,11 +19,11 @@ tasks.jar {
dependencies {
api(projects.okhttp)
api(projects.mockwebserver3)
api(Dependencies.junit)
api(libs.junit)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(Dependencies.assertj)
testImplementation(libs.assertj.core)
}
tasks.register<JapicmpTask>("japicmp") {

View File

@ -15,9 +15,9 @@ tasks.jar {
dependencies {
api(projects.mockwebserver3)
api(Dependencies.junit)
api(libs.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.assertj.core)
}
mavenPublishing {

View File

@ -21,12 +21,12 @@ tasks {
dependencies {
api(projects.mockwebserver3)
api(Dependencies.junit5Api)
compileOnly(Dependencies.animalSniffer)
api(libs.junit.jupiter.api)
compileOnly(libs.animalsniffer.annotations)
testRuntimeOnly(Dependencies.junit5JupiterEngine)
testImplementation(Dependencies.assertj)
testImplementation(Dependencies.kotlinJunit5)
testRuntimeOnly(libs.junit.jupiter.engine)
testImplementation(libs.assertj.core)
testImplementation(libs.kotlin.junit5)
}
mavenPublishing {

View File

@ -19,8 +19,8 @@ dependencies {
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testRuntimeOnly(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
mavenPublishing {

View File

@ -1,4 +1,5 @@
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.kotlin.incremental.ChangesCollector.Companion.getNonPrivateNames
plugins {
id("com.palantir.graal")
@ -6,11 +7,11 @@ plugins {
}
dependencies {
implementation(Dependencies.assertj)
implementation(Dependencies.junit5Api)
implementation(Dependencies.junit5JupiterEngine)
implementation(Dependencies.junitPlatformConsole)
implementation(Dependencies.okioFakeFileSystem)
implementation(libs.assertj.core)
implementation(libs.junit.jupiter.api)
implementation(libs.junit.jupiter.engine)
implementation(libs.junit.platform.console)
implementation(libs.squareup.okio.fakefilesystem)
implementation(projects.okhttp)
implementation(projects.okhttpBrotli)
@ -19,19 +20,20 @@ dependencies {
implementation(projects.okhttpSse)
implementation(projects.okhttpTestingSupport)
implementation(projects.okhttpTls)
implementation(Dependencies.assertj)
implementation(libs.assertj.core)
implementation(projects.mockwebserver3)
implementation(projects.mockwebserver)
implementation(projects.okhttpUrlconnection)
implementation(projects.mockwebserver3Junit4)
implementation(projects.mockwebserver3Junit5)
implementation(Dependencies.bndResolve)
implementation(Dependencies.junit5Api)
implementation(Dependencies.junit5JupiterParams)
implementation(libs.aqute.resolve)
implementation(libs.junit.jupiter.api)
implementation(libs.junit.jupiter.params)
implementation(libs.assertk)
implementation(Dependencies.nativeImageSvm)
implementation(libs.graalvm.nativeimage.svm)
compileOnly(Dependencies.jsr305)
compileOnly(libs.findbugs.jsr305)
}
animalsniffer {
@ -52,7 +54,7 @@ sourceSets {
graal {
mainClass("okhttp3.RunTestsKt")
outputName("ConsoleLauncher")
graalVersion(Versions.graal)
graalVersion(libs.versions.graalvm.get())
javaVersion("11")
option("--no-fallback")

View File

@ -29,14 +29,14 @@ sourceSets {
dependencies {
api(projects.okhttp)
api(projects.loggingInterceptor)
implementation(Dependencies.picocli)
implementation(Dependencies.guava)
implementation(libs.picocli)
implementation(libs.guava.jre)
kapt(Dependencies.picocliCompiler)
kapt(libs.picocli.compiler)
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.junit5Api)
testImplementation(Dependencies.assertj)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.assertj.core)
}
tasks.shadowJar {
@ -46,7 +46,7 @@ tasks.shadowJar {
graal {
mainClass("okhttp3.curl.Main")
outputName("okcurl")
graalVersion(Versions.graal)
graalVersion(libs.versions.graalvm.get())
javaVersion("11")
option("--no-fallback")

View File

@ -15,13 +15,13 @@ project.applyOsgi(
dependencies {
api(projects.okhttp)
api(Dependencies.brotli)
compileOnly(Dependencies.jsr305)
api(libs.brotli.dec)
compileOnly(libs.findbugs.jsr305)
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.conscrypt)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.conscrypt.openjdk)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
mavenPublishing {

View File

@ -15,15 +15,15 @@ project.applyOsgi(
dependencies {
api(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(libs.findbugs.jsr305)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.okioFakeFileSystem)
testImplementation(Dependencies.conscrypt)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.squareup.okio.fakefilesystem)
testImplementation(libs.conscrypt.openjdk)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
mavenPublishing {

View File

@ -3,11 +3,11 @@ plugins {
}
dependencies {
testImplementation(Dependencies.okio)
testImplementation(Dependencies.moshi)
testImplementation(libs.squareup.okio)
testImplementation(libs.squareup.moshi)
testImplementation(projects.okhttp)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}

View File

@ -18,15 +18,15 @@ project.applyOsgi(
dependencies {
api(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(libs.findbugs.jsr305)
testCompileOnly(Dependencies.jsr305)
testImplementation(Dependencies.junit)
testCompileOnly(libs.findbugs.jsr305)
testImplementation(libs.junit)
testImplementation(projects.mockwebserver3)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(Dependencies.assertj)
testImplementation(libs.assertj.core)
}
tasks.register<JapicmpTask>("japicmp") {

View File

@ -18,14 +18,14 @@ project.applyOsgi(
dependencies {
api(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(libs.findbugs.jsr305)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver3)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testCompileOnly(Dependencies.jsr305)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
testCompileOnly(libs.findbugs.jsr305)
}
tasks.register<JapicmpTask>("japicmp") {

View File

@ -6,19 +6,21 @@ plugins {
dependencies {
api(projects.okhttp)
api(projects.okhttpTls)
api(Dependencies.assertj)
api(Dependencies.bouncycastle)
implementation(Dependencies.bouncycastlepkix)
implementation(Dependencies.bouncycastletls)
api(Dependencies.conscrypt)
api(Dependencies.corretto)
api(Dependencies.openjsse)
api(Dependencies.hamcrest)
api(Dependencies.junit5Api)
api(Dependencies.junit5JupiterParams)
api(libs.assertj.core)
api(libs.bouncycastle.bcprov)
implementation(libs.bouncycastle.bcpkix)
implementation(libs.bouncycastle.bctls)
api(libs.conscrypt.openjdk)
api(libs.openjsse)
api(variantOf(libs.amazon.corretto) {
classifier("linux-x86_64")
})
api(libs.hamcrest.library)
api(libs.junit.jupiter.api)
api(libs.junit.jupiter.params)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.android)
compileOnly(libs.findbugs.jsr305)
compileOnly(libs.robolectric.android)
}
animalsniffer {

View File

@ -18,15 +18,15 @@ project.applyOsgi(
)
dependencies {
api(Dependencies.okio)
api(libs.squareup.okio)
implementation(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.animalSniffer)
compileOnly(libs.findbugs.jsr305)
compileOnly(libs.animalsniffer.annotations)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
animalsniffer {

View File

@ -19,14 +19,14 @@ project.applyOsgi(
dependencies {
api(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.animalSniffer)
compileOnly(libs.findbugs.jsr305)
compileOnly(libs.animalsniffer.annotations)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(projects.mockwebserver)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
tasks.register<JapicmpTask>("japicmp") {

View File

@ -40,14 +40,14 @@ kotlin {
commonMain {
kotlin.srcDir("$buildDir/generated/sources/kotlinTemplates")
dependencies {
api(Dependencies.okio)
api(libs.squareup.okio)
}
}
val commonTest by getting {
dependencies {
implementation(Dependencies.kotlinTest)
implementation(Dependencies.kotlinTestAnnotations)
implementation(Dependencies.assertk)
implementation(libs.kotlin.test.common)
implementation(libs.kotlin.test.annotations)
api(libs.assertk)
}
}
val nonJvmMain = create("nonJvmMain") {
@ -63,20 +63,20 @@ kotlin {
getByName("jvmMain") {
dependencies {
api(Dependencies.okio)
api(Dependencies.kotlinStdlib)
api(libs.squareup.okio)
api(libs.kotlin.stdlib)
// These compileOnly dependencies must also be listed in the OSGi configuration above.
compileOnly(Dependencies.android)
compileOnly(Dependencies.bouncycastle)
compileOnly(Dependencies.bouncycastletls)
compileOnly(Dependencies.conscrypt)
compileOnly(Dependencies.openjsse)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.animalSniffer)
compileOnly(libs.robolectric.android)
compileOnly(libs.bouncycastle.bcprov)
compileOnly(libs.bouncycastle.bctls)
compileOnly(libs.conscrypt.openjdk)
compileOnly(libs.openjsse)
compileOnly(libs.findbugs.jsr305)
compileOnly(libs.animalsniffer.annotations)
// graal build support
compileOnly(Dependencies.nativeImageSvm)
compileOnly(libs.graalvm.nativeimage.svm)
}
}
getByName("jvmTest") {
@ -93,30 +93,30 @@ kotlin {
implementation(projects.okhttpBrotli)
implementation(projects.okhttpDnsoverhttps)
implementation(projects.okhttpSse)
implementation(Dependencies.okioFakeFileSystem)
implementation(Dependencies.conscrypt)
implementation(Dependencies.junit)
implementation(Dependencies.junit5Api)
implementation(Dependencies.junit5JupiterParams)
implementation(Dependencies.kotlinTestJunit)
implementation(Dependencies.assertj)
implementation(Dependencies.openjsse)
implementation(Dependencies.bndResolve)
compileOnly(Dependencies.jsr305)
implementation(libs.squareup.okio.fakefilesystem)
implementation(libs.conscrypt.openjdk)
implementation(libs.junit)
implementation(libs.junit.jupiter.api)
implementation(libs.junit.jupiter.params)
implementation(libs.kotlin.test.junit)
implementation(libs.assertj.core)
implementation(libs.openjsse)
implementation(libs.aqute.resolve)
compileOnly(libs.findbugs.jsr305)
}
getByName("jsMain") {
dependencies {
dependsOn(nonJvmMain)
api(Dependencies.okio)
api(Dependencies.kotlinStdlib)
api(libs.squareup.okio)
api(libs.kotlin.stdlib)
}
}
getByName("jsTest") {
dependencies {
dependsOn(nonJvmTest)
implementation(Dependencies.kotlinTestJs)
implementation(libs.kotlin.test.js)
}
}
}
@ -180,8 +180,8 @@ tasks.getByName("jvmTest") {
}
dependencies {
osgiTestDeploy(Dependencies.equinox)
osgiTestDeploy(Dependencies.kotlinStdlibOsgi)
osgiTestDeploy(libs.equinox)
osgiTestDeploy(libs.kotlin.stdlib.osgi)
}
tasks.register<JapicmpTask>("japicmp") {

View File

@ -36,18 +36,18 @@ android {
dependencies {
val okhttpLegacyVersion = "3.12.12"
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.playServicesSafetynet)
implementation(libs.kotlin.reflect)
implementation(libs.playservices.safetynet)
implementation("com.squareup.okhttp3:okhttp:${okhttpLegacyVersion}")
implementation("com.squareup.okhttp3:okhttp-tls:${okhttpLegacyVersion}") {
exclude("org.bouncycastle")
}
androidTestImplementation("com.squareup.okhttp3:mockwebserver:${okhttpLegacyVersion}")
androidTestImplementation(Dependencies.bouncycastle)
androidTestImplementation(Dependencies.bouncycastletls)
androidTestImplementation(Dependencies.androidxExtJunit)
androidTestImplementation(Dependencies.androidxEspressoCore)
androidTestImplementation(Dependencies.httpclient5)
androidTestImplementation(Dependencies.moshi)
androidTestImplementation(Dependencies.moshiKotlin)
androidTestImplementation(libs.bouncycastle.bcprov)
androidTestImplementation(libs.bouncycastle.bctls)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.httpcomponents.httpclient5)
androidTestImplementation(libs.squareup.moshi)
androidTestImplementation(libs.squareup.moshi.kotlin)
}

View File

@ -8,10 +8,10 @@ dependencies {
testRuntimeOnly(projects.mockwebserver3Junit5)
testImplementation(projects.okhttpTls)
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.httpclient5)
testImplementation(Dependencies.jettyClient)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testImplementation(libs.httpcomponents.httpclient5)
testImplementation(libs.jetty.client)
testImplementation(libs.junit)
testImplementation(libs.assertj.core)
}
tasks.compileJava {

View File

@ -9,7 +9,7 @@ application {
dependencies {
implementation(projects.okhttp)
implementation(Dependencies.jsoup)
implementation(libs.jsoup)
}
tasks.compileJava {

View File

@ -8,9 +8,9 @@ dependencies {
implementation(projects.mockwebserver)
implementation(projects.okhttpTestingSupport)
implementation(projects.okhttpTls)
implementation(Dependencies.animalSniffer)
implementation(Dependencies.moshi)
kapt(Dependencies.moshiCompiler)
implementation(libs.animalsniffer.annotations)
implementation(libs.squareup.moshi)
kapt(libs.moshiCompiler)
}
java {

View File

@ -4,5 +4,5 @@ plugins {
dependencies {
implementation(projects.okhttp)
implementation(Dependencies.moshi)
implementation(libs.squareup.moshi)
}

View File

@ -4,5 +4,5 @@ plugins {
dependencies {
implementation(projects.mockwebserver)
implementation(Dependencies.moshi)
implementation(libs.squareup.moshi)
}

View File

@ -5,5 +5,5 @@ plugins {
dependencies {
implementation(projects.okhttp)
implementation(projects.mockwebserver)
implementation(Dependencies.jnrUnixsocket)
implementation(libs.jnr.unixsocket)
}