diff --git a/.changes/aa10152c-0040-46b3-8551-ed63aca0c6ee.json b/.changes/aa10152c-0040-46b3-8551-ed63aca0c6ee.json new file mode 100644 index 00000000..fcfa63c0 --- /dev/null +++ b/.changes/aa10152c-0040-46b3-8551-ed63aca0c6ee.json @@ -0,0 +1,8 @@ +{ + "id": "aa10152c-0040-46b3-8551-ed63aca0c6ee", + "type": "bugfix", + "description": "Enable building this project on JDK21 by setting -Xjdk-release flag", + "issues": [ + "https://github.com/smithy-lang/smithy-kotlin/issues/1295" + ] +} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 36e11d7b..43ec0386 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,10 +7,6 @@ on: - '!main' env: - BUILDER_VERSION: v0.8.22 - BUILDER_SOURCE: releases - BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net - PACKAGE_NAME: aws-crt-kotlin RUN: ${{ github.run_id }}-${{ github.run_number }} jobs: @@ -19,6 +15,7 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | @@ -27,18 +24,25 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Build and Test ${{ env.PACKAGE_NAME }} + + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + cache: 'gradle' + + - name: Build and Test run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - chmod a+x builder.pyz echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties - ./builder.pyz build -p ${{ env.PACKAGE_NAME }} + ./gradlew allTests macos-compat: runs-on: macos-latest steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | @@ -47,19 +51,42 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} restore-keys: | ${{ runner.os }}-gradle- - - name: Build and Test ${{ env.PACKAGE_NAME }} + + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + cache: 'gradle' + + - name: Build and Test run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - chmod a+x builder.pyz echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties - ./builder.pyz build -p ${{ env.PACKAGE_NAME }} + ./gradlew allTests windows-compat: runs-on: windows-latest steps: - name: Checkout sources uses: actions/checkout@v4 - - name: Build and Test ${{ env.PACKAGE_NAME }} + + - uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + cache: 'gradle' + + - name: Build and Test run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - python3 builder.pyz build -p ${{ env.PACKAGE_NAME }} + echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties + ./gradlew allTests diff --git a/build.gradle.kts b/build.gradle.kts index 248c6286..139832ce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,6 +41,7 @@ subprojects { tasks.withType { compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) + freeCompilerArgs.add("-Xjdk-release=1.8") freeCompilerArgs.add("-Xexpect-actual-classes") } }