Skip to content

Commit

Permalink
feat: bump kotlin version to 1.9.24
Browse files Browse the repository at this point in the history
Also:

- bump dokka version to 1.9.20
- target JVM 17 output
- Add Codegen CI workflow
  • Loading branch information
Steven Yuan authored and syall committed May 8, 2024
1 parent 34f090b commit fd278ba
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Codegen

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
codegen:
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} ${{ matrix.os }}
strategy:
matrix:
java: [17]
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'corretto'

- name: Log Kotlin version
run: |
which kotlin
kotlin -version
- name: Clean and Build
run: ./gradlew clean build -Plog-tests
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

plugins {
kotlin("jvm") version "1.5.0" apply false
id("org.jetbrains.dokka") version "1.4.30"
kotlin("jvm")
id("org.jetbrains.dokka")
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ smithyVersion=1.47.0
smithyGradleVersion=0.6.0

# kotlin
kotlinVersion=1.5.31
dokkaVersion=1.5.31
kotlinVersion=1.9.24
dokkaVersion=1.9.20
kotlin.native.ignoreDisabledTargets=true

# kotlin libraries
Expand Down
16 changes: 15 additions & 1 deletion smithy-swift-codegen-test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

description = "Generates Test Weather SDK Client code from Smithy models"
extra["displayName"] = "Smithy :: Swift :: Codegen :: Test :: Utils"
extra["moduleName"] = "software.amazon.smithy.swift.codegen.test.utils"
Expand All @@ -16,6 +19,17 @@ repositories {
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("stdlib"))
implementation(project(":smithy-swift-codegen"))
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}
16 changes: 15 additions & 1 deletion smithy-swift-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* SPDX-License-Identifier: Apache-2.0.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
id("org.jetbrains.dokka")
Expand All @@ -25,7 +28,7 @@ val junitVersion: String by project
val jacocoVersion: String by project

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("stdlib"))
api("software.amazon.smithy:smithy-codegen-core:$smithyVersion")
api("software.amazon.smithy:smithy-waiters:$smithyVersion")
api("software.amazon.smithy:smithy-smoke-test-traits:${smithyVersion}")
Expand All @@ -39,6 +42,17 @@ dependencies {
implementation("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_17.toString()
targetCompatibility = JavaVersion.VERSION_17.toString()
}

jacoco {
toolVersion = "$jacocoVersion"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ open class HttpProtocolUnitTestResponseGenerator protected constructor(builder:
when (shape.type) {
ShapeType.STRUCTURE -> renderEquatable(shape)
ShapeType.UNION -> renderEquatable(shape)
else -> {}
}
}
writer.write("XCTAssertEqual(actual, expected)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class WritingClosureUtils(
when (ctx.service.requestWireProtocol) {
WireProtocol.JSON -> return "JSONReadWrite.writingClosure()"
WireProtocol.FORM_URL -> return "FormURLReadWrite.writingClosure()"
else -> {}
}
return when (shape) {
is MapShape -> {
Expand Down

0 comments on commit fd278ba

Please sign in to comment.