-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
1 parent
0a1114b
commit 7a2caf6
Showing
11 changed files
with
108 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation("com.github.johnrengelman:shadow:8.1.1") | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "build-logic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import org.gradle.kotlin.dsl.`java-library` | ||
|
||
plugins { | ||
`java-library` | ||
} |
25 changes: 25 additions & 0 deletions
25
build-logic/src/main/kotlin/pack.publish-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
version = "3.1-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" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
plugins { | ||
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") | ||
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("*") | ||
} | ||
|
||
archiveFileName.set("PackConverter-lib.jar") | ||
archiveClassifier.set("") | ||
java { | ||
withSourcesJar() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
dependencies { | ||
api(project(":bedrock-pack-schema")) | ||
compileOnlyApi(project(":bedrock-pack-schema")) // Available on compile, but not runtime classpath - we shade it in task below | ||
implementation("com.google.code.gson:gson:2.10.1") | ||
implementation("org.jetbrains:annotations:24.0.1") | ||
} | ||
} | ||
|
||
val bedrockPackSchemaSourceSet = project(":bedrock-pack-schema").sourceSets.getByName("main") | ||
|
||
tasks.jar { | ||
from(bedrockPackSchemaSourceSet.output) | ||
duplicatesStrategy = DuplicatesStrategy.WARN | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters