Skip to content

Commit f8fa218

Browse files
jmartinespbmarty
andauthored
Upgrade the used JDK in the project to v21 (#3582)
* Upgrade the used JDK in the project to v21 * Use it for CI too * Centralise java language version * Fix deprecations, tests and lint issues * Fix coverage taking into account `@Preview` annotated code. --------- Co-authored-by: Benoit Marty <[email protected]>
1 parent 9f7e4d5 commit f8fa218

24 files changed

+84
-62
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
# Ensure we are building the branch and not the branch after being merged on develop
3131
# https://github.com/actions/checkout/issues/881
3232
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
33-
- name: Use JDK 17
33+
- name: Use JDK 21
3434
uses: actions/setup-java@v4
3535
with:
3636
distribution: 'temurin' # See 'Supported distributions' for available options
37-
java-version: '17'
37+
java-version: '21'
3838
- name: Configure gradle
3939
uses: gradle/actions/setup-gradle@v4
4040
with:

.github/workflows/build_enterprise.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
3939
- name: Clone submodules
4040
run: git submodule update --init --recursive
41-
- name: Use JDK 17
41+
- name: Use JDK 21
4242
uses: actions/setup-java@v4
4343
with:
4444
distribution: 'temurin' # See 'Supported distributions' for available options
45-
java-version: '17'
45+
java-version: '21'
4646
- name: Configure gradle
4747
uses: gradle/actions/setup-gradle@v4
4848
with:

.github/workflows/generate_github_pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
steps:
1414
- name: ⏬ Checkout with LFS
1515
uses: nschloe/[email protected]
16-
- name: Use JDK 17
16+
- name: Use JDK 21
1717
uses: actions/setup-java@v4
1818
with:
1919
distribution: 'temurin' # See 'Supported distributions' for available options
20-
java-version: '17'
20+
java-version: '21'
2121
- name: Configure gradle
2222
uses: gradle/actions/setup-gradle@v4
2323
with:

.github/workflows/gradle-wrapper-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-java@v4
16-
name: Use JDK 17
16+
name: Use JDK 21
1717
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
1818
with:
1919
distribution: 'temurin' # See 'Supported distributions' for available options
20-
java-version: '17'
20+
java-version: '21'
2121
- name: Update Gradle Wrapper
2222
uses: gradle-update/update-gradle-wrapper-action@v2
2323
with:

.github/workflows/maestro.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
# https://github.com/actions/checkout/issues/881
3434
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
3535
- uses: actions/setup-java@v4
36-
name: Use JDK 17
36+
name: Use JDK 21
3737
if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch'
3838
with:
3939
distribution: 'temurin' # See 'Supported distributions' for available options
40-
java-version: '17'
40+
java-version: '21'
4141
- name: Configure gradle
4242
uses: gradle/actions/setup-gradle@v4
4343
with:

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
if: ${{ github.repository == 'element-hq/element-x-android' }}
1818
steps:
1919
- uses: actions/checkout@v4
20-
- name: Use JDK 17
20+
- name: Use JDK 21
2121
uses: actions/setup-java@v4
2222
with:
2323
distribution: 'temurin' # See 'Supported distributions' for available options
24-
java-version: '17'
24+
java-version: '21'
2525
- name: Build and upload Nightly application
2626
run: |
2727
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES

.github/workflows/nightlyReports.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- name: ⏬ Checkout with LFS
2121
uses: nschloe/[email protected]
2222

23-
- name: Use JDK 17
23+
- name: Use JDK 21
2424
uses: actions/setup-java@v4
2525
with:
2626
distribution: 'temurin' # See 'Supported distributions' for available options
27-
java-version: '17'
27+
java-version: '21'
2828

2929
- name: Configure gradle
3030
uses: gradle/actions/setup-gradle@v4
@@ -61,11 +61,11 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- uses: actions/checkout@v4
64-
- name: Use JDK 17
64+
- name: Use JDK 21
6565
uses: actions/setup-java@v4
6666
with:
6767
distribution: 'temurin' # See 'Supported distributions' for available options
68-
java-version: '17'
68+
java-version: '21'
6969
- name: Configure gradle
7070
uses: gradle/actions/setup-gradle@v4
7171
with:

.github/workflows/nightly_enterprise.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
ssh-private-key: ${{ secrets.ELEMENT_ENTERPRISE_DEPLOY_KEY }}
2424
- name: Clone submodules
2525
run: git submodule update --init --recursive
26-
- name: Use JDK 17
26+
- name: Use JDK 21
2727
uses: actions/setup-java@v4
2828
with:
2929
distribution: 'temurin' # See 'Supported distributions' for available options
30-
java-version: '17'
30+
java-version: '21'
3131
- name: Build and upload Nightly application
3232
run: |
3333
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES

.github/workflows/quality.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v4
49-
- name: Use JDK 17
49+
- name: Use JDK 21
5050
uses: actions/setup-java@v4
5151
with:
5252
distribution: 'temurin' # See 'Supported distributions' for available options
53-
java-version: '17'
53+
java-version: '21'
5454
- name: Configure gradle
5555
uses: gradle/actions/setup-gradle@v4
5656
with:
@@ -84,11 +84,11 @@ jobs:
8484
- name: Clone submodules
8585
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
8686
run: git submodule update --init --recursive
87-
- name: Use JDK 17
87+
- name: Use JDK 21
8888
uses: actions/setup-java@v4
8989
with:
9090
distribution: 'temurin' # See 'Supported distributions' for available options
91-
java-version: '17'
91+
java-version: '21'
9292
- name: Configure gradle
9393
uses: gradle/actions/setup-gradle@v4
9494
with:
@@ -124,11 +124,11 @@ jobs:
124124
- name: Clone submodules
125125
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
126126
run: git submodule update --init --recursive
127-
- name: Use JDK 17
127+
- name: Use JDK 21
128128
uses: actions/setup-java@v4
129129
with:
130130
distribution: 'temurin' # See 'Supported distributions' for available options
131-
java-version: '17'
131+
java-version: '21'
132132
- name: Configure gradle
133133
uses: gradle/actions/setup-gradle@v4
134134
with:
@@ -168,11 +168,11 @@ jobs:
168168
- name: Clone submodules
169169
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
170170
run: git submodule update --init --recursive
171-
- name: Use JDK 17
171+
- name: Use JDK 21
172172
uses: actions/setup-java@v4
173173
with:
174174
distribution: 'temurin' # See 'Supported distributions' for available options
175-
java-version: '17'
175+
java-version: '21'
176176
- name: Configure gradle
177177
uses: gradle/actions/setup-gradle@v4
178178
with:
@@ -208,11 +208,11 @@ jobs:
208208
- name: Clone submodules
209209
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
210210
run: git submodule update --init --recursive
211-
- name: Use JDK 17
211+
- name: Use JDK 21
212212
uses: actions/setup-java@v4
213213
with:
214214
distribution: 'temurin' # See 'Supported distributions' for available options
215-
java-version: '17'
215+
java-version: '21'
216216
- name: Configure gradle
217217
uses: gradle/actions/setup-gradle@v4
218218
with:
@@ -248,11 +248,11 @@ jobs:
248248
- name: Clone submodules
249249
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
250250
run: git submodule update --init --recursive
251-
- name: Use JDK 17
251+
- name: Use JDK 21
252252
uses: actions/setup-java@v4
253253
with:
254254
distribution: 'temurin' # See 'Supported distributions' for available options
255-
java-version: '17'
255+
java-version: '21'
256256
- name: Configure gradle
257257
uses: gradle/actions/setup-gradle@v4
258258
with:

.github/workflows/recordScreenshots.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
uses: nschloe/[email protected]
3333
with:
3434
persist-credentials: false
35-
- name: ☕️ Use JDK 17
35+
- name: ☕️ Use JDK 21
3636
uses: actions/setup-java@v4
3737
with:
3838
distribution: 'temurin' # See 'Supported distributions' for available options
39-
java-version: '17'
39+
java-version: '21'
4040
# Add gradle cache, this should speed up the process
4141
- name: Configure gradle
4242
uses: gradle/actions/setup-gradle@v4

0 commit comments

Comments
 (0)