-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted Kotlin build stuff into buildlogic.kotlin-library-conventio…
…ns.gradle.kts
- Loading branch information
Showing
4 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ plugins { | |
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.kotlin.gradlePlugin) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
java | ||
`java-library` | ||
id("buildlogic.publish-library") | ||
id("kotlin") | ||
} | ||
|
||
repositories { | ||
|
@@ -31,3 +35,22 @@ tasks.named<Test>("test") { | |
|
||
testLogging.showStandardStreams = true | ||
} | ||
|
||
val javaVersion: String = System.getProperty("matrix.version") ?: "21" | ||
|
||
val kotlinCompilerArgs = listOf( | ||
"[email protected]:strict", | ||
"-Xemit-jvm-type-annotations" // Required for annotations on type variables | ||
) | ||
|
||
tasks.withType<KotlinCompile> { | ||
compilerOptions { | ||
freeCompilerArgs.set(kotlinCompilerArgs) | ||
javaParameters = true // Required to get correct parameter names in reporting | ||
jvmTarget = JvmTarget.fromTarget(javaVersion) | ||
} | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(21) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters