50 lines
1.4 KiB
Kotlin
50 lines
1.4 KiB
Kotlin
plugins {
|
|
id("base")
|
|
id("maven-publish")
|
|
id("de.infolektuell.typst") version "0.8.0"
|
|
}
|
|
|
|
typst.version = "v0.14.2"
|
|
|
|
typst.sourceSets {
|
|
// Sources in src/main
|
|
val main by registering {
|
|
// The files to compile (without .typ extension) in src/main/typst
|
|
documents = listOf("kontor") // src/main/typst/document.typst
|
|
inputs.put("version", version.toString())
|
|
}
|
|
}
|
|
|
|
tasks.withType<AbstractPublishToMaven>().configureEach {
|
|
dependsOn(tasks.named("compileTypst"))
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("maven") {
|
|
artifactId = "kontor"
|
|
artifact(file("build/typst/main/pdf/kontor.pdf")) {
|
|
classifier = "docs"
|
|
extension = "pdf"
|
|
}
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
// Determine URL based on version
|
|
url = uri(
|
|
if (version.toString().endsWith("SNAPSHOT")) {
|
|
"https://nexus.thpeetz.de/repository/maven-snapshots/"
|
|
} else {
|
|
"https://nexus.thpeetz.de/repository/maven-releases/"
|
|
}
|
|
)
|
|
// Credentials
|
|
credentials {
|
|
username = project.findProperty("nexusUsername") as String? ?: System.getenv("NEXUS_USERNAME")
|
|
password = project.findProperty("nexusPassword") as String? ?: System.getenv("NEXUS_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
}
|