Skip to content

Commit e7ea357

Browse files
authored
build: update to gradle8 (#1726)
1 parent 20efff0 commit e7ea357

File tree

8 files changed

+37
-38
lines changed

8 files changed

+37
-38
lines changed

buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ tasks {
4343
jacoco {
4444
toolVersion = libs.versions.jacoco.get()
4545
}
46+
jacocoTestReport {
47+
dependsOn(test)
48+
}
4649
jar {
4750
manifest {
4851
attributes["Built-By"] = "Expedia Group"
@@ -129,7 +132,6 @@ tasks {
129132

130133
test {
131134
useJUnitPlatform()
132-
finalizedBy(jacocoTestReport)
133135
}
134136
}
135137

gradle/libs.versions.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[versions]
2-
# TODO gradle 8 upgrade -> android-plugin v8 requires gradle 8
3-
android-plugin = "8.0.0-alpha11"
2+
android-plugin = "8.0.2"
43
classgraph = "4.8.160"
54
dataloader = "3.2.0"
65
federation = "3.0.1"
@@ -49,7 +48,7 @@ jacoco = "0.8.10"
4948
# klint gradle plugin breaks with 0.46.x+
5049
ktlint-core = "0.45.2"
5150
ktlint-plugin = "10.3.0"
52-
maven-plugin-development = "0.4.1"
51+
maven-plugin-development = "0.4.2"
5352
nexus-publish-plugin = "1.3.0"
5453
plugin-publish = "1.2.0"
5554

gradle/wrapper/gradle-wrapper.jar

502 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

gradlew

+6-5
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144141
case $MAX_FD in #(
145142
max*)
146143
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
144+
# shellcheck disable=SC3045
148145
MAX_FD=$( ulimit -H -n ) ||
149146
warn "Could not query maximum file descriptor limit"
150147
esac
151148
case $MAX_FD in #(
152149
'' | soft) :;; #(
153150
*)
154151
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
152+
# shellcheck disable=SC3045
156153
ulimit -n "$MAX_FD" ||
157154
warn "Could not set maximum file descriptor limit to $MAX_FD"
158155
esac
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
197194
done
198195
fi
199196

197+
198+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200+
200201
# Collect all arguments for the java command;
201202
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202203
# shell script including quotes and variable substitutions, so put them in

plugins/graphql-kotlin-gradle-plugin/build.gradle.kts

+21-28
Original file line numberDiff line numberDiff line change
@@ -28,54 +28,47 @@ java {
2828
}
2929

3030
gradlePlugin {
31+
website.set("https://opensource.expediagroup.com/graphql-kotlin/docs/")
32+
vcsUrl.set("https://github.com/ExpediaGroup/graphql-kotlin")
3133
plugins {
3234
register("graphQLPlugin") {
3335
id = "com.expediagroup.graphql"
3436
displayName = "GraphQL Kotlin Gradle Plugin"
3537
description = "Gradle Plugin that can generate type-safe GraphQL Kotlin client and GraphQL schema in SDL format using reflections"
3638
implementationClass = "com.expediagroup.graphql.plugin.gradle.GraphQLGradlePlugin"
39+
tags.set(listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl"))
3740
}
3841
}
3942
}
4043

41-
pluginBundle {
42-
website = "https://opensource.expediagroup.com/graphql-kotlin/docs/"
43-
vcsUrl = "https://github.com/ExpediaGroup/graphql-kotlin"
44-
tags = listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl")
44+
val generateDefaultVersion by tasks.registering {
45+
val fileName = "PluginVersion.kt"
46+
val defaultVersionFile = File("$buildDir/generated/src/com/expediagroup/graphql/plugin/gradle", fileName)
47+
48+
inputs.property(fileName, project.version)
49+
outputs.dir(defaultVersionFile.parent)
50+
51+
doFirst {
52+
defaultVersionFile.parentFile.mkdirs()
53+
defaultVersionFile.writeText(
54+
"""
55+
package com.expediagroup.graphql.plugin.gradle
56+
internal const val DEFAULT_PLUGIN_VERSION = "${project.version}"
57+
58+
""".trimIndent()
59+
)
60+
}
4561
}
4662

4763
sourceSets {
4864
main {
4965
java {
50-
srcDir("$buildDir/generated/src")
66+
srcDir(generateDefaultVersion)
5167
}
5268
}
5369
}
5470

5571
tasks {
56-
val generateDefaultVersion by registering {
57-
val fileName = "PluginVersion.kt"
58-
val defaultVersionFile = File("$buildDir/generated/src/com/expediagroup/graphql/plugin/gradle", fileName)
59-
60-
inputs.property(fileName, project.version)
61-
outputs.file(defaultVersionFile)
62-
63-
doFirst {
64-
defaultVersionFile.parentFile.mkdirs()
65-
defaultVersionFile.writeText(
66-
"""
67-
package com.expediagroup.graphql.plugin.gradle
68-
internal const val DEFAULT_PLUGIN_VERSION = "${project.version}"
69-
70-
""".trimIndent()
71-
)
72-
}
73-
}
74-
75-
compileKotlin {
76-
dependsOn(generateDefaultVersion)
77-
}
78-
7972
publishPlugins {
8073
doFirst {
8174
System.setProperty("gradle.publish.key", System.getenv("PLUGIN_PORTAL_KEY"))

plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ testing {
4848

4949
tasks {
5050
jacocoTestReport {
51+
dependsOn(testing.suites.named("integrationTest"))
5152
// we need to explicitly add integrationTest coverage info
5253
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
5354
}
5455
jacocoTestCoverageVerification {
56+
dependsOn(testing.suites.named("integrationTest"))
5557
// we need to explicitly add integrationTest coverage info
5658
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
5759
violationRules {

plugins/server/graphql-kotlin-graalvm-metadata-generator/build.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ testing {
4747

4848
tasks {
4949
jacocoTestReport {
50+
dependsOn(testing.suites.named("integrationTest"))
5051
// we need to explicitly add integrationTest coverage info
5152
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
5253
}
5354
jacocoTestCoverageVerification {
55+
dependsOn(testing.suites.named("integrationTest"))
5456
// we need to explicitly add integrationTest coverage info
5557
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))
5658
violationRules {

0 commit comments

Comments
 (0)