-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to old project setup until plugin is released
- Loading branch information
Showing
5 changed files
with
135 additions
and
76 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,40 +1,130 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
val license: String by project | ||
val loggingLevel: String by project | ||
val mixinDebugExport: String by project | ||
val mcVersion: 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 neoVersion: String by project | ||
val parchmentVersion: String by project | ||
val aeVersion: String by project | ||
val emiVersion: String by project | ||
val githubUser: String by project | ||
val githubRepo: String by project | ||
|
||
plugins { | ||
id("net.neoforged.moddev") version "2.0.+" | ||
id("com.almostreliable.almostgradle") | ||
id("com.github.gmazzo.buildconfig") version "4.0.4" | ||
java | ||
} | ||
|
||
almostgradle.setup { | ||
withSourcesJar = false | ||
recipeViewers.emi.mavenRepository | ||
base { | ||
version = "$mcVersion-$modVersion" | ||
group = modPackage | ||
archivesName.set("$modId-neoforge") | ||
} | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(21) | ||
|
||
neoForge { | ||
version = neoVersion | ||
|
||
mods { | ||
create("merequester") { | ||
modSourceSets.add(sourceSets.main) | ||
} | ||
} | ||
|
||
runs { | ||
configureEach { | ||
gameDirectory = project.file("run") | ||
systemProperties = mapOf( | ||
"forge.logging.console.level" to loggingLevel, | ||
"mixin.debug.export" to mixinDebugExport, | ||
"guideDev.ae2guide.sources" to file("guidebook").absolutePath, | ||
"guideDev.ae2guide.sourcesNamespace" to almostgradle.modId | ||
"guideDev.ae2guide.sourcesNamespace" to modId | ||
) | ||
jvmArguments.addAll("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") | ||
} | ||
create("client") { | ||
client() | ||
programArguments.addAll("--quickPlaySingleplayer", "New World") | ||
} | ||
|
||
create("guide") { | ||
client() | ||
systemProperty("guideDev.ae2guide.startupPage", "${almostgradle.modId}:${almostgradle.modId}.md") | ||
systemProperty("guideDev.ae2guide.startupPage", "$modId:$modId.md") | ||
} | ||
create("server") { | ||
server() | ||
} | ||
} | ||
|
||
parchment { | ||
minecraftVersion = "1.21" | ||
mappingsVersion = parchmentVersion | ||
} | ||
} | ||
|
||
repositories { | ||
maven("https://modmaven.dev") | ||
maven("https://modmaven.dev") // Applied Energistics 2 | ||
maven("https://maven.blamejared.com") // JEI | ||
maven("https://maven.shedaniel.me") // REI | ||
maven("https://maven.terraformersmc.com") // EMI | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
implementation("appeng:appliedenergistics2:${almostgradle.getProperty("aeVersion")}") | ||
implementation("appeng:appliedenergistics2:$aeVersion") | ||
runtimeOnly("dev.emi:emi-neoforge:$emiVersion+1.21") | ||
} | ||
|
||
tasks.withType<Jar> { | ||
from("guidebook") { | ||
into("assets/${almostgradle.modId}/ae2guide") | ||
tasks { | ||
processResources { | ||
val resourceTargets = listOf("META-INF/neoforge.mods.toml", "pack.mcmeta") | ||
|
||
val replaceProperties = mapOf( | ||
"license" to license, | ||
"mcVersion" to mcVersion, | ||
"version" to project.version as String, | ||
"modId" to modId, | ||
"modName" to modName, | ||
"modAuthor" to modAuthor, | ||
"modDescription" to modDescription, | ||
"neoVersion" to neoVersion, | ||
"aeVersion" to aeVersion, | ||
"githubUser" to githubUser, | ||
"githubRepo" to githubRepo | ||
) | ||
|
||
println("[Process Resources] Replacing properties in resources: ") | ||
replaceProperties.forEach { (key, value) -> println("\t -> $key = $value") } | ||
|
||
inputs.properties(replaceProperties) | ||
filesMatching(resourceTargets) { | ||
expand(replaceProperties) | ||
} | ||
} | ||
|
||
withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
withType<Jar> { | ||
from("guidebook") { | ||
into("assets/$modId/ae2guide") | ||
} | ||
} | ||
} | ||
|
||
buildConfig { | ||
buildConfigField("String", "MOD_ID", "\"$modId\"") | ||
buildConfigField("String", "MOD_NAME", "\"$modName\"") | ||
buildConfigField("String", "MOD_VERSION", "\"$version\"") | ||
packageName(modPackage) | ||
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,26 +1,30 @@ | ||
group = com.almostreliable | ||
# Project | ||
license = GNU Lesser General Public License v3.0 | ||
loom.platform = neoforge | ||
|
||
# Settings | ||
loggingLevel = debug | ||
mixinDebugExport = false | ||
|
||
# Minecraft | ||
mcVersion = 1.21.1 | ||
|
||
# Mod | ||
modVersion = 1.1.7 | ||
modPackage = com.almostreliable.merequester | ||
modId = merequester | ||
modName = ME Requester | ||
modVersion = 1.1.6 | ||
minecraftVersion = 1.21.1 | ||
neoforgeVersion = 21.1.36 | ||
|
||
modAuthor = Almost Reliable | ||
modDescription = Keep items and fluids in your ME-System in stock. | ||
license = GNU Lesser General Public License v3.0 | ||
githubUser = AlmostReliable | ||
githubRepo = merequester | ||
modDescription = Keep resources in your ME-System in stock. | ||
|
||
# Project Dependencies | ||
neoForge.parchment.minecraftVersion = 1.21 | ||
neoForge.parchment.mappingsVersion = 2024.07.28 | ||
neoVersion = 21.1.36 | ||
parchmentVersion = 2024.07.28 | ||
|
||
# Mod Dependencies | ||
aeVersion = 19.0.18-beta | ||
aeVersion = 19.0.20-beta | ||
emiVersion = 1.1.12 | ||
|
||
# Settings | ||
almostgradle.buildconfig.name = ModConstants | ||
almostgradle.launchArgs.autoWorldJoin = true | ||
almostgradle.recipeViewers.emi.runConfig = true | ||
almostgradle.recipeViewers.emi.version = 1.1.12 | ||
almostgradle.recipeViewers.emi.minecraftVersion = 1.21 | ||
# Github | ||
githubUser = AlmostReliable | ||
githubRepo = merequester |
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