-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gradle): Update and improve gradle
- Loading branch information
1 parent
eef38dc
commit fe0b0c8
Showing
7 changed files
with
90 additions
and
158 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
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 |
---|---|---|
@@ -1,91 +1,27 @@ | ||
@file:Suppress("DEPRECATION") | ||
|
||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
import net.fabricmc.loom.task.RemapJarTask | ||
|
||
plugins { | ||
id("com.github.johnrengelman.shadow") version "7.1.2" | ||
loom { | ||
accessWidenerPath.set(project(":common").loom.accessWidenerPath) | ||
} | ||
|
||
val minecraftVersion: String by extra | ||
val neoforgeVersion: String by extra | ||
val neoforgeLoaderRange: String by extra | ||
val modVersion: String by extra | ||
val jeiVersion: String by extra | ||
val resourcefullibVersion: String by extra | ||
val resourcefullibRange: String by extra | ||
val botariumVersion: String by extra | ||
val botariumRange: String by extra | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
neoForge() | ||
} | ||
|
||
loom { | ||
accessWidenerPath.set(project(":common").loom.accessWidenerPath) | ||
} | ||
|
||
val common by configurations.creating | ||
val shadowCommon by configurations.creating | ||
|
||
configurations["compileClasspath"].extendsFrom(common) | ||
configurations["runtimeClasspath"].extendsFrom(common) | ||
configurations["developmentNeoForge"].extendsFrom(common) | ||
|
||
repositories { | ||
maven(url = "https://maven.neoforged.net/") | ||
} | ||
val architecturyRange: String by extra | ||
|
||
dependencies { | ||
neoForge("net.neoforged:neoforge:$neoforgeVersion") | ||
|
||
|
||
modApi("com.teamresourceful.resourcefullib:resourcefullib-neoforge-$minecraftVersion:$resourcefullibVersion") | ||
//modApi("earth.terrarium.botarium:botarium-neoforge-$minecraftVersion:$botariumVersion") | ||
|
||
modCompileOnly("mezz.jei:jei-$minecraftVersion-neoforge-api:$jeiVersion") | ||
modLocalRuntime("mezz.jei:jei-$minecraftVersion-forge:$jeiVersion") { isTransitive = false } | ||
|
||
common(project(path = ":common", configuration = "namedElements")) { isTransitive = false } | ||
shadowCommon(project(path = ":common", configuration = "transformProductionNeoForge")) { isTransitive = false } | ||
} | ||
|
||
tasks.withType<ProcessResources> { | ||
val replaceProperties = mapOf("neoforgeLoaderRange" to neoforgeLoaderRange, "minecraftVersion" to minecraftVersion, "modVersion" to modVersion, "resourcefullibRange" to resourcefullibRange, "botariumRange" to botariumRange) | ||
val replaceProperties = mapOf("neoforgeLoaderRange" to neoforgeLoaderRange, "minecraftVersion" to minecraftVersion, "modVersion" to modVersion, "architecturyRange" to architecturyRange) | ||
inputs.properties(replaceProperties) | ||
|
||
filesMatching("META-INF/neoforge.mods.toml") { | ||
expand(replaceProperties) | ||
} | ||
} | ||
|
||
tasks.withType<ShadowJar> { | ||
exclude("fabric.mod.json") | ||
|
||
configurations = listOf(shadowCommon) | ||
archiveClassifier.set("dev-shadow") | ||
} | ||
|
||
tasks.withType<RemapJarTask> { | ||
val shadowTask = tasks.shadowJar.get() | ||
input.set(shadowTask.archiveFile) | ||
dependsOn(shadowTask) | ||
archiveClassifier.set("") | ||
} | ||
|
||
tasks.jar { | ||
archiveClassifier.set("dev") | ||
} | ||
|
||
tasks.sourcesJar { | ||
val commonSources = project(":common").tasks.sourcesJar.get() | ||
dependsOn(commonSources) | ||
from(commonSources.archiveFile.map { zipTree(it) }) | ||
} | ||
|
||
components.getByName<AdhocComponentWithVariants>("java").apply { | ||
withVariantsFromConfiguration(project.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