Skip to content

Commit

Permalink
Attempt at fixing published artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Mar 11, 2024
1 parent 9788138 commit b7806d5
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 68 deletions.
18 changes: 12 additions & 6 deletions bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
plugins {
id("application")
`java-library`
application
id("com.github.johnrengelman.shadow") version "7.1.0"
}

sourceSets {
main {
resources {
srcDir("src/main/java/resources")
}
}
}

dependencies {
Expand All @@ -11,10 +21,6 @@ application {
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
from("src/main/java/resources") {
include("*")
}

archiveFileName.set("PackConverter.jar")
archiveFileName.set("PackConverter-Standalone.jar")
archiveClassifier.set("")
}
8 changes: 8 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
mavenCentral()
}
1 change: 1 addition & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "build-logic"
5 changes: 5 additions & 0 deletions build-logic/src/main/kotlin/pack.base-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import org.gradle.kotlin.dsl.`java-library`

plugins {
`java-library`
}
14 changes: 14 additions & 0 deletions build-logic/src/main/kotlin/pack.publish-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
`maven-publish`
}

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"
}
}
}
52 changes: 4 additions & 48 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,57 +1,13 @@
plugins {
id("java")
id("java-library")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "7.1.0"
id("io.freefair.lombok") version "6.3.0" apply false
id("pack.base-conventions")
}

allprojects {
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "io.freefair.lombok")

repositories {
mavenLocal()
mavenCentral()

gradlePluginPortal()

// Geyser, Floodgate, Cumulus etc.
maven("https://repo.opencollab.dev/main")
maven("https://repo.opencollab.dev/maven-snapshots")

// Java pack library
maven("https://repo.unnamed.team/repository/unnamed-public/")
}

subprojects{
plugins.apply("pack.base-conventions")
plugins.apply("pack.publish-conventions")
group = "org.geysermc.pack"
version = "3.0-SNAPSHOT"

java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17

tasks.jar {
archiveClassifier.set("unshaded")
}

tasks.named("build") {
dependsOn(tasks.shadowJar)
}

publishing {
publications.create<MavenPublication>("library") {
artifact(tasks.shadowJar)
}
val repoName = if (version.toString().endsWith("SNAPSHOT")) "maven-snapshots" else "maven-releases"
repositories {
maven("https://repo.opencollab.dev/${repoName}/") {
credentials.username = System.getenv("OPENCOLLAB_USERNAME")
credentials.password = System.getenv("OPENCOLLAB_PASSWORD")
name = "opencollab"
}
}
}
}
42 changes: 29 additions & 13 deletions converter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
plugins {
application
id("io.freefair.lombok") version "8.6"
}

sourceSets {
main {
resources {
srcDir("src/main/java/resources")
}
}
}

dependencies {
api(project(":pack-schema-api"))
implementation("com.google.code.gson:gson:2.10.1")
implementation("commons-io:commons-io:2.11.0")
compileOnly("com.google.code.gson:gson:2.10.1")
compileOnly("commons-io:commons-io:2.11.0")
implementation("com.twelvemonkeys.imageio:imageio-tga:3.9.4")
implementation("com.nukkitx.fastutil:fastutil-int-object-maps:8.5.3")
implementation("net.kyori:adventure-api:4.14.0")
implementation("net.kyori:adventure-text-serializer-gson:4.14.0")
implementation("net.kyori:adventure-text-serializer-legacy:4.14.0")
implementation("team.unnamed:creative-api:1.7.0")
implementation("team.unnamed:creative-serializer-minecraft:1.7.0")
api("net.kyori:adventure-api:4.14.0")
api("net.kyori:adventure-text-serializer-gson:4.14.0")
api("net.kyori:adventure-text-serializer-legacy:4.14.0")
api("team.unnamed:creative-api:1.7.0")
api("team.unnamed:creative-serializer-minecraft:1.7.0")

compileOnly("com.google.auto.service:auto-service:1.0.1")
annotationProcessor("com.google.auto.service:auto-service:1.0.1")
}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
from("src/main/java/resources") {
include("*")
}
java {
withSourcesJar()
}

archiveFileName.set("PackConverter-lib.jar")
archiveClassifier.set("")
publishing {
publications {
register("publish", MavenPublication::class) {
from(project.components["java"])
}
}
}
21 changes: 20 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("UnstableApiUsage")

rootProject.name = "packconverter-parent"

include(":bootstrap")
Expand All @@ -9,4 +11,21 @@ include(":schema-generator")

project(":pack-schema-api").projectDir = file("pack-schema/api")
project(":bedrock-pack-schema").projectDir = file("pack-schema/bedrock")
project(":schema-generator").projectDir = file("pack-schema/generator")
project(":schema-generator").projectDir = file("pack-schema/generator")

pluginManagement {
includeBuild("build-logic")
}

dependencyResolutionManagement {
repositories {
mavenCentral()

// Geyser, Floodgate, Cumulus etc.
maven("https://repo.opencollab.dev/main")
maven("https://repo.opencollab.dev/maven-snapshots")

// Java pack library
maven("https://repo.unnamed.team/repository/unnamed-public/")
}
}

0 comments on commit b7806d5

Please sign in to comment.