diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc3b5c91..705b1824 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,16 +2,15 @@ ModernFix is a standard Minecraft-style Gradle project powered by Architectury L run the `build` task (e.g. via `./gradlew build`). You can also use `./gradlew forge:build` or `./gradlew fabric:build` to build for just one loader (e.g. when debugging and wanting to rebuild quickly). -You must use Java 17 to develop ModernFix as the toolchain requires it. Nonetheless, the 1.16 mod JARs will work on -a Minecraft instance with Java 8. +You must use Java 21 to develop ModernFix as the toolchain requires it. Nonetheless, the built 1.20.1 JAR is still +compatible with Java 17. ## Submitting pull requests Code or documentation contributions are welcome. Please keep the following points in mind: -* This project supports many Minecraft versions. Ideally, contributions should be made to the oldest relevant MC version. -For instance, a PR optimizing new worldgen should be made to 1.18 (not 1.19 or 1.20) while a PR optimizing something -like recipes should be made to 1.16 (the oldest supported version). +* This project supports many Minecraft versions. Ideally, contributions should be made to the oldest relevant MC version (currently 1.20) + and then they will be ported forward. This somewhat unconventional policy ensures that all supported versions are treated equal when it comes to development, rather than the onus being on other modders and players to backport changes that are needed. Changes to older versions are diff --git a/annotation-processor/build.gradle b/annotation-processor/build.gradle index df4a24a0..0cefd6df 100644 --- a/annotation-processor/build.gradle +++ b/annotation-processor/build.gradle @@ -43,6 +43,7 @@ shadowJar { // shadowJar bug include '*.jar' include 'META-INF/services/javax.annotation.processing.Processor' + include 'META-INF/gradle/incremental.annotation.processors' include 'org/spongepowered/asm/mixin/Mixin.class' include 'org/fury_phoenix/**/*' include {it.getName() == 'OnlyIn.class'} diff --git a/annotation-processor/src/main/java/org/fury_phoenix/mixinAp/annotation/MixinProcessor.java b/annotation-processor/src/main/java/org/fury_phoenix/mixinAp/annotation/MixinProcessor.java index 747f8865..3e73ec56 100644 --- a/annotation-processor/src/main/java/org/fury_phoenix/mixinAp/annotation/MixinProcessor.java +++ b/annotation-processor/src/main/java/org/fury_phoenix/mixinAp/annotation/MixinProcessor.java @@ -16,7 +16,6 @@ import javax.annotation.processing.Processor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedOptions; -import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; @@ -26,7 +25,6 @@ import org.fury_phoenix.mixinAp.config.MixinConfig; @SupportedAnnotationTypes({"org.spongepowered.asm.mixin.Mixin", "org.embeddedt.modernfix.annotation.ClientOnlyMixin"}) @SupportedOptions({"rootProject.name", "project.name", "org.fury_phoenix.mixinAp.validator.debug"}) -@SupportedSourceVersion(SourceVersion.RELEASE_17) @AutoService(Processor.class) public class MixinProcessor extends AbstractProcessor { @@ -38,6 +36,11 @@ public class MixinProcessor extends AbstractProcessor { private final Map> mixinConfigList = new HashMap<>(); + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { try { diff --git a/annotation-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors b/annotation-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors new file mode 100644 index 00000000..9b9cf7bc --- /dev/null +++ b/annotation-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors @@ -0,0 +1 @@ +org.fury_phoenix.mixinAp.annotation.MixinProcessor,aggregating \ No newline at end of file diff --git a/buildSrc/src/main/groovy/modernfix.mod-common-conventions.gradle b/buildSrc/src/main/groovy/modernfix.mod-common-conventions.gradle index 29f3f347..dc9f149b 100644 --- a/buildSrc/src/main/groovy/modernfix.mod-common-conventions.gradle +++ b/buildSrc/src/main/groovy/modernfix.mod-common-conventions.gradle @@ -6,6 +6,9 @@ plugins { loom { silentMojangMappingsLicense() accessWidenerPath = file("${rootDir}/common/src/main/resources/modernfix.accesswidener") + mixin { + useLegacyMixinAp = false + } } dependencies { @@ -31,7 +34,6 @@ tasks { } tasks.withType(JavaCompile) { - options.fork = true configure(options) { if (!name.toLowerCase().contains('test')) { options.compilerArgs << "-ArootProject.name=${rootProject.name}" << "-Aproject.name=${project.name}" diff --git a/fabric/build.gradle b/fabric/build.gradle index 5de446b8..513e6bee 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -26,18 +26,6 @@ configurations { } } -// TODO remove - -repositories { - maven { - name = "Technici4n" - url = "https://raw.githubusercontent.com/Technici4n/Technici4n-maven/master/" - content { - includeGroup "net.fabricmc.fabric-api" - } - } -} - dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" testImplementation "net.fabricmc:fabric-loader-junit:${rootProject.fabric_loader_version}" @@ -77,7 +65,7 @@ dependencies { testAgent(project("path": ":test_agent", "configuration": "agentJar")) } -test { +tasks.named("test") { useJUnitPlatform() def runDir = file('test_run') doFirst() {