Files
pkl/buildSrc/src/main/kotlin/pklKotlinLibrary.gradle.kts
T
Sam Gammon ca31185302 Move tool versions to Version Catalog
- fix: make version catalog accessible from `buildSrc` plugins
- chore: declare `googleFormatVersion` in version catalog
- chore: declare `ktfmt` in version catalog

Relates-To: apple/pkl#204
Signed-off-by: Sam Gammon <sam@elide.ventures>
2024-02-21 12:01:49 +00:00

34 lines
917 B
Kotlin

import org.gradle.accessors.dm.LibrariesForLibs
plugins {
id("pklJavaLibrary")
kotlin("jvm")
}
val buildInfo = project.extensions.getByType<BuildInfo>()
// Version Catalog library symbols.
val libs = the<LibrariesForLibs>()
dependencies {
// At least some of our kotlin APIs contain Kotlin stdlib types
// that aren't compiled away by kotlinc (e.g., `kotlin.Function`).
// So let's be conservative and default to `api` for now.
// For Kotlin APIs that only target Kotlin users (e.g., pkl-config-kotlin),
// it won't make a difference.
api(buildInfo.libs.findLibrary("kotlinStdLib").get())
}
tasks.compileKotlin {
enabled = true // disabled by pklJavaLibrary
}
spotless {
kotlin {
ktfmt(libs.versions.ktfmt.get()).googleStyle()
targetExclude("**/generated/**", "**/build/**")
licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt"))
}
}