2021-05-29 09:32:55 +02:00
|
|
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
|
|
import org.gradle.jvm.tasks.Jar
|
|
|
|
import org.gradle.kotlin.dsl.named
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("vb.base-conventions")
|
2024-06-03 15:24:16 +02:00
|
|
|
id("maven-publish")
|
2021-05-29 09:32:55 +02:00
|
|
|
id("com.github.johnrengelman.shadow")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks {
|
|
|
|
named<Jar>("jar") {
|
|
|
|
archiveClassifier.set("unshaded")
|
|
|
|
from(project.rootProject.file("LICENSE"))
|
|
|
|
}
|
|
|
|
val shadowJar = named<ShadowJar>("shadowJar") {
|
|
|
|
archiveClassifier.set("")
|
|
|
|
configureRelocations()
|
|
|
|
}
|
|
|
|
named("build") {
|
|
|
|
dependsOn(shadowJar)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-03 15:24:16 +02:00
|
|
|
publishing {
|
|
|
|
publications.create<MavenPublication>("mavenJava") {
|
|
|
|
groupId = rootProject.group as String
|
|
|
|
artifactId = project.name
|
|
|
|
version = rootProject.version as String
|
|
|
|
|
|
|
|
artifact(tasks["shadowJar"])
|
|
|
|
artifact(tasks["sourcesJar"])
|
|
|
|
}
|
|
|
|
repositories.maven {
|
|
|
|
name = "Via"
|
|
|
|
url = uri("https://repo.viaversion.com/")
|
|
|
|
credentials(PasswordCredentials::class)
|
|
|
|
authentication {
|
|
|
|
create<BasicAuthentication>("basic")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-29 09:32:55 +02:00
|
|
|
|
|
|
|
fun ShadowJar.configureRelocations() {
|
|
|
|
relocate("com.google.gson", "com.viaversion.viaversion.libs.gson")
|
|
|
|
relocate("it.unimi.dsi.fastutil", "com.viaversion.viaversion.libs.fastutil")
|
|
|
|
}
|