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 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("pheeraiBomVersion")}")) testImplementation("io.kotest", "kotest-runner-junit5-jvm") testImplementation("io.kotest", "kotest-assertions-core-jvm") } tasks { withType().configureEach { kotlinOptions { apiVersion = getFromExtra("kotlinApiVersion") languageVersion = getFromExtra("kotlinApiVersion") jvmTarget = getFromExtra("javaVersion").toString() } } test { useJUnitPlatform() } } publishing { publications { create("maven") { groupId = project.group as String artifactId = project.name version = project.version as String from(components["java"]) } } }