Skip to content

Commit

Permalink
build: use typesafe project accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszkuc committed Jan 13, 2023
1 parent 381673e commit b1a2d53
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion clients/graphql-kotlin-client-jackson/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client"))
api(projects.graphqlKotlinClient)
api(libs.jackson)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client"))
api(projects.graphqlKotlinClient)
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.json)
}
Expand Down
6 changes: 3 additions & 3 deletions clients/graphql-kotlin-ktor-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client"))
api(project(path = ":graphql-kotlin-client-serialization"))
api(projects.graphqlKotlinClient)
api(projects.graphqlKotlinClientSerialization)
api(libs.ktor.client.cio)
api(libs.ktor.client.serialization)
testImplementation(project(path = ":graphql-kotlin-client-jackson"))
testImplementation(projects.graphqlKotlinClientJackson)
testImplementation(libs.ktor.client.logging)
testImplementation(libs.ktor.client.okhttp)
testImplementation(libs.wiremock.jre8)
Expand Down
6 changes: 3 additions & 3 deletions clients/graphql-kotlin-spring-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client"))
api(project(path = ":graphql-kotlin-client-jackson"))
api(projects.graphqlKotlinClient)
api(projects.graphqlKotlinClientJackson)
api(libs.kotlinx.coroutines.reactor)
api(libs.spring.webflux)
api(libs.spring.boot.netty)
testImplementation(project(path = ":graphql-kotlin-client-serialization"))
testImplementation(projects.graphqlKotlinClientSerialization)
testImplementation(libs.wiremock.jre8)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-dataloader"))
api(projects.graphqlKotlinDataloader)
api(libs.graphql.java) {
exclude(group = "com.graphql-java", module = "java-dataloader")
}
Expand Down
2 changes: 1 addition & 1 deletion generator/graphql-kotlin-federation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-schema-generator"))
api(projects.graphqlKotlinSchemaGenerator)
api(libs.federation)
testImplementation(libs.reactor.core)
testImplementation(libs.reactor.extensions)
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dataloader = { group = "com.graphql-java", name = "java-dataloader", version.ref
federation = { group = "com.apollographql.federation", name = "federation-graphql-java-support", version.ref = "federation" }
graphql-java = { group = "com.graphql-java", name = "graphql-java", version.ref = "graphql-java" }
jackson = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version.ref = "jackson" }
kotlin-gradle-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
kotlin-serialization = { group = "org.jetbrains.kotlin", name = "kotlin-serialization", version.ref= "kotlin" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client"))
api(projects.graphqlKotlinClient)
api(libs.graphql.java) {
exclude(group = "com.graphql-java", module = "java-dataloader")
}
Expand All @@ -19,8 +19,8 @@ dependencies {
}
implementation(libs.ktor.client.content)
implementation(libs.slf4j)
testImplementation(project(path = ":graphql-kotlin-client-jackson"))
testImplementation(project(path = ":graphql-kotlin-client-serialization"))
testImplementation(projects.graphqlKotlinClientJackson)
testImplementation(projects.graphqlKotlinClientSerialization)
testImplementation(libs.wiremock.jre8)
testImplementation(libs.compile.testing)
testImplementation(libs.icu)
Expand Down
6 changes: 3 additions & 3 deletions plugins/graphql-kotlin-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ plugins {
}

dependencies {
implementation(kotlin("gradle-plugin-api"))
implementation(libs.kotlin.gradle.api)
compileOnly(libs.android.plugin)

compileOnly(project(":graphql-kotlin-client-generator"))
compileOnly(project(":graphql-kotlin-sdl-generator"))
compileOnly(projects.graphqlKotlinClientGenerator)
compileOnly(projects.graphqlKotlinSdlGenerator)

testImplementation(libs.wiremock.jre8)
testImplementation(libs.mustache)
Expand Down
8 changes: 4 additions & 4 deletions plugins/graphql-kotlin-maven-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-client-generator"))
api(project(path = ":graphql-kotlin-sdl-generator"))
api(projects.graphqlKotlinClientGenerator)
api(projects.graphqlKotlinSdlGenerator)
api(libs.kotlinx.coroutines.core)
implementation(libs.maven.plugin.annotations)
implementation(libs.maven.plugin.api)
implementation(libs.maven.project)
testImplementation(project(path = ":graphql-kotlin-spring-server"))
testImplementation(project(path = ":graphql-kotlin-federated-hooks-provider"))
testImplementation(projects.graphqlKotlinSpringServer)
testImplementation(projects.graphqlKotlinFederatedHooksProvider)
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ plugins {
}

dependencies {
implementation(project(":graphql-kotlin-federation"))
implementation(project(":graphql-kotlin-hooks-provider"))
implementation(projects.graphqlKotlinFederation)
implementation(projects.graphqlKotlinHooksProvider)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ plugins {
}

dependencies {
implementation(project(":graphql-kotlin-schema-generator"))
implementation(projects.graphqlKotlinSchemaGenerator)
}
8 changes: 4 additions & 4 deletions plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
}

dependencies {
implementation(project(path = ":graphql-kotlin-hooks-provider"))
implementation(project(path = ":graphql-kotlin-server"))
implementation(project(path = ":graphql-kotlin-federation"))
implementation(projects.graphqlKotlinHooksProvider)
implementation(projects.graphqlKotlinServer)
implementation(projects.graphqlKotlinFederation)
implementation(libs.classgraph)
implementation(libs.slf4j)
testImplementation(project(path = ":graphql-kotlin-spring-server"))
testImplementation(projects.graphqlKotlinSpringServer)
}

sourceSets {
Expand Down
6 changes: 3 additions & 3 deletions servers/graphql-kotlin-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-schema-generator"))
api(project(path = ":graphql-kotlin-dataloader-instrumentation"))
api(project(path = ":graphql-kotlin-automatic-persisted-queries"))
api(projects.graphqlKotlinSchemaGenerator)
api(projects.graphqlKotlinDataloaderInstrumentation)
api(projects.graphqlKotlinAutomaticPersistedQueries)
api(libs.jackson)
testImplementation(libs.kotlinx.coroutines.test)
}
Expand Down
4 changes: 2 additions & 2 deletions servers/graphql-kotlin-spring-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
}

dependencies {
api(project(path = ":graphql-kotlin-server"))
api(project(path = ":graphql-kotlin-federation"))
api(projects.graphqlKotlinServer)
api(projects.graphqlKotlinFederation)
api(libs.spring.boot.webflux)
api(libs.kotlinx.coroutines.jdk8)
api(libs.kotlinx.coroutines.reactor)
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
rootProject.name = "graphql-kotlin"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

// Clients
include(":graphql-kotlin-client")
include(":graphql-kotlin-client-serialization")
Expand Down Expand Up @@ -27,6 +29,7 @@ include(":graphql-kotlin-spring-server")
include(":graphql-kotlin-dataloader")
include(":graphql-kotlin-dataloader-instrumentation")
include(":graphql-kotlin-automatic-persisted-queries")

//
// Project mappings so we don't need to create projects that group subprojects
//
Expand Down

0 comments on commit b1a2d53

Please sign in to comment.