rcdbquery/build.gradle.kts

79 lines
1.8 KiB
Text

import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
extra.apply {
set("pheeraiBomVersion", "0.0.3-SNAPSHOT")
set("kotlinApiVersion", "1.4")
set("javaVersion", JavaVersion.VERSION_11)
}
}
inline fun <reified T> getFromExtra(prop: String) = project.extra[prop] as T
// TODO: Documentation
// TODO: Source Jar
// TODO: Doc Jar
// TODO: Proper Maven publish
plugins {
kotlin("jvm")
`maven-publish`
}
repositories {
mavenCentral()
jcenter()
google()
maven {
url = uri("https://git.f3l.de/api/v4/projects/160/packages/maven")
mavenContent {
includeGroup("de.pheerai")
includeGroup("de.pheerai.eap")
}
}
}
project.version = "0.0.2"
project.group = "de.pheerai.rcdb"
java {
targetCompatibility = getFromExtra("javaVersion")
sourceCompatibility = getFromExtra("javaVersion")
}
kotlin {
explicitApi = ExplicitApiMode.Strict
}
dependencies {
implementation(enforcedPlatform("de.pheerai:kotlin-crawler-app-bom:${getFromExtra<String>("pheeraiBomVersion")}"))
testImplementation("io.kotest", "kotest-runner-junit5-jvm")
testImplementation("io.kotest", "kotest-assertions-core-jvm")
}
tasks {
withType<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = getFromExtra("kotlinApiVersion")
languageVersion = getFromExtra("kotlinApiVersion")
jvmTarget = getFromExtra<JavaVersion>("javaVersion").toString()
}
}
test {
useJUnitPlatform()
}
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.group as String
artifactId = project.name
version = project.version as String
from(components["java"])
}
}
}