mirror of
https://github.com/GeyserMC/PackConverter.git
synced 2025-12-21 15:59:20 +00:00
Proper publishing setup (#17)
* Attempt at fixing published artifact * wohoo it works * attempt at excluding bootstrap's shadow jar from publishing * Update gradle, fix publishing (aka, dont publish shadowed bootstrap build to maven) * Don't apply shadow plugin for the converter * why are we publishing the lib as an artifact...? * make these implementation * Shade bedrock-pack-schema into pack-schema-api
This commit is contained in:
12
build-logic/build.gradle.kts
Normal file
12
build-logic/build.gradle.kts
Normal file
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.github.johnrengelman:shadow:8.1.1")
|
||||
}
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
1
build-logic/settings.gradle.kts
Normal file
1
build-logic/settings.gradle.kts
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = "build-logic"
|
||||
@@ -0,0 +1,5 @@
|
||||
import org.gradle.kotlin.dsl.`java-library`
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
plugins {
|
||||
`maven-publish` apply true
|
||||
id("com.github.johnrengelman.shadow") apply false
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
val repoName = if (version.toString().endsWith("SNAPSHOT")) "maven-snapshots" else "maven-releases"
|
||||
maven("https://repo.opencollab.dev/${repoName}/") {
|
||||
credentials.username = System.getenv("OPENCOLLAB_USERNAME")
|
||||
credentials.password = System.getenv("OPENCOLLAB_PASSWORD")
|
||||
name = "opencollab"
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
register("publish", MavenPublication::class) {
|
||||
from(project.components["java"])
|
||||
|
||||
// skip shadow jar from publishing. Workaround for https://github.com/johnrengelman/shadow/issues/651
|
||||
val javaComponent = project.components["java"] as AdhocComponentWithVariants
|
||||
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user