2022-07-04 12:08:40 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
plugins {
|
2022-09-29 12:22:07 +02:00
|
|
|
kotlin("jvm") version "1.7.20"
|
2022-07-04 12:08:40 +02:00
|
|
|
kotlin("plugin.serialization") version "1.7.0"
|
|
|
|
id("maven-publish")
|
|
|
|
id("com.github.johnrengelman.shadow") version "7.1.2"
|
2022-07-04 14:39:44 +02:00
|
|
|
id("io.papermc.paperweight.userdev") version "1.3.8"
|
2022-07-04 12:08:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
group = "nl.kallestruik"
|
|
|
|
version = "1.5.0"
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
paperDevBundle("1.19-R0.1-SNAPSHOT")
|
|
|
|
|
|
|
|
implementation(kotlin("reflect"))
|
2022-07-04 15:30:30 +02:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
|
2022-07-04 14:39:42 +02:00
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
|
2022-07-04 12:08:40 +02:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-scripting-common")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm-host")
|
|
|
|
|
|
|
|
testImplementation(kotlin("test-junit5"))
|
2022-07-04 15:30:31 +02:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
2022-07-04 14:39:48 +02:00
|
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
2022-07-04 12:08:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
build {
|
|
|
|
dependsOn(shadowJar)
|
|
|
|
}
|
|
|
|
assemble {
|
|
|
|
dependsOn(reobfJar)
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
|
|
|
withType<KotlinCompile> {
|
|
|
|
kotlinOptions.jvmTarget = "17"
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
expand("version" to project.version)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
val sourcesJar by tasks.creating(Jar::class) {
|
|
|
|
archiveClassifier.set("sources")
|
|
|
|
from(sourceSets["main"].allSource)
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("release") {
|
|
|
|
from(components["kotlin"])
|
|
|
|
artifact(sourcesJar)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url = uri(System.getenv("MAVEN_REPO_URL") ?: "")
|
|
|
|
|
|
|
|
credentials(HttpHeaderCredentials::class) {
|
|
|
|
name = "Authorization"
|
|
|
|
value = "token ${System.getenv("MAVEN_REPO_TOKEN")}"
|
|
|
|
}
|
|
|
|
|
|
|
|
authentication {
|
|
|
|
create<HttpHeaderAuthentication>("Authentication Header")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.optIn("kotlin.RequiresOptIn")
|
|
|
|
languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|