Skip to content

Commit ca72af9

Browse files
authored
misc: add -Xjdk-release=1.8 everywhere we set jvmTarget (#154)
1 parent 8657f16 commit ca72af9

File tree

3 files changed

+51
-15
lines changed

3 files changed

+51
-15
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "aa10152c-0040-46b3-8551-ed63aca0c6ee",
3+
"type": "bugfix",
4+
"description": "Enable building this project on JDK21 by setting -Xjdk-release flag",
5+
"issues": [
6+
"https://github.com/smithy-lang/smithy-kotlin/issues/1295"
7+
]
8+
}

.github/workflows/ci.yaml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
- '!main'
88

99
env:
10-
BUILDER_VERSION: v0.8.22
11-
BUILDER_SOURCE: releases
12-
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
13-
PACKAGE_NAME: aws-crt-kotlin
1410
RUN: ${{ github.run_id }}-${{ github.run_number }}
1511

1612
jobs:
@@ -19,6 +15,7 @@ jobs:
1915
steps:
2016
- name: Checkout sources
2117
uses: actions/checkout@v4
18+
2219
- uses: actions/cache@v4
2320
with:
2421
path: |
@@ -27,18 +24,25 @@ jobs:
2724
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
2825
restore-keys: |
2926
${{ runner.os }}-gradle-
30-
- name: Build and Test ${{ env.PACKAGE_NAME }}
27+
28+
- name: Configure JDK
29+
uses: actions/setup-java@v3
30+
with:
31+
distribution: 'corretto'
32+
java-version: 17
33+
cache: 'gradle'
34+
35+
- name: Build and Test
3136
run: |
32-
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
33-
chmod a+x builder.pyz
3437
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
35-
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
38+
./gradlew allTests
3639
3740
macos-compat:
3841
runs-on: macos-latest
3942
steps:
4043
- name: Checkout sources
4144
uses: actions/checkout@v4
45+
4246
- uses: actions/cache@v4
4347
with:
4448
path: |
@@ -47,19 +51,42 @@ jobs:
4751
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
4852
restore-keys: |
4953
${{ runner.os }}-gradle-
50-
- name: Build and Test ${{ env.PACKAGE_NAME }}
54+
55+
- name: Configure JDK
56+
uses: actions/setup-java@v3
57+
with:
58+
distribution: 'corretto'
59+
java-version: 17
60+
cache: 'gradle'
61+
62+
- name: Build and Test
5163
run: |
52-
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
53-
chmod a+x builder.pyz
5464
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
55-
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
65+
./gradlew allTests
5666
5767
windows-compat:
5868
runs-on: windows-latest
5969
steps:
6070
- name: Checkout sources
6171
uses: actions/checkout@v4
62-
- name: Build and Test ${{ env.PACKAGE_NAME }}
72+
73+
- uses: actions/cache@v4
74+
with:
75+
path: |
76+
~/.gradle/caches
77+
~/.gradle/wrapper
78+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
79+
restore-keys: |
80+
${{ runner.os }}-gradle-
81+
82+
- name: Configure JDK
83+
uses: actions/setup-java@v3
84+
with:
85+
distribution: 'corretto'
86+
java-version: 17
87+
cache: 'gradle'
88+
89+
- name: Build and Test
6390
run: |
64-
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
65-
python3 builder.pyz build -p ${{ env.PACKAGE_NAME }}
91+
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
92+
./gradlew allTests

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ subprojects {
4141
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
4242
compilerOptions {
4343
jvmTarget.set(JvmTarget.JVM_1_8)
44+
freeCompilerArgs.add("-Xjdk-release=1.8")
4445
freeCompilerArgs.add("-Xexpect-actual-classes")
4546
}
4647
}

0 commit comments

Comments
 (0)