Skip to content

Commit

Permalink
[build] update to latest dependencies (#1495)
Browse files Browse the repository at this point in the history
### 📝 Description

Update to the latest dependencies. 

Fixed duplicate publication from `graphql-kotlin-gradle-plugin` - this was a warning before but latest version of `com.gradle.plugin-publish` treats it as a failure

NOTE: I did not update project to Kotlin v1.7 as I think that as a library we should target older version to allow for largest adoption.

### 🔗 Related Issues
  • Loading branch information
dariuszkuc authored Aug 2, 2022
1 parent 7711942 commit 96f85a8
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 56 deletions.
17 changes: 10 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ subprojects {
sourceCompatibility = JavaVersion.VERSION_1_8
}

// published artifacts
// published sources and javadoc artifacts
val jarComponent = currentProject.components.getByName("java")
val sourcesJar by registering(Jar::class) {
archiveClassifier.set("sources")
Expand Down Expand Up @@ -149,12 +149,15 @@ subprojects {
}
}
}
create<MavenPublication>("mavenJava") {
from(jarComponent)
artifact(sourcesJar.get())
// no need to publish javadocs for SNAPSHOT builds
if (rootProject.extra["isReleaseVersion"] as Boolean) {
artifact(javadocJar.get())
// com.gradle.plugin-publish creates publication automatically
if (currentProject.name != "graphql-kotlin-gradle-plugin") {
create<MavenPublication>("mavenJava") {
from(jarComponent)
artifact(sourcesJar.get())
// no need to publish javadocs for SNAPSHOT builds
if (rootProject.extra["isReleaseVersion"] as Boolean) {
artifact(javadocJar.get())
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Expedia, Inc
* Copyright 2022 Expedia, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -58,7 +58,10 @@ class FlowSubscriptionExecutionStrategy(dfe: DataFetcherExceptionHandler) : Exec
val instrumentation = executionContext.instrumentation
val instrumentationParameters = InstrumentationExecutionStrategyParameters(executionContext, parameters)
val executionStrategyCtx = ExecutionStrategyInstrumentationContext.nonNullCtx(
instrumentation.beginExecutionStrategy(instrumentationParameters, executionContext.instrumentationState)
instrumentation.beginExecutionStrategy(
instrumentationParameters,
executionContext.instrumentationState
)
)

val sourceEventStream = createSourceEventStream(executionContext, parameters)
Expand Down Expand Up @@ -147,7 +150,9 @@ class FlowSubscriptionExecutionStrategy(dfe: DataFetcherExceptionHandler) : Exec

val i13nFieldParameters = InstrumentationFieldParameters(executionContext) { subscribedFieldStepInfo }
val subscribedFieldCtx = SimpleInstrumentationContext.nonNullCtx(
instrumentation.beginSubscribedFieldEvent(i13nFieldParameters, executionContext.instrumentationState)
instrumentation.beginSubscribedFieldEvent(
i13nFieldParameters, executionContext.instrumentationState
)
)

val fetchedValue = unboxPossibleDataFetcherResult(newExecutionContext, parameters, eventPayload)
Expand All @@ -162,12 +167,12 @@ class FlowSubscriptionExecutionStrategy(dfe: DataFetcherExceptionHandler) : Exec
overallResult.whenComplete(subscribedFieldCtx::onCompleted)

// allow them to instrument each ER should they want to
val i13ExecutionParameters = InstrumentationExecutionParameters(
val i13nExecutionParameters = InstrumentationExecutionParameters(
executionContext.executionInput, executionContext.graphQLSchema, executionContext.instrumentationState
)

return overallResult.thenCompose { executionResult ->
instrumentation.instrumentExecutionResult(executionResult, i13ExecutionParameters, executionContext.instrumentationState)
instrumentation.instrumentExecutionResult(executionResult, i13nExecutionParameters, executionContext.instrumentationState)
}
}

Expand Down
36 changes: 21 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,46 @@ org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError
# dependencies
kotlinJvmVersion = 1.8
kotlinVersion = 1.6.21
kotlinCoroutinesVersion = 1.6.1
kotlinCoroutinesVersion = 1.6.4
# kotlinx-serialization 1.3.3 calls Kotlin 1.7 API
kotlinxSerializationVersion = 1.3.2

androidPluginVersion = 7.1.2
classGraphVersion = 4.8.143
federationGraphQLVersion = 0.9.0
classGraphVersion = 4.8.149
federationGraphQLVersion = 2.0.4
graphQLJavaVersion = 19.0
graphQLJavaDataLoaderVersion = 3.2.0
jacksonVersion = 2.13.2
jacksonVersion = 2.13.3
# KotlinPoet v1.12.0+ requires Kotlin v1.7
kotlinPoetVersion = 1.11.0
ktorVersion = 2.0.0
reactorVersion = 3.4.18
reactorExtensionsVersion = 1.1.6
ktorVersion = 2.0.3
reactorVersion = 3.4.21
reactorExtensionsVersion = 1.1.7
slf4jVersion = 1.7.36
springBootVersion = 2.7.0
springVersion = 5.3.20
springBootVersion = 2.7.2
springVersion = 5.3.22

# test dependency versions
# kotlin-compile-testing has to be using the same kotlin version as the kotlinx-serialization compiler
# kotlin-compile-testing v1.4.9+ requires Kotlin v1.7
compileTestingVersion = 1.4.8
icuVersion=71.1
junitVersion = 5.8.2
mockkVersion = 1.12.3
# mockk v1.12.5+ requires Kotlin 1.7
mockkVersion = 1.12.4
mustacheVersion = 0.9.10
rxjavaVersion = 3.1.4
wireMockVersion = 2.32.0
kotlinxBenchmarkVersion = 0.4.2
rxjavaVersion = 3.1.5
wireMockVersion = 2.33.2
kotlinxBenchmarkVersion = 0.4.4

# plugin versions
detektVersion = 1.19.0
detektVersion = 1.21.0
dokkaVersion = 1.6.10
jacocoVersion = 0.8.8
# ktlint v0.46.0+ requires Kotlin 1.7
ktlintVersion = 0.45.2
ktlintPluginVersion = 10.2.1
ktlintPluginVersion = 10.3.0
mavenPluginDevelopmentVersion = 0.4.0
nexusPublishPluginVersion = 1.1.0
pluginPublishPluginVersion = 0.21.0
# pluginPublishPluginVersion = 1.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
45 changes: 24 additions & 21 deletions plugins/graphql-kotlin-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
}

java {
withSourcesJar()
if (rootProject.extra["isReleaseVersion"] as Boolean) {
withJavadocJar()
}
}

gradlePlugin {
plugins {
register("graphQLPlugin") {
id = "com.expediagroup.graphql"
displayName = "GraphQL Kotlin Gradle Plugin"
description = "Gradle Plugin that can generate type-safe GraphQL Kotlin client and GraphQL schema in SDL format using reflections"
implementationClass = "com.expediagroup.graphql.plugin.gradle.GraphQLGradlePlugin"
}
}
Expand All @@ -37,14 +46,7 @@ gradlePlugin {
pluginBundle {
website = "https://expediagroup.github.io/graphql-kotlin"
vcsUrl = "https://github.com/ExpediaGroup/graphql-kotlin"

(plugins) {
"graphQLPlugin" {
displayName = "GraphQL Kotlin Gradle Plugin"
description = "Gradle Plugin that can generate type-safe GraphQL Kotlin client and GraphQL schema in SDL format using reflections"
tags = listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl")
}
}
tags = listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl")
}

sourceSets {
Expand Down Expand Up @@ -84,19 +86,6 @@ tasks {
System.setProperty("gradle.publish.secret", System.getenv("PLUGIN_PORTAL_SECRET"))
}
}
publishing {
publications {
afterEvaluate {
named<MavenPublication>("graphQLPluginPluginMarkerMaven") {
// update auto-generated pom.xml for plugin marker with required information
pom {
name.set(artifactId)
description.set("Plugin descriptor for GraphQL Kotlin Gradle plugin")
}
}
}
}
}
test {
// ensure we always run tests by setting new inputs
//
Expand All @@ -115,4 +104,18 @@ tasks {
systemProperty("springBootVersion", springBootVersion)
systemProperty("junitVersion", junitVersion)
}

publishing {
afterEvaluate {
publications {
named<MavenPublication>("graphQLPluginPluginMarkerMaven") {
// update auto-generated pom.xml for plugin marker with required information
pom {
name.set(artifactId)
description.set("Plugin descriptor for GraphQL Kotlin Gradle plugin")
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ class GraphQLGenerateClientIT {
.withPluginClasspath()
.withArguments(
"build",
"--stacktrace",
"-PGRAPHQL_KOTLIN_VERSION=$DEFAULT_PLUGIN_VERSION",
"-PKOTLIN_VERSION=$kotlinVersion",
"-PJUNIT_VERSION=$junitVersion",
"-PMOCKK_VERSION=$mockkVersion"
"--stacktrace"
)
.withEnvironment(
mapOf(
"GRAPHQL_KOTLIN_VERSION" to DEFAULT_PLUGIN_VERSION,
"KOTLIN_VERSION" to kotlinVersion,
"JUNIT_VERSION" to junitVersion,
"MOCKK_VERSION" to mockkVersion
)
)
.forwardOutput()
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ class GraphQLGradlePluginAndroidIT {
val buildResult = GradleRunner.create()
.withProjectDir(testProjectDirectory)
.withPluginClasspath()
.withArguments("build", "--stacktrace", "-PGRAPHQL_KOTLIN_VERSION=$DEFAULT_PLUGIN_VERSION", "-PKOTLIN_VERSION=$kotlinVersion", "-PANDROID_PLUGIN_VERSION=$androidPluginVersion")
.withArguments(
"build",
"--stacktrace"
)
.withEnvironment(
mapOf(
"GRAPHQL_KOTLIN_VERSION" to DEFAULT_PLUGIN_VERSION,
"KOTLIN_VERSION" to kotlinVersion,
"ANDROID_PLUGIN_VERSION" to androidPluginVersion,
"ANDROID_SDK_ROOT" to System.getenv("ANDROID_SDK_ROOT")
)
)
.forwardOutput()
.build()

Expand Down

0 comments on commit 96f85a8

Please sign in to comment.