Skip to content

Commit

Permalink
Update documentation for Kotlin 2 compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Jun 22, 2024
1 parent b0f7f48 commit 40707ac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ out/
# Misc
*.log
*.graphml
*.salive

# Mac
.DS_Store
7 changes: 0 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# 1.9.0

- Fix nullability annotation problem https://github.com/jqwik-team/jqwik/issues/575
Maybe with PR https://github.com/jqwik-team/jqwik/issues/575

- Upgrade to Kotlin 2.0
- Fix type problems from K2 compiler
- Document differences between K1 and K2 in user guide


# 1.9.x

Expand Down
24 changes: 17 additions & 7 deletions documentation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id 'jqwik.common-configuration'
}
Expand Down Expand Up @@ -129,16 +133,22 @@ test {
testLogging.showStandardStreams = true
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.freeCompilerArgs = [
"-Xemit-jvm-type-annotations" // Required for annotations on type variables
]
kotlinOptions.jvmTarget = "${javaTargetVersion}"
kotlinOptions.javaParameters = true
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
freeCompilerArgs = [
"-Xemit-jvm-type-annotations" // Required for annotations on type variables
]
apiVersion = KotlinVersion.KOTLIN_1_9
languageVersion = KotlinVersion.KOTLIN_1_9
javaParameters = true // Required to get correct parameter names in reporting
jvmTarget = JvmTarget.fromTarget("${javaTargetVersion}")
}
}

compileTestKotlin {
kotlinOptions.suppressWarnings = true
compilerOptions {
suppressWarnings = true
}
}

dependencies {
Expand Down
10 changes: 6 additions & 4 deletions documentation/src/docs/include/kotlin-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ tasks.withType<Test>().configureEach {
}

tasks.withType<KotlinCompile> {
kotlinOptions {
compilerOptions {
freeCompilerArgs = listOf(
"-Xemit-jvm-type-annotations" // Required for annotations on type variables
"[email protected]:strict",
"-Xemit-jvm-type-annotations" // Enable annotations on type variables
)
jvmTarget = "11" // 1.8 or above
javaParameters = true // Required to get correct parameter names in reporting
apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
javaParameters = true // Get correct parameter names in jqwik reporting
}
}
```
Expand Down

0 comments on commit 40707ac

Please sign in to comment.