2021-03-06 14:53:28 +01:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
|
2020-04-19 12:40:12 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
2020-08-23 23:11:41 +02:00
|
|
|
buildscript {
|
|
|
|
extra.apply {
|
2021-03-06 14:53:28 +01:00
|
|
|
set("pheeraiBomVersion", "0.0.3-SNAPSHOT")
|
2020-08-23 23:11:41 +02:00
|
|
|
set("kotlinApiVersion", "1.4")
|
|
|
|
set("javaVersion", JavaVersion.VERSION_11)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fun <reified T> getFromExtra(prop: String) = project.extra[prop] as T
|
|
|
|
|
2020-05-08 15:07:30 +02:00
|
|
|
// TODO: Documentation
|
|
|
|
// TODO: Source Jar
|
|
|
|
// TODO: Doc Jar
|
|
|
|
// TODO: Proper Maven publish
|
2020-04-04 13:37:27 +02:00
|
|
|
plugins {
|
2020-04-19 12:40:12 +02:00
|
|
|
kotlin("jvm")
|
2020-05-08 15:07:30 +02:00
|
|
|
`maven-publish`
|
2020-04-04 13:37:27 +02:00
|
|
|
}
|
2020-04-19 12:40:12 +02:00
|
|
|
|
2020-04-04 13:37:27 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2020-09-20 12:24:18 +02:00
|
|
|
jcenter()
|
|
|
|
google()
|
2021-03-06 14:53:28 +01:00
|
|
|
maven {
|
|
|
|
url = uri("https://git.f3l.de/api/v4/projects/160/packages/maven")
|
2020-09-20 12:24:18 +02:00
|
|
|
mavenContent {
|
|
|
|
includeGroup("de.pheerai")
|
|
|
|
includeGroup("de.pheerai.eap")
|
|
|
|
}
|
|
|
|
}
|
2020-04-04 13:37:27 +02:00
|
|
|
}
|
2020-04-19 12:40:12 +02:00
|
|
|
|
2020-08-23 23:11:41 +02:00
|
|
|
project.version = "0.0.2"
|
2020-05-08 15:07:30 +02:00
|
|
|
project.group = "de.pheerai.rcdb"
|
|
|
|
|
2020-04-19 12:40:12 +02:00
|
|
|
java {
|
2020-08-23 23:11:41 +02:00
|
|
|
targetCompatibility = getFromExtra("javaVersion")
|
|
|
|
sourceCompatibility = getFromExtra("javaVersion")
|
2020-04-19 12:40:12 +02:00
|
|
|
}
|
|
|
|
|
2021-03-06 14:53:28 +01:00
|
|
|
kotlin {
|
|
|
|
explicitApi = ExplicitApiMode.Strict
|
|
|
|
}
|
|
|
|
|
2020-04-19 12:40:12 +02:00
|
|
|
dependencies {
|
2021-03-06 14:53:28 +01:00
|
|
|
implementation(enforcedPlatform("de.pheerai:kotlin-crawler-app-bom:${getFromExtra<String>("pheeraiBomVersion")}"))
|
|
|
|
|
2020-09-20 12:24:18 +02:00
|
|
|
testImplementation("io.kotest", "kotest-runner-junit5-jvm")
|
|
|
|
testImplementation("io.kotest", "kotest-assertions-core-jvm")
|
2020-04-19 12:40:12 +02:00
|
|
|
}
|
|
|
|
|
2020-05-01 15:44:45 +02:00
|
|
|
tasks {
|
|
|
|
withType<KotlinCompile>().configureEach {
|
|
|
|
kotlinOptions {
|
2020-08-23 23:11:41 +02:00
|
|
|
apiVersion = getFromExtra("kotlinApiVersion")
|
|
|
|
languageVersion = getFromExtra("kotlinApiVersion")
|
|
|
|
jvmTarget = getFromExtra<JavaVersion>("javaVersion").toString()
|
2020-05-01 15:44:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2020-04-04 13:37:27 +02:00
|
|
|
}
|
2020-05-08 15:07:30 +02:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
2021-03-06 19:38:37 +01:00
|
|
|
create<MavenPublication>("QueryBuilder") {
|
2020-05-08 15:07:30 +02:00
|
|
|
from(components["java"])
|
|
|
|
}
|
2021-03-06 19:38:37 +01:00
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url = uri("https://git.f3l.de/api/v4/projects/180/packages/maven")
|
|
|
|
name = "GitLab"
|
|
|
|
credentials(HttpHeaderCredentials::class.java) {
|
|
|
|
name = "Job-Token"
|
|
|
|
value = System.getenv("CI_JOB_TOKEN")
|
|
|
|
}
|
|
|
|
authentication {
|
|
|
|
create<HttpHeaderAuthentication>("header")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-08 15:07:30 +02:00
|
|
|
}
|
|
|
|
}
|