Skip to content

Commit 807b7e2

Browse files
authored
Upgrade to GraphQL-Java 21 & Gradle 8.3 (#295)
* Multiple upgrades in this commit: - Upgrade Gradle BND plugin to 6.4.0 - Upgrade Gradle license plugin to 0.16.1 - Upgrade Gradle Nexus publish plugin to 1.3.0 - Upgrade Gradle & Wrapper to 8.3 - Update build script to be compatible with Gradle 8.3 Note: because we are using GraphQL Java 21 only JDK 11+ are supported now. * Upgrade actions to use JDK 11
1 parent 44ab83c commit 807b7e2

File tree

7 files changed

+38
-27
lines changed

7 files changed

+38
-27
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Set up JDK 8
13+
- name: Set up JDK 11
1414
uses: actions/setup-java@v2
1515
with:
16-
java-version: '8'
16+
java-version: '11'
1717
distribution: 'zulu'
1818
- name: Grant execute permission for gradlew
1919
run: chmod +x gradlew

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
environment: prod
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: Set up JDK 8
16+
- name: Set up JDK 11
1717
uses: actions/setup-java@v2
1818
with:
19-
java-version: '8'
19+
java-version: '11'
2020
distribution: 'zulu'
2121
- name: Grant execute permission for gradlew
2222
run: chmod +x gradlew

build.gradle

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import aQute.bnd.gradle.Bundle
2+
import io.github.gradlenexus.publishplugin.NexusRepository
23

34
buildscript {
45
repositories {
56
mavenCentral()
67
}
78
dependencies {
8-
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2'
9+
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0'
910
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
1011
}
1112
}
1213
plugins {
13-
id 'net.researchgate.release' version '2.8.1'
14-
id 'com.github.hierynomus.license' version '0.15.0'
14+
id 'net.researchgate.release' version '3.0.2'
15+
id 'com.github.hierynomus.license' version '0.16.1'
1516
id 'maven-publish'
1617
id 'signing'
17-
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
18+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
1819
}
1920

2021
apply plugin: 'java'
@@ -24,13 +25,15 @@ apply plugin: 'maven-publish'
2425

2526

2627
// custom tasks for creating source/javadoc jars
27-
task sourcesJar(type: Jar, dependsOn: classes) {
28-
classifier = 'sources'
28+
tasks.register('sourcesJar', Jar) {
29+
dependsOn classes
30+
archiveClassifier = 'sources'
2931
from sourceSets.main.allSource
3032
}
3133

32-
task javadocJar(type: Jar, dependsOn: javadoc) {
33-
classifier = 'javadoc'
34+
tasks.register('javadocJar', Jar) {
35+
dependsOn javadoc
36+
archiveClassifier = 'javadoc'
3437
from javadoc.destinationDir
3538
}
3639

@@ -45,28 +48,30 @@ repositories {
4548
}
4649

4750
gradle.projectsEvaluated {
48-
tasks.withType(JavaCompile) {
49-
doLast {
50-
options.compilerArgs += "-parameters"
51+
tasks.withType(JavaCompile).tap {
52+
configureEach {
53+
doLast {
54+
options.compilerArgs += "-parameters"
55+
}
5156
}
5257
}
5358
}
5459

5560
dependencies {
56-
compile 'javax.validation:validation-api:1.1.0.Final'
57-
compile 'com.graphql-java:graphql-java:20.4'
58-
compile 'com.graphql-java:graphql-java-extended-scalars:20.2'
59-
compile 'javax.xml.bind:jaxb-api:2.3.1'
61+
implementation 'javax.validation:validation-api:1.1.0.Final'
62+
implementation 'com.graphql-java:graphql-java:21.1'
63+
implementation 'com.graphql-java:graphql-java-extended-scalars:21.0'
64+
implementation 'javax.xml.bind:jaxb-api:2.3.1'
6065

6166
// OSGi
6267
compileOnly 'org.osgi:org.osgi.core:6.0.0'
6368
compileOnly 'org.osgi:org.osgi.service.cm:1.5.0'
6469
compileOnly 'org.osgi:org.osgi.service.component:1.3.0'
6570
compileOnly 'biz.aQute.bnd:biz.aQute.bndlib:3.2.0'
6671

67-
testCompile 'org.testng:testng:6.9.10'
68-
testCompile 'org.hamcrest:hamcrest-all:1.3'
69-
testCompile 'org.mockito:mockito-core:2.+'
72+
testImplementation 'org.testng:testng:7.5.1'
73+
testImplementation 'org.hamcrest:hamcrest-all:1.3'
74+
testImplementation 'org.mockito:mockito-core:2.+'
7075
}
7176

7277
test.useTestNG()
@@ -158,11 +163,13 @@ signing {
158163
sign publishing.publications
159164
}
160165

161-
task bundle(type: Bundle) {
166+
tasks.register('bundle', Bundle) {
162167
from sourceSets.main.output
163-
bndfile = file('bundle.bnd')
168+
bundle {
169+
bndfile = project.file('bundle.bnd')
170+
}
164171
}
165172

166173
wrapper {
167-
gradleVersion = '6.5.1'
174+
gradleVersion = '8.3'
168175
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ org.gradle.daemon=true
55
org.gradle.parallel=true
66
org.gradle.jvmargs=-Dfile.encoding=UTF-8
77

8-
version = 20.3
8+
version = 21.1

gradle/wrapper/gradle-wrapper.jar

215 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

@@ -81,6 +84,7 @@ set CMD_LINE_ARGS=%*
8184

8285
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8386

87+
8488
@rem Execute Gradle
8589
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
8690

0 commit comments

Comments
 (0)