diff --git a/build.gradle b/build.gradle index 9a2c896..0054566 100644 --- a/build.gradle +++ b/build.gradle @@ -2,46 +2,50 @@ plugins { id 'java' id 'jacoco' id 'maven-publish' - id 'com.enonic.defaults' version '2.1.6' - id 'com.enonic.xp.base' version '3.6.2' + alias( libs.plugins.enonic.defaults ) + alias( libs.plugins.enonic.xp.base ) } java { toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of( 25 ) } } repositories { mavenLocal() mavenCentral() - xp.enonicRepo('dev') + xp.enonicRepo( 'dev' ) } dependencies { compileOnly "com.enonic.xp:script-api:${xpVersion}" - implementation 'com.graphql-java:graphql-java:25.0' - implementation 'com.graphql-java:graphql-java-extended-scalars:24.0' - implementation "io.reactivex.rxjava2:rxjava:2.2.21" - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.20' - - testImplementation(platform("org.junit:junit-bom:6.0.1")) - testImplementation(platform("org.mockito:mockito-bom:5.21.0")) - testImplementation 'org.junit.jupiter:junit-jupiter' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.mockito:mockito-junit-jupiter' + + implementation libs.graphql.java; + implementation libs.graphql.java.extended.scalars; + implementation libs.rxjava; + implementation libs.jackson.annotations; + + testImplementation platform( libs.mockito.core ) + testImplementation libs.junit.jupiter + testImplementation libs.mockito.jupiter + testRuntimeOnly libs.junit.launcher testImplementation "com.enonic.xp:testing:${xpVersion}" } -tasks.named('test', Test) { +tasks.named( 'test', Test ) { useJUnitPlatform() } jacocoTestReport { reports { - xml.required= true + xml.required = true html.required = true } } +test { + useJUnitPlatform() +} + check.dependsOn jacocoTestReport diff --git a/gradle.properties b/gradle.properties index dda3521..3247e97 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ group=com.enonic.lib projectName=lib-graphql xpVersion=8.0.0-SNAPSHOT -version=2.2.0-SNAPSHOT +version=3.0.0-SNAPSHOT diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..44a4bb5 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,25 @@ +[versions] + +junit = "6.0.3" +mockito = "5.23.0" +enonicDefaults = "2.1.6" +enonicXpGradle = "4.0.0-A3" +graphQLJava = "26.0" +graphQLJavaExtendedScalars = "24.0" +rxJava = "2.2.21" +jacksonAnnotations = "2.20" + +[libraries] + +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } +junit-launcher = { module = "org.junit.platform:junit-platform-launcher" } +mockito-core = { module = "org.mockito:mockito-bom", version.ref = "mockito" } +mockito-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } +graphql-java = { module = "com.graphql-java:graphql-java", version.ref = "graphQLJava" } +graphql-java-extended-scalars = { module = "com.graphql-java:graphql-java-extended-scalars", version.ref = "graphQLJavaExtendedScalars" } +rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "rxJava" } +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jacksonAnnotations" } + +[plugins] +enonic-defaults = { id = "com.enonic.defaults", version.ref = "enonicDefaults" } +enonic-xp-base = { id = "com.enonic.xp.base", version.ref = "enonicXpGradle" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55..d997cfc 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 d4081da..c61a118 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-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 23d15a9..739907d 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index 5eed7ee..e509b2d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell