Skip to content

Commit beef83d

Browse files
joonseoleecurquiza
andauthored
Upgrade Gradle to 9 along with JDK and Spotless (#880)
* Upgrade Gradle to 9 along with JDK and Spotless * Apply lint.sh auto-fixes --------- Co-authored-by: Clémentine <[email protected]>
1 parent bc0d1b5 commit beef83d

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

.github/workflows/pre-release-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
- name: Set up Java
1818
uses: actions/setup-java@v5
1919
with:
20-
java-version: 8
21-
distribution: 'zulu'
20+
java-version: 17
21+
distribution: 'temurin'
2222
cache: gradle
2323
- name: Grant execute permission for gradlew
2424
run: chmod +x gradlew

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- name: Set up Java
2222
uses: actions/setup-java@v5
2323
with:
24-
java-version: 8
25-
distribution: 'zulu'
24+
java-version: 17
25+
distribution: 'temurin'
2626
cache: gradle
2727
- name: Grant execute permission for gradlew
2828
run: chmod +x gradlew
@@ -46,11 +46,11 @@ jobs:
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v5
49-
- name: Set up JDK 1.8
49+
- name: Set up JDK 17
5050
uses: actions/setup-java@v5
5151
with:
52-
java-version: 8
53-
distribution: 'zulu'
52+
java-version: 17
53+
distribution: 'temurin'
5454
- name: Run linter
5555
run: bash scripts/lint.sh
5656
- name: Yaml lint check

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ This SDK is compatible with the following JDK versions:
295295

296296
| SDK Version | Supported Java Versions |
297297
|-------------|-------------------------|
298-
| v1.x | JDK 8 and above |
298+
| v1.x | JDK 17 and above |
299299

300300
## 💡 Learn more
301301

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ plugins {
1313
id 'signing'
1414
id 'jacoco'
1515
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
16-
id "com.diffplug.spotless" version "6.13.0"
16+
id "com.diffplug.spotless" version "6.25.0"
1717
}
1818

1919
group = 'com.meilisearch.sdk'
20-
archivesBaseName = 'meilisearch-java'
2120
version = '0.15.0'
2221

22+
base {
23+
archivesName.set('meilisearch-java')
24+
}
25+
2326
jacoco {
2427
toolVersion = "0.8.8"
2528
reportsDirectory = layout.buildDirectory.dir("$projectDir/tmp/coverage")
@@ -117,8 +120,8 @@ task integrationTest(type: Test) {
117120
}
118121

119122
java {
120-
sourceCompatibility = JavaVersion.VERSION_1_8
121-
targetCompatibility = JavaVersion.VERSION_1_8
123+
sourceCompatibility = JavaVersion.VERSION_17
124+
targetCompatibility = JavaVersion.VERSION_17
122125

123126
withJavadocJar()
124127
withSourcesJar()
@@ -193,7 +196,7 @@ spotless {
193196
// don't need to set target, it is inferred from java
194197

195198
// apply a specific flavor of google-java-format
196-
googleJavaFormat('1.7').aosp()
199+
googleJavaFormat('1.10.0').aosp()
197200
}
198201
}
199202

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
package:
3-
image: azul/zulu-openjdk:11-latest
3+
image: azul/zulu-openjdk:17-latest
44
tty: true
55
stdin_open: true
66
working_dir: /home/package
Lines changed: 1 addition & 1 deletion
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-8.14.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/test/java/com/meilisearch/integration/ClientTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.meilisearch.sdk.exceptions.MeilisearchException;
1313
import com.meilisearch.sdk.model.*;
1414
import com.meilisearch.sdk.utils.Movie;
15+
import java.lang.reflect.InaccessibleObjectException;
1516
import java.lang.reflect.Modifier;
1617
import org.junit.jupiter.api.*;
1718

@@ -320,8 +321,8 @@ public void testTransientFieldExclusion() throws MeilisearchException {
320321
Gson gsonWithTransient =
321322
new GsonBuilder().excludeFieldsWithModifiers(Modifier.STATIC).create();
322323

323-
// TODO: Throws StackOverflowError on JDK 1.8, but InaccessibleObjectException on JDK9+
324-
Assertions.assertThrows(StackOverflowError.class, () -> gsonWithTransient.toJson(test));
324+
Assertions.assertThrows(
325+
InaccessibleObjectException.class, () -> gsonWithTransient.toJson(test));
325326
Assertions.assertDoesNotThrow(() -> gson.toJson(test));
326327
}
327328
}

0 commit comments

Comments
 (0)