-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #8
- Loading branch information
Showing
63 changed files
with
1,148 additions
and
1,268 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,149 +1,35 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
import net.fabricmc.loom.api.LoomGradleExtensionAPI | ||
|
||
val license: String by project | ||
val minecraftVersion: String by project | ||
val modVersion: String by project | ||
val modPackage: String by project | ||
val modId: String by project | ||
val modName: String by project | ||
val modAuthor: String by project | ||
val modDescription: String by project | ||
val parchmentVersion: String by project | ||
val forgeVersion: String by project | ||
val kjsVersion: String by project | ||
val eioVersion: String by project | ||
val jeiVersion: String by project | ||
val githubUser: String by project | ||
val githubRepo: String by project | ||
|
||
plugins { | ||
id("dev.architectury.loom") version "1.2.+" // TODO: update to 1.3.+ when JiJ fix is forward ported | ||
id("io.github.juuxel.loom-vineflower") version "1.11.0" | ||
id("com.github.gmazzo.buildconfig") version "4.0.4" | ||
java | ||
`maven-publish` | ||
id("net.neoforged.moddev") version "2.0.30-beta" | ||
id("com.almostreliable.almostgradle") version "1.1.1" | ||
} | ||
|
||
base { | ||
version = "$minecraftVersion-$modVersion" | ||
archivesName.set("$modId-forge") | ||
almostgradle.setup { | ||
withSourcesJar = false | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
|
||
forge { | ||
mixinConfig("$modId.mixins.json") | ||
} | ||
|
||
if (project.findProperty("enableAccessWidener") == "true") { | ||
accessWidenerPath.set(file("src/main/resources/$modId.accesswidener")) | ||
forge { | ||
convertAccessWideners.set(true) | ||
extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name) | ||
repositories { | ||
// KubeJS | ||
maven("https://maven.latvian.dev/releases") | ||
maven("https://jitpack.io") { // Animated Gif Library | ||
content { | ||
includeGroup("com.github.rtyley") | ||
} | ||
println("Access widener enabled for project. Access widener path: ${loom.accessWidenerPath.get()}") | ||
} | ||
} | ||
|
||
repositories { | ||
maven("https://maven.parchmentmc.org") // Parchment | ||
maven("https://maven.latvian.dev/releases") // KubeJS | ||
maven("https://maven.rover656.dev/releases") // EnderIO | ||
maven("https://dogforce-games.com/maven") // GraphLib for EnderIO | ||
maven("https://maven.tterrag.com") // Registrate for EnderIO | ||
maven("https://maven.blamejared.com") // JEI | ||
// EnderIO | ||
maven("https://maven.rover656.dev/releases") | ||
|
||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
// Minecraft | ||
minecraft("com.mojang:minecraft:$minecraftVersion") | ||
mappings(loom.layered { | ||
officialMojangMappings() | ||
parchment("org.parchmentmc.data:parchment-$minecraftVersion:$parchmentVersion@zip") | ||
}) | ||
|
||
// Forge | ||
forge("net.minecraftforge:forge:$minecraftVersion-$forgeVersion") | ||
|
||
// KubeJS | ||
modImplementation("dev.latvian.mods:kubejs-forge:$kjsVersion") | ||
localRuntime("io.github.llamalad7:mixinextras-forge:0.2.0-rc.4") | ||
implementation("dev.latvian.mods:kubejs-neoforge:${almostgradle.getProperty("kjsVersion")}") | ||
|
||
// EnderIO | ||
modImplementation("com.enderio:EnderIO:$minecraftVersion-$eioVersion") | ||
modLocalRuntime("com.tterrag.registrate:Registrate:MC1.20-1.3.11") | ||
localRuntime("dev.gigaherz.graph:GraphLib3:3.0.4") | ||
|
||
// JEI | ||
modLocalRuntime("mezz.jei:jei-$minecraftVersion-forge:$jeiVersion") { isTransitive = false } | ||
} | ||
|
||
tasks { | ||
processResources { | ||
val resourceTargets = listOf("META-INF/mods.toml", "pack.mcmeta") | ||
|
||
val replaceProperties = mapOf( | ||
"license" to license, | ||
"minecraftVersion" to minecraftVersion, | ||
"version" to project.version as String, | ||
"modId" to modId, | ||
"modName" to modName, | ||
"modAuthor" to modAuthor, | ||
"modDescription" to modDescription, | ||
"forgeVersion" to forgeVersion, | ||
// use major version for FML only because wrong Forge version error message | ||
// is way better than FML error message | ||
"forgeFMLVersion" to forgeVersion.substringBefore("."), | ||
"kjsVersion" to kjsVersion, | ||
"eioVersion" to eioVersion, | ||
"githubUser" to githubUser, | ||
"githubRepo" to githubRepo | ||
) | ||
|
||
println("[Process Resources] Replacing resource properties: ") | ||
replaceProperties.forEach { (key, value) -> println("\t -> $key = $value") } | ||
|
||
inputs.properties(replaceProperties) | ||
filesMatching(resourceTargets) { | ||
expand(replaceProperties) | ||
} | ||
} | ||
|
||
withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.release.set(17) | ||
} | ||
|
||
withType<GenerateModuleMetadata> { | ||
enabled = false | ||
implementation("com.enderio:enderio-machines:${almostgradle.getProperty("eioVersion")}") | ||
implementation("com.enderio:enderio-conduits:${almostgradle.getProperty("eioVersion")}") | ||
implementation("com.enderio:enderio-conduits-modded:${almostgradle.getProperty("eioVersion")}") { | ||
isTransitive = false | ||
} | ||
} | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
|
||
extensions.configure<LoomGradleExtensionAPI> { | ||
runs { | ||
forEach { | ||
val dir = "run/${it.environment}" | ||
println("[Run Config] '${it.name}' directory: $dir") | ||
it.runDir(dir) | ||
// allows DCEVM hot-swapping when using the JBR (https://github.com/JetBrains/JetBrainsRuntime) | ||
it.vmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") | ||
} | ||
} | ||
} | ||
|
||
buildConfig { | ||
buildConfigField("String", "MOD_ID", "\"$modId\"") | ||
buildConfigField("String", "MOD_NAME", "\"$modName\"") | ||
buildConfigField("String", "MOD_VERSION", "\"$version\"") | ||
packageName(modPackage) | ||
className("KubeIOConstants") | ||
useJavaOutput() | ||
} |
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,35 +1,26 @@ | ||
# Project | ||
group = com.almostreliable.mods | ||
license = All Rights Reserved | ||
loom.platform = forge | ||
enableAccessWidener = false | ||
|
||
# Minecraft | ||
minecraftVersion = 1.20.1 | ||
|
||
# Mod | ||
modVersion = 0.6.0 | ||
modPackage = com.almostreliable.kubeio | ||
# required properties | ||
group = com.almostreliable | ||
modId = kubejs_enderio | ||
modName = KubeJS-EnderIO | ||
modName = KubeJS EnderIO | ||
modVersion = 0.6.0 | ||
minecraftVersion = 1.21.1 | ||
neoforgeVersion = 21.1.71 | ||
|
||
# replacement properties | ||
modAuthor = Almost Reliable | ||
modDescription = KubeJS integration for EnderIO. | ||
|
||
# Project Dependencies | ||
parchmentVersion = 2023.09.03 | ||
|
||
# Forge Dependencies | ||
forgeVersion = 47.1.3 | ||
|
||
# Mod Dependencies | ||
kjsVersion = 2001.6.5-build.14 | ||
eioVersion = 6.2.0-beta | ||
jeiVersion = 15.2.0.27 | ||
|
||
# Github | ||
license = All Rights Reserved | ||
githubUser = AlmostReliable | ||
githubRepo = kubejs-enderio | ||
githubRepo = kubejs_enderio | ||
|
||
# mod dependencies | ||
kjsVersion = 2101.7.1-build.181 | ||
eioVersion = 7.0.8-alpha | ||
|
||
# Gradle | ||
org.gradle.jvmargs = -Xmx3G | ||
org.gradle.daemon = false | ||
# settings | ||
neoForge.parchment.minecraftVersion = 1.21 | ||
neoForge.parchment.mappingsVersion = 2024.07.28 | ||
almostgradle.buildconfig.name = ModConstants | ||
almostgradle.launchArgs.autoWorldJoin = true | ||
almostgradle.recipeViewers.jei.runConfig = true | ||
almostgradle.recipeViewers.jei.version = 19.21.0.246 |
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-8.1.1-bin.zip | ||
distributionUrl = https\://services.gradle.org/distributions/gradle-8.8-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,13 +1,9 @@ | ||
pluginManagement { | ||
repositories { | ||
maven("https://maven.architectury.dev/") | ||
maven("https://maven.fabricmc.net/") | ||
maven("https://maven.minecraftforge.net/") | ||
maven("https://maven.moddingx.org") | ||
gradlePluginPortal() | ||
} | ||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} | ||
|
||
val modName = extra.get("modName").toString().replace(" ", "-") | ||
val modName: String by extra | ||
val minecraftVersion: String by extra | ||
rootProject.name = "$modName-$minecraftVersion-Forge" | ||
rootProject.name = "${modName.replace(" ", "-")}-$minecraftVersion-NeoForge" | ||
|
||
enableFeaturePreview("STABLE_CONFIGURATION_CACHE") |
Oops, something went wrong.