Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-19 14:30:16 +01:00
Configure artifacts for publication
Dieser Commit ist enthalten in:
Ursprung
aaaa97f781
Commit
b6bee8f4cc
@ -68,6 +68,12 @@ subprojects {
|
|||||||
}
|
}
|
||||||
mitLicense()
|
mitLicense()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing.repositories.maven {
|
||||||
|
name = "Via"
|
||||||
|
url = uri("https://repo.viaversion.com/")
|
||||||
|
credentials(PasswordCredentials::class)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.gradle.kotlin.dsl.apply
|
import org.gradle.kotlin.dsl.apply
|
||||||
import org.gradle.kotlin.dsl.invoke
|
import org.gradle.kotlin.dsl.invoke
|
||||||
import org.gradle.kotlin.dsl.withType
|
import org.gradle.kotlin.dsl.withType
|
||||||
@ -10,16 +11,20 @@ fun Project.configureShadowJar() {
|
|||||||
apply<ShadowPlugin>()
|
apply<ShadowPlugin>()
|
||||||
tasks {
|
tasks {
|
||||||
withType<ShadowJar> {
|
withType<ShadowJar> {
|
||||||
archiveClassifier.set("jar")
|
archiveClassifier.set("")
|
||||||
archiveFileName.set("ViaVersion-${project.name.substringAfter("viaversion-").capitalize()}-${project.version}.jar")
|
archiveFileName.set("ViaVersion-${project.name.substringAfter("viaversion-").capitalize()}-${project.version}.jar")
|
||||||
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
||||||
//minimize() // ?
|
|
||||||
configureRelocations()
|
configureRelocations()
|
||||||
configureExcludes()
|
configureExcludes()
|
||||||
}
|
}
|
||||||
getByName("build") {
|
getByName("build") {
|
||||||
dependsOn(withType<ShadowJar>())
|
dependsOn(withType<ShadowJar>())
|
||||||
}
|
}
|
||||||
|
withType<Jar> {
|
||||||
|
if (name == "jar") {
|
||||||
|
archiveClassifier.set("unshaded")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@ setupViaSubproject("velocity")
|
|||||||
setupViaSubproject("sponge")
|
setupViaSubproject("sponge")
|
||||||
setupViaSubproject("sponge-legacy")
|
setupViaSubproject("sponge-legacy")
|
||||||
setupViaSubproject("fabric")
|
setupViaSubproject("fabric")
|
||||||
setupViaSubproject("universal")
|
|
||||||
|
setupSubproject("viaversion") {
|
||||||
|
projectDir = file("universal")
|
||||||
|
}
|
||||||
|
|
||||||
fun setupViaSubproject(name: String) {
|
fun setupViaSubproject(name: String) {
|
||||||
setupSubproject("viaversion-$name") {
|
setupSubproject("viaversion-$name") {
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
|
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
||||||
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
|
||||||
|
apply<ShadowPlugin>()
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
val universalJar = register<Jar>("universalJar") {
|
withType<ShadowJar> {
|
||||||
artifacts.add("archives", this)
|
archiveClassifier.set("")
|
||||||
archiveClassifier.set("jar")
|
|
||||||
archiveFileName.set("ViaVersion-${project.version}.jar")
|
archiveFileName.set("ViaVersion-${project.version}.jar")
|
||||||
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
destinationDirectory.set(rootProject.projectDir.resolve("build/libs"))
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
@ -19,6 +23,11 @@ tasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
build {
|
build {
|
||||||
dependsOn(universalJar)
|
dependsOn(withType<ShadowJar>())
|
||||||
|
}
|
||||||
|
withType<Jar> {
|
||||||
|
if (name == "jar") {
|
||||||
|
archiveClassifier.set("unshaded")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren