mirror of
https://github.com/apple/pkl.git
synced 2026-01-14 07:33:40 +01:00
This change activates the `TYPESAFE_PROJECT_ACCESSORS` feature preview in Gradle, and switches to such accessors instead of string-based project references, where possible Relates-To: apple/pkl#204 Signed-off-by: Sam Gammon <sam@elide.ventures>
45 lines
1.1 KiB
Kotlin
45 lines
1.1 KiB
Kotlin
plugins {
|
|
pklAllProjects
|
|
pklKotlinLibrary
|
|
pklPublishLibrary
|
|
}
|
|
|
|
dependencies {
|
|
// CliJavaCodeGeneratorOptions exposes CliBaseOptions
|
|
api(projects.pklCommonsCli)
|
|
|
|
implementation(projects.pklCommons)
|
|
implementation(projects.pklCore)
|
|
implementation(libs.javaPoet)
|
|
|
|
testImplementation(projects.pklConfigJava)
|
|
testImplementation(projects.pklCommonsTest)
|
|
}
|
|
|
|
// with `org.gradle.parallel=true` and without the line below, `test` strangely runs into:
|
|
// java.lang.NoClassDefFoundError: Lorg/pkl/config/java/ConfigEvaluator;
|
|
// perhaps somehow related to InMemoryJavaCompiler?
|
|
tasks.test {
|
|
mustRunAfter(":pkl-config-java:testFatJar")
|
|
}
|
|
|
|
tasks.jar {
|
|
manifest {
|
|
attributes += mapOf("Main-Class" to "org.pkl.codegen.java.Main")
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
named<MavenPublication>("library") {
|
|
pom {
|
|
url.set("https://github.com/apple/pkl/tree/main/pkl-codegen-java")
|
|
description.set("""
|
|
Java source code generator that generates corresponding Java classes for Pkl classes,
|
|
simplifying consumption of Pkl configuration as statically typed Java objects.
|
|
""".trimIndent())
|
|
}
|
|
}
|
|
}
|
|
}
|