diff --git a/buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts b/buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts index 4e1870b255..c5cf77d474 100644 --- a/buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/com.expediagroup.graphql.conventions.gradle.kts @@ -43,6 +43,9 @@ tasks { jacoco { toolVersion = libs.versions.jacoco.get() } + jacocoTestReport { + dependsOn(test) + } jar { manifest { attributes["Built-By"] = "Expedia Group" @@ -129,7 +132,6 @@ tasks { test { useJUnitPlatform() - finalizedBy(jacocoTestReport) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 31c17c6f9c..5dcf0fa2f7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,5 @@ [versions] -# TODO gradle 8 upgrade -> android-plugin v8 requires gradle 8 -android-plugin = "8.0.0-alpha11" +android-plugin = "8.0.2" classgraph = "4.8.160" dataloader = "3.2.0" federation = "3.0.1" @@ -49,7 +48,7 @@ jacoco = "0.8.10" # klint gradle plugin breaks with 0.46.x+ ktlint-core = "0.45.2" ktlint-plugin = "10.3.0" -maven-plugin-development = "0.4.1" +maven-plugin-development = "0.4.2" nexus-publish-plugin = "1.3.0" plugin-publish = "1.2.0" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa7..c1962a79e2 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f398c33c4b..37aef8d3f0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d65..aeb74cbb43 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +141,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/plugins/graphql-kotlin-gradle-plugin/build.gradle.kts b/plugins/graphql-kotlin-gradle-plugin/build.gradle.kts index c5f1ffa16c..50110d6f9f 100644 --- a/plugins/graphql-kotlin-gradle-plugin/build.gradle.kts +++ b/plugins/graphql-kotlin-gradle-plugin/build.gradle.kts @@ -28,54 +28,47 @@ java { } gradlePlugin { + website.set("https://opensource.expediagroup.com/graphql-kotlin/docs/") + vcsUrl.set("https://github.com/ExpediaGroup/graphql-kotlin") 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" + tags.set(listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl")) } } } -pluginBundle { - website = "https://opensource.expediagroup.com/graphql-kotlin/docs/" - vcsUrl = "https://github.com/ExpediaGroup/graphql-kotlin" - tags = listOf("graphql", "kotlin", "graphql-client", "schema-generator", "sdl") +val generateDefaultVersion by tasks.registering { + val fileName = "PluginVersion.kt" + val defaultVersionFile = File("$buildDir/generated/src/com/expediagroup/graphql/plugin/gradle", fileName) + + inputs.property(fileName, project.version) + outputs.dir(defaultVersionFile.parent) + + doFirst { + defaultVersionFile.parentFile.mkdirs() + defaultVersionFile.writeText( + """ + package com.expediagroup.graphql.plugin.gradle + internal const val DEFAULT_PLUGIN_VERSION = "${project.version}" + + """.trimIndent() + ) + } } sourceSets { main { java { - srcDir("$buildDir/generated/src") + srcDir(generateDefaultVersion) } } } tasks { - val generateDefaultVersion by registering { - val fileName = "PluginVersion.kt" - val defaultVersionFile = File("$buildDir/generated/src/com/expediagroup/graphql/plugin/gradle", fileName) - - inputs.property(fileName, project.version) - outputs.file(defaultVersionFile) - - doFirst { - defaultVersionFile.parentFile.mkdirs() - defaultVersionFile.writeText( - """ - package com.expediagroup.graphql.plugin.gradle - internal const val DEFAULT_PLUGIN_VERSION = "${project.version}" - - """.trimIndent() - ) - } - } - - compileKotlin { - dependsOn(generateDefaultVersion) - } - publishPlugins { doFirst { System.setProperty("gradle.publish.key", System.getenv("PLUGIN_PORTAL_KEY")) diff --git a/plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts b/plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts index a7d318d154..823d556a93 100644 --- a/plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts +++ b/plugins/schema/graphql-kotlin-sdl-generator/build.gradle.kts @@ -48,10 +48,12 @@ testing { tasks { jacocoTestReport { + dependsOn(testing.suites.named("integrationTest")) // we need to explicitly add integrationTest coverage info executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec")) } jacocoTestCoverageVerification { + dependsOn(testing.suites.named("integrationTest")) // we need to explicitly add integrationTest coverage info executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec")) violationRules { diff --git a/plugins/server/graphql-kotlin-graalvm-metadata-generator/build.gradle.kts b/plugins/server/graphql-kotlin-graalvm-metadata-generator/build.gradle.kts index 37152ecb3e..6a2afb69d2 100644 --- a/plugins/server/graphql-kotlin-graalvm-metadata-generator/build.gradle.kts +++ b/plugins/server/graphql-kotlin-graalvm-metadata-generator/build.gradle.kts @@ -47,10 +47,12 @@ testing { tasks { jacocoTestReport { + dependsOn(testing.suites.named("integrationTest")) // we need to explicitly add integrationTest coverage info executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec")) } jacocoTestCoverageVerification { + dependsOn(testing.suites.named("integrationTest")) // we need to explicitly add integrationTest coverage info executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec")) violationRules {