|
1 | 1 | package buildsrc.convention
|
2 | 2 |
|
| 3 | +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_5 |
| 4 | +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8 |
3 | 5 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
4 | 6 |
|
5 | 7 |
|
6 | 8 | plugins {
|
7 | 9 | id("buildsrc.convention.base")
|
8 | 10 | kotlin("jvm")
|
9 | 11 | `java-library`
|
10 |
| - // id("org.jetbrains.dokka") |
11 | 12 | }
|
12 | 13 |
|
13 |
| - |
14 |
| -dependencies { |
15 |
| - testImplementation("org.junit.jupiter:junit-jupiter") |
16 |
| - testRuntimeOnly("org.junit.platform:junit-platform-launcher") { |
17 |
| - because("Only needed to run tests in a version of IntelliJ IDEA that bundles older versions") |
18 |
| - } |
19 |
| - |
20 |
| - testImplementation("io.kotest:kotest-runner-junit5") |
21 |
| - testImplementation("io.kotest:kotest-assertions-core") |
22 |
| - testImplementation("io.kotest:kotest-property") |
23 |
| - testImplementation("io.kotest:kotest-assertions-json") |
24 |
| - |
25 |
| - testImplementation("io.mockk:mockk") |
26 |
| -} |
27 |
| - |
28 |
| - |
29 | 14 | kotlin {
|
30 |
| - jvmToolchain { |
31 |
| - languageVersion.set(JavaLanguageVersion.of(11)) |
32 |
| - } |
| 15 | + jvmToolchain(11) |
33 | 16 | }
|
34 | 17 |
|
35 |
| - |
36 | 18 | tasks.withType<KotlinCompile>().configureEach {
|
37 | 19 |
|
38 |
| - kotlinOptions { |
39 |
| - apiVersion = "1.5" |
40 |
| - languageVersion = "1.8" |
41 |
| - } |
| 20 | + compilerOptions { |
| 21 | + apiVersion.set(KOTLIN_1_5) |
| 22 | + languageVersion.set(KOTLIN_1_8) |
42 | 23 |
|
43 |
| - kotlinOptions.freeCompilerArgs += listOf( |
44 |
| - "-opt-in=kotlin.RequiresOptIn", |
45 |
| - "-opt-in=kotlin.ExperimentalStdlibApi", |
46 |
| - "-opt-in=kotlin.time.ExperimentalTime", |
47 |
| - ) |
| 24 | + freeCompilerArgs.addAll( |
| 25 | + "-opt-in=kotlin.ExperimentalStdlibApi", |
| 26 | + "-opt-in=kotlin.time.ExperimentalTime", |
| 27 | + ) |
| 28 | + } |
48 | 29 | }
|
49 | 30 |
|
50 |
| - |
51 | 31 | tasks.compileTestKotlin {
|
52 |
| - kotlinOptions.freeCompilerArgs += "-opt-in=io.kotest.common.ExperimentalKotest" |
| 32 | + compilerOptions { |
| 33 | + freeCompilerArgs.addAll( |
| 34 | + "-opt-in=io.kotest.common.ExperimentalKotest" |
| 35 | + ) |
| 36 | + } |
53 | 37 | }
|
54 | 38 |
|
55 |
| - |
56 | 39 | tasks.withType<Test>().configureEach {
|
57 | 40 | useJUnitPlatform()
|
58 | 41 | }
|
59 | 42 |
|
60 |
| - |
61 | 43 | java {
|
62 | 44 | withJavadocJar()
|
63 | 45 | withSourcesJar()
|
64 | 46 | }
|
65 |
| - |
66 |
| - |
67 |
| -tasks.withType<Jar>().named("javadocJar") { |
68 |
| -// from(tasks.dokkaHtml) |
69 |
| -} |
0 commit comments