Skip to content

Commit

Permalink
Enable Gradle's type-safe project accessors (square#7069)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored Feb 8, 2022
1 parent fca8ebb commit f5758b7
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 90 deletions.
18 changes: 9 additions & 9 deletions android-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ android {
dependencies {
implementation(Dependencies.kotlinReflect)
implementation(Dependencies.playServicesSafetynet)
implementation(project(":okhttp"))
implementation(projects.okhttp)

androidTestImplementation(project(":okhttp-testing-support")) {
androidTestImplementation(projects.okhttpTestingSupport) {
exclude("org.openjsse", "openjsse")
exclude("org.conscrypt", "conscrypt-openjdk-uber")
exclude("software.amazon.cryptools", "AmazonCorrettoCryptoProvider")
}
androidTestImplementation(Dependencies.bouncycastle)
androidTestImplementation(Dependencies.bouncycastletls)
androidTestImplementation(Dependencies.conscryptAndroid)
androidTestImplementation(project(":mockwebserver3-junit5"))
androidTestImplementation(project(":okhttp-brotli"))
androidTestImplementation(project(":okhttp-dnsoverhttps"))
androidTestImplementation(project(":logging-interceptor"))
androidTestImplementation(project(":okhttp-sse"))
androidTestImplementation(project(":okhttp-testing-support"))
androidTestImplementation(project(":okhttp-tls"))
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)
Expand Down
8 changes: 4 additions & 4 deletions mockwebserver-deprecated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ tasks.jar {
}

dependencies {
api(project(":okhttp"))
api(project(":mockwebserver3"))
api(projects.okhttp)
api(projects.mockwebserver3)
api(Dependencies.junit)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":okhttp-tls"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(Dependencies.assertj)
}

Expand Down
2 changes: 1 addition & 1 deletion mockwebserver-junit4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tasks.jar {
}

dependencies {
api(project(":mockwebserver3"))
api(projects.mockwebserver3)
api(Dependencies.junit)

testImplementation(Dependencies.assertj)
Expand Down
2 changes: 1 addition & 1 deletion mockwebserver-junit5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tasks {
}

dependencies {
api(project(":mockwebserver3"))
api(projects.mockwebserver3)
api(Dependencies.junit5Api)
compileOnly(Dependencies.animalSniffer)

Expand Down
8 changes: 4 additions & 4 deletions mockwebserver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ tasks.jar {
}

dependencies {
api(project(":okhttp"))
api(projects.okhttp)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":okhttp-tls"))
testRuntimeOnly(project(":mockwebserver3-junit5"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testRuntimeOnly(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
}
Expand Down
24 changes: 12 additions & 12 deletions native-image-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ dependencies {
implementation(Dependencies.junitPlatformConsole)
implementation(Dependencies.okioFakeFileSystem)

implementation(project(":okhttp"))
implementation(project(":okhttp-brotli"))
implementation(project(":okhttp-dnsoverhttps"))
implementation(project(":logging-interceptor"))
implementation(project(":okhttp-sse"))
implementation(project(":okhttp-testing-support"))
implementation(project(":okhttp-tls"))
implementation(projects.okhttp)
implementation(projects.okhttpBrotli)
implementation(projects.okhttpDnsoverhttps)
implementation(projects.loggingInterceptor)
implementation(projects.okhttpSse)
implementation(projects.okhttpTestingSupport)
implementation(projects.okhttpTls)
implementation(Dependencies.assertj)
implementation(project(":mockwebserver3"))
implementation(project(":mockwebserver"))
implementation(project(":okhttp-urlconnection"))
implementation(project(":mockwebserver3-junit4"))
implementation(project(":mockwebserver3-junit5"))
implementation(projects.mockwebserver3)
implementation(projects.mockwebserver)
implementation(projects.okhttpUrlconnection)
implementation(projects.mockwebserver3Junit4)
implementation(projects.mockwebserver3Junit5)
implementation(Dependencies.bndResolve)
implementation(Dependencies.junit5Api)
implementation(Dependencies.junit5JupiterParams)
Expand Down
6 changes: 3 additions & 3 deletions okcurl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ sourceSets {
}

dependencies {
api(project(":okhttp"))
api(project(":logging-interceptor"))
api(projects.okhttp)
api(projects.loggingInterceptor)
implementation(Dependencies.picocli)
implementation(Dependencies.guava)

kapt(Dependencies.picocliCompiler)

testImplementation(project(":okhttp-testing-support"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.junit5Api)
testImplementation(Dependencies.assertj)
}
Expand Down
4 changes: 2 additions & 2 deletions okhttp-brotli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ project.applyOsgi(
)

dependencies {
api(project(":okhttp"))
api(projects.okhttp)
api(Dependencies.brotli)
compileOnly(Dependencies.jsr305)

testImplementation(project(":okhttp-testing-support"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.conscrypt)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
Expand Down
8 changes: 4 additions & 4 deletions okhttp-dnsoverhttps/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ project.applyOsgi(
)

dependencies {
api(project(":okhttp"))
api(projects.okhttp)
compileOnly(Dependencies.jsr305)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":mockwebserver"))
testImplementation(project(":mockwebserver3-junit5"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.okioFakeFileSystem)
testImplementation(Dependencies.conscrypt)
testImplementation(Dependencies.junit)
Expand Down
6 changes: 3 additions & 3 deletions okhttp-hpacktests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ plugins {
dependencies {
testImplementation(Dependencies.okio)
testImplementation(Dependencies.moshi)
testImplementation(project(":okhttp"))
testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":mockwebserver"))
testImplementation(projects.okhttp)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
}
10 changes: 5 additions & 5 deletions okhttp-logging-interceptor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ project.applyOsgi(
)

dependencies {
api(project(":okhttp"))
api(projects.okhttp)
compileOnly(Dependencies.jsr305)

testCompileOnly(Dependencies.jsr305)
testImplementation(Dependencies.junit)
testImplementation(project(":mockwebserver3"))
testImplementation(project(":mockwebserver3-junit5"))
testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":okhttp-tls"))
testImplementation(projects.mockwebserver3)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(Dependencies.assertj)
}

Expand Down
8 changes: 4 additions & 4 deletions okhttp-sse/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ project.applyOsgi(
)

dependencies {
api(project(":okhttp"))
api(projects.okhttp)
compileOnly(Dependencies.jsr305)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":mockwebserver3"))
testImplementation(project(":mockwebserver3-junit5"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver3)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
testCompileOnly(Dependencies.jsr305)
Expand Down
4 changes: 2 additions & 2 deletions okhttp-testing-support/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
}

dependencies {
api(project(":okhttp"))
api(project(":okhttp-tls"))
api(projects.okhttp)
api(projects.okhttpTls)
api(Dependencies.assertj)
api(Dependencies.bouncycastle)
implementation(Dependencies.bouncycastlepkix)
Expand Down
6 changes: 3 additions & 3 deletions okhttp-tls/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ project.applyOsgi(

dependencies {
api(Dependencies.okio)
implementation(project(":okhttp"))
implementation(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.animalSniffer)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":mockwebserver3-junit5"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.mockwebserver3Junit5)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
}
Expand Down
12 changes: 5 additions & 7 deletions okhttp-urlconnection/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@ plugins {
id("me.champeau.gradle.japicmp")
}

val mainProj: Project by lazy { project(":okhttp") }

project.applyOsgi(
"Fragment-Host: com.squareup.okhttp3; bundle-version=\"\${range;[==,+);\${version_cleanup;${mainProj.version}}}\"",
"Fragment-Host: com.squareup.okhttp3; bundle-version=\"\${range;[==,+);\${version_cleanup;${projects.okhttp.version}}}\"",
"Automatic-Module-Name: okhttp3.urlconnection",
"Bundle-SymbolicName: com.squareup.okhttp3.urlconnection",
"-removeheaders: Private-Package"
)

dependencies {
api(mainProj)
api(projects.okhttp)
compileOnly(Dependencies.jsr305)
compileOnly(Dependencies.animalSniffer)

testImplementation(project(":okhttp-testing-support"))
testImplementation(project(":okhttp-tls"))
testImplementation(project(":mockwebserver"))
testImplementation(projects.okhttpTestingSupport)
testImplementation(projects.okhttpTls)
testImplementation(projects.mockwebserver)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.assertj)
}
Expand Down
22 changes: 11 additions & 11 deletions okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ kotlin {
getByName("jvmTest") {
dependencies {
dependsOn(commonTest)
implementation(project(":okhttp-testing-support"))
implementation(project(":okhttp-tls"))
implementation(project(":okhttp-urlconnection"))
implementation(project(":mockwebserver3"))
implementation(project(":mockwebserver3-junit4"))
implementation(project(":mockwebserver3-junit5"))
implementation(project(":mockwebserver"))
implementation(project(":logging-interceptor"))
implementation(project(":okhttp-brotli"))
implementation(project(":okhttp-dnsoverhttps"))
implementation(project(":okhttp-sse"))
implementation(projects.okhttpTestingSupport)
implementation(projects.okhttpTls)
implementation(projects.okhttpUrlconnection)
implementation(projects.mockwebserver3)
implementation(projects.mockwebserver3Junit4)
implementation(projects.mockwebserver3Junit5)
implementation(projects.mockwebserver)
implementation(projects.loggingInterceptor)
implementation(projects.okhttpBrotli)
implementation(projects.okhttpDnsoverhttps)
implementation(projects.okhttpSse)
implementation(Dependencies.okioFakeFileSystem)
implementation(Dependencies.conscrypt)
implementation(Dependencies.junit)
Expand Down
10 changes: 5 additions & 5 deletions samples/compare/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ plugins {
}

dependencies {
testImplementation(project(":okhttp"))
testImplementation(project(":mockwebserver3"))
testRuntimeOnly(project(":mockwebserver3-junit5"))
testImplementation(project(":okhttp-tls"))
testImplementation(project(":okhttp-testing-support"))
testImplementation(projects.okhttp)
testImplementation(projects.mockwebserver3)
testRuntimeOnly(projects.mockwebserver3Junit5)
testImplementation(projects.okhttpTls)
testImplementation(projects.okhttpTestingSupport)
testImplementation(Dependencies.httpclient5)
testImplementation(Dependencies.jettyClient)
testImplementation(Dependencies.junit)
Expand Down
2 changes: 1 addition & 1 deletion samples/crawler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ application {
}

dependencies {
implementation(project(":okhttp"))
implementation(projects.okhttp)
implementation(Dependencies.jsoup)
}

Expand Down
8 changes: 4 additions & 4 deletions samples/guide/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ plugins {
}

dependencies {
implementation(project(":okhttp"))
implementation(project(":mockwebserver"))
implementation(project(":okhttp-testing-support"))
implementation(project(":okhttp-tls"))
implementation(projects.okhttp)
implementation(projects.mockwebserver)
implementation(projects.okhttpTestingSupport)
implementation(projects.okhttpTls)
implementation(Dependencies.animalSniffer)
implementation(Dependencies.moshi)
kapt(Dependencies.moshiCompiler)
Expand Down
2 changes: 1 addition & 1 deletion samples/simple-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ plugins {
}

dependencies {
implementation(project(":okhttp"))
implementation(projects.okhttp)
implementation(Dependencies.moshi)
}
2 changes: 1 addition & 1 deletion samples/slack/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ plugins {
}

dependencies {
implementation(project(":mockwebserver"))
implementation(projects.mockwebserver)
implementation(Dependencies.moshi)
}
2 changes: 1 addition & 1 deletion samples/static-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tasks.jar {
}

dependencies {
implementation(project(":mockwebserver"))
implementation(projects.mockwebserver)
}

tasks.shadowJar {
Expand Down
4 changes: 2 additions & 2 deletions samples/unixdomainsockets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
implementation(project(":okhttp"))
implementation(project(":mockwebserver"))
implementation(projects.okhttp)
implementation(projects.mockwebserver)
implementation(Dependencies.jnrUnixsocket)
}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ include(":samples:simple-client")
include(":samples:slack")
include(":samples:static-server")
include(":samples:unixdomainsockets")

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

0 comments on commit f5758b7

Please sign in to comment.