1
0
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:
chris
2024-03-13 15:34:58 +01:00
committed by GitHub
parent 0a1114b22f
commit 7a2caf6f5d
11 changed files with 108 additions and 79 deletions

View File

@@ -0,0 +1,12 @@
plugins {
`kotlin-dsl`
}
dependencies {
implementation("com.github.johnrengelman:shadow:8.1.1")
}
repositories {
gradlePluginPortal()
mavenCentral()
}

View File

@@ -0,0 +1 @@
rootProject.name = "build-logic"

View File

@@ -0,0 +1,5 @@
import org.gradle.kotlin.dsl.`java-library`
plugins {
`java-library`
}

View File

@@ -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() }
}
}
}