Skip to content

Commit

Permalink
Fix JAR shadowing, setup publication.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Sep 30, 2024
1 parent 265bb46 commit 6b48dee
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 26 deletions.
17 changes: 17 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,20 @@ plugins {
}

base.archivesName.set(Constants.NAME + "-api")

// Configure the maven publication.
publishing {
publications {
create("mavenJava", MavenPublication::class) {
from(components["java"])

groupId = "$group.lambdynamiclights"
artifactId = "lambdynamiclights-api"

pom {
name.set("LambDynamicLights (API)")
description.set("API for LambDynamicLights, a mod which adds dynamic lighting to Minecraft.")
}
}
}
}
41 changes: 16 additions & 25 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,18 @@ dependencies {

modRuntimeOnly(libs.sodium)

shadow(project(":api", configuration = "namedElements"))
shadow(libs.yumi.commons.core)
shadow(libs.yumi.commons.collections)
shadow(libs.yumi.commons.event)
shadow(project(":api", configuration = "namedElements")) {
isTransitive = false
}
shadow(libs.yumi.commons.core) {
isTransitive = false
}
shadow(libs.yumi.commons.collections) {
isTransitive = false
}
shadow(libs.yumi.commons.event) {
isTransitive = false
}
shadow(libs.nightconfig.core)
shadow(libs.nightconfig.toml)
}
Expand Down Expand Up @@ -174,29 +182,12 @@ publishing {
create("mavenJava", MavenPublication::class) {
from(components["java"])

groupId = "$group.lambdynamiclights"
artifactId = "lambdynamiclights-runtime"

pom {
name.set("LambDynamicLights")
description.set("Adds dynamic lights to Minecraft.")
}
}
}

repositories {
mavenLocal()
maven {
name = "BuildDirLocal"
url = uri("${project.layout.buildDirectory.get()}/repo")
}

val ldlMaven = System.getenv("LDL_MAVEN")
if (ldlMaven != null) {
maven {
name = "LambDynamicLightsMaven"
url = uri(ldlMaven)
credentials {
username = (project.findProperty("gpr.user") as? String) ?: System.getenv("MAVEN_USERNAME")
password = (project.findProperty("gpr.key") as? String) ?: System.getenv("MAVEN_PASSWORD")
}
description.set("Adds dynamic lighting to Minecraft.")
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions build_logic/src/main/kotlin/lambdynamiclights.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.gradle.accessors.dm.LibrariesForLibs
plugins {
id("fabric-loom")
`java-library`
`maven-publish`
id("dev.yumi.gradle.licenser")
}

Expand Down Expand Up @@ -55,3 +56,25 @@ tasks.jar {
license {
rule(rootProject.file("HEADER"))
}

publishing {
repositories {
mavenLocal()
maven {
name = "BuildDirLocal"
url = uri("${rootProject.layout.buildDirectory.get()}/repo")
}

val ldlMaven = System.getenv("LDL_MAVEN")
if (ldlMaven != null) {
maven {
name = "LambDynamicLightsMaven"
url = uri(ldlMaven)
credentials {
username = (project.findProperty("gpr.user") as? String) ?: System.getenv("MAVEN_USERNAME")
password = (project.findProperty("gpr.key") as? String) ?: System.getenv("MAVEN_PASSWORD")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public abstract class LevelMixin {
)
private void onBlockEntityTick(
CallbackInfo ci,
Profiler profiler, Iterator<BlockEntity> iterator, boolean isRemoved, TickingBlockEntity blockEntityTickInvoker
Profiler profiler, Iterator<TickingBlockEntity> iterator,
boolean isRemoved, TickingBlockEntity blockEntityTickInvoker
) {
if (this.isClientSide() && LambDynLights.get().config.getBlockEntitiesLightSource().get() && !isRemoved) {
var blockEntity = this.getBlockEntity(blockEntityTickInvoker.getPos());
Expand Down

0 comments on commit 6b48dee

Please sign in to comment.