Skip to content

Commit

Permalink
minor gradle refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Feb 12, 2024
1 parent 78bbac0 commit 74988e0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ plugins {
setup()
setupForgix()

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}

allprojects {
apply(plugin = "java")

Expand Down Expand Up @@ -103,3 +98,8 @@ fun setupForgix() {

apply(plugin = "postprocessor")
}

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}
15 changes: 7 additions & 8 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}

architectury {
common {
for(project in rootProject.subprojects) {
if(project.path == ":common") continue
this.add(project.name)
for(p in rootProject.subprojects) {
if(p != project) add(p.name)
}
}
}
Expand All @@ -27,3 +21,8 @@ tasks.processResources {
rename { "${it}_${"archives_base_name"()}" }
}
}

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public abstract class ExtendoGripItemMixin {
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/class_1297;Lnet/minecraft/class_2487;)V", // fabric obf
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;rangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> mainSingle(Supplier<?> original) {
private static Supplier<Multimap<Attribute, AttributeModifier>> modifySingle(Supplier<?> original) {
return singleRange();
}

Expand All @@ -45,7 +45,7 @@ private static Supplier<Multimap<Attribute, AttributeModifier>> mainSingle(Suppl
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraft/class_1297;Lnet/minecraft/class_2487;)V", // fabric obf
"addReachToJoiningPlayersHoldingExtendo(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V" // forge
}, at = @At(value = "FIELD", target = "Lcom/simibubi/create/content/equipment/extendoGrip/ExtendoGripItem;doubleRangeModifier:Ljava/util/function/Supplier;"))
private static Supplier<Multimap<Attribute, AttributeModifier>> mainDouble(Supplier<?> original) {
private static Supplier<Multimap<Attribute, AttributeModifier>> modifyDouble(Supplier<?> original) {
return doubleRange();
}
}
14 changes: 8 additions & 6 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
plugins {
id("com.github.johnrengelman.shadow")
id("platform")
}

apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "platform")

architectury.fabric()

configurations {
Expand Down Expand Up @@ -36,3 +33,8 @@ dependencies {
tasks.remapJar {
injectAccessWidener.set(true)
}

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}
18 changes: 9 additions & 9 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
plugins {
id("com.github.johnrengelman.shadow")
id("platform")
}

apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "platform")

architectury.forge()

configurations {
Expand Down Expand Up @@ -41,6 +36,11 @@ loom {
}
}

tasks.named<ShadowJar>("shadowJar") {
tasks.shadowJar {
exclude("fabric.mod.json")
}

operator fun String.invoke(): String {
return rootProject.ext[this] as? String
?: throw IllegalStateException("Property $this is not defined")
}

0 comments on commit 74988e0

Please sign in to comment.