Skip to content

Commit b26ab37

Browse files
committed
Merge common & forge projects, replace Arch Loom with MDG
1 parent 9c4da7f commit b26ab37

File tree

282 files changed

+350
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+350
-418
lines changed

annotation-processor/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow'
2+
id 'com.gradleup.shadow' version '8.3.9'
33
id 'java-library'
4-
id 'com.diffplug.spotless'
54
}
65

76
repositories {
@@ -52,9 +51,4 @@ shadowJar {
5251
include {it.getName() == 'EnvType.class'}
5352
}
5453

55-
spotless {
56-
java {
57-
removeUnusedImports()
58-
}
59-
}
6054
version = '1.1.4'

annotations/build.gradle

Lines changed: 0 additions & 6 deletions
This file was deleted.

annotations/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins {
2+
id("java")
3+
}
4+
5+
version = "1.1.0"
6+
7+
java {
8+
sourceCompatibility = JavaVersion.VERSION_1_8
9+
targetCompatibility = JavaVersion.VERSION_1_8
10+
}

build.gradle.kts

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
plugins {
2+
id("net.neoforged.moddev.legacyforge") version("2.0.134")
3+
id("org.ajoberstar.grgit") version("5.2.0")
4+
id("com.palantir.git-version") version("1.0.0")
5+
}
6+
7+
val minecraft_version = rootProject.properties["minecraft_version"].toString()
8+
9+
group = "org.embeddedt"
10+
11+
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
12+
// extract base version from tag, generate other metadata ourselves
13+
val details = versionDetails()
14+
15+
var plusIndex = details.lastTag.indexOf("+")
16+
if (plusIndex == -1) {
17+
plusIndex = details.lastTag.length
18+
}
19+
20+
var baseVersion = details.lastTag.substring(0, plusIndex)
21+
22+
val dirtyMarker = if (grgit.status().isClean) "" else ".dirty"
23+
24+
val commitHashMarker =
25+
if (details.commitDistance > 0)
26+
"." + details.gitHash.substring(0, minOf(4, details.gitHash.length))
27+
else
28+
""
29+
30+
var preMarker =
31+
if (details.commitDistance > 0 || !details.isCleanTag)
32+
"-beta.${details.commitDistance}"
33+
else
34+
""
35+
36+
if (preMarker.isNotEmpty()) {
37+
// bump to next patch release
38+
val versionParts = baseVersion.split(".")
39+
baseVersion =
40+
"${versionParts[0]}.${versionParts[1]}.${versionParts[2].toInt() + 1}"
41+
}
42+
43+
val versionString =
44+
"${baseVersion}${preMarker}+mc${minecraft_version}${commitHashMarker}${dirtyMarker}"
45+
46+
version = versionString
47+
48+
legacyForge {
49+
enable {
50+
forgeVersion = rootProject.properties["forge_version"].toString()
51+
isDisableRecompilation = System.getenv("CI") == "true"
52+
}
53+
54+
rootProject.properties["parchment_version"]?.let { parchmentVer ->
55+
parchment {
56+
minecraftVersion = minecraft_version
57+
mappingsVersion = parchmentVer.toString()
58+
}
59+
}
60+
61+
runs {
62+
create("client") {
63+
client()
64+
}
65+
create("server") {
66+
server()
67+
}
68+
}
69+
70+
mods {
71+
create("modernfix") {
72+
sourceSet(sourceSets.main.get())
73+
}
74+
}
75+
}
76+
77+
mixin {
78+
add(sourceSets.main.get(), "modernfix.refmap.json")
79+
config("modernfix-modernfix.mixins.json")
80+
}
81+
82+
tasks.named<Jar>("jar") {
83+
manifest.attributes(mapOf(
84+
"MixinConfigs" to "modernfix-modernfix.mixins.json"
85+
))
86+
}
87+
88+
// We must force the Java 21 compiler to be used because our AP requires Java 21
89+
90+
java {
91+
toolchain {
92+
languageVersion = JavaLanguageVersion.of(21)
93+
}
94+
val curSourceCompatLevel = JavaVersion.VERSION_17
95+
sourceCompatibility = curSourceCompatLevel
96+
targetCompatibility = curSourceCompatLevel
97+
}
98+
99+
repositories {
100+
exclusiveContent {
101+
forRepository {
102+
maven {
103+
// location of the maven that hosts JEI files
104+
name = "Progwml6 maven"
105+
url = uri("https://dvs1.progwml6.com/files/maven/")
106+
}
107+
}
108+
forRepository {
109+
maven {
110+
name = "ModMaven"
111+
url = uri("https://modmaven.dev")
112+
}
113+
}
114+
filter {
115+
includeGroup("mezz.jei")
116+
}
117+
}
118+
exclusiveContent {
119+
forRepository {
120+
maven("https://cursemaven.com")
121+
}
122+
filter {
123+
includeGroup("curse.maven")
124+
}
125+
}
126+
}
127+
128+
dependencies {
129+
implementation(project(":annotations"))
130+
"additionalRuntimeClasspath"(project(":annotations"))
131+
annotationProcessor(project(path = ":annotation-processor", configuration = "shadow"))
132+
133+
val mixinextrasVersion = rootProject.properties["mixinextras_version"].toString()
134+
implementation("io.github.llamalad7:mixinextras-common:${mixinextrasVersion}")
135+
annotationProcessor("net.fabricmc:sponge-mixin:0.12.5+mixin.0.8.5")
136+
annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextrasVersion}")
137+
implementation("io.github.llamalad7:mixinextras-forge:${mixinextrasVersion}")
138+
"jarJar"("io.github.llamalad7:mixinextras-forge:${mixinextrasVersion}")
139+
140+
val jei_version = rootProject.properties["jei_version"].toString()
141+
modCompileOnly("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
142+
modCompileOnly("curse.maven:spark-361579:${rootProject.properties["spark_version"].toString()}")
143+
modCompileOnly("curse.maven:ctm-267602:${rootProject.properties["ctm_version"].toString()}")
144+
modCompileOnly("curse.maven:ldlib-626676:${rootProject.properties["ldlib_version"].toString()}")
145+
modCompileOnly("curse.maven:supermartijncore-454372:4455391")
146+
modCompileOnly("curse.maven:patchouli-306770:6164575")
147+
modCompileOnly("curse.maven:cofhcore-69162:5374122")
148+
modCompileOnly("curse.maven:resourcefullib-570073:5659871")
149+
modCompileOnly("curse.maven:kubejs-238086:5853326")
150+
}
151+
152+
// For the AP
153+
tasks.withType<JavaCompile>().configureEach {
154+
if (!name.lowercase().contains("test")) {
155+
options.compilerArgs.addAll(
156+
listOf(
157+
"-ArootProject.name=${rootProject.name}",
158+
"-Aproject.name=${project.name}"
159+
)
160+
)
161+
}
162+
}
163+
164+
sourceSets {
165+
main {
166+
resources.srcDir(
167+
layout.buildDirectory.dir("generated/sources/annotationProcessor/java/main/resources")
168+
)
169+
}
170+
}
171+
172+
tasks.named<ProcessResources>("processResources") {
173+
dependsOn(tasks.named("compileJava"))
174+
175+
inputs.property("version", project.version)
176+
177+
filesMatching("META-INF/mods.toml") {
178+
expand("version" to project.version)
179+
}
180+
}
File renamed without changes.

common/src/main/java/org/embeddedt/modernfix/common/mixin/core/MinecraftServerMixin.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

common/src/main/java/org/embeddedt/modernfix/searchtree/REIBackedSearchTree.java

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)