1+ plugins {
2+ id(" net.neoforged.moddev" ) version " 2.0.80"
3+ }
4+
5+ class ModData {
6+ val id = property(" mod.id" ).toString()
7+ val name = property(" mod.name" ).toString()
8+ val version = property(" mod.version" ).toString()
9+ val group = property(" mod.group" ).toString()
10+ }
11+
12+ val mod = ModData ()
13+ val mcVersion = stonecutter.current.version
14+ val mcDep = property(" mod.mc_dep" ).toString()
15+
16+ version = " ${mod.version} +${mcVersion} -neoforge"
17+ group = mod.group
18+ base {
19+ archivesName.set(mod.name)
20+ }
21+
22+ neoForge {
23+ version = property(" deps.neoforge" ).toString()
24+
25+ runs {
26+ create(" client" ) {
27+ client()
28+ }
29+ }
30+
31+ mods {
32+ create(" imgui_mc" ) {
33+ sourceSet(sourceSets.main.get())
34+ }
35+ }
36+ }
37+
38+ tasks.register<Copy >(" buildAndCollect" ) {
39+ group = " build"
40+ from(tasks.jar.get().archiveFile)
41+ into(rootProject.layout.buildDirectory.file(" libs/${mod.version} " ))
42+ dependsOn(" build" )
43+ }
44+
45+ tasks.processResources {
46+ inputs.property(" id" , mod.id)
47+ inputs.property(" name" , mod.name)
48+ inputs.property(" version" , mod.version)
49+ inputs.property(" mcdep" , mcDep)
50+
51+ val map = mapOf (
52+ " id" to mod.id,
53+ " name" to mod.name,
54+ " version" to mod.version,
55+ " mcdep" to mcDep
56+ )
57+
58+ filesMatching(" META-INF/mods.toml" ) { expand(map) }
59+ filesMatching(" META-INF/neoforge.mods.toml" ) { expand(map) }
60+ }
61+
62+ tasks.jar {
63+ duplicatesStrategy = DuplicatesStrategy .EXCLUDE
64+ from(zipTree(project(" :$mcVersion " ).tasks.jar.get().archiveFile))
65+ }
0 commit comments