From 2bde87af33d4ea9a6b7ddd2d292f5ecea9d5cc1e Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Thu, 2 Dec 2021 14:02:00 -0800 Subject: [PATCH] haunted gradle - Update forge - Add Flywheel to the runs when using Create/Flywheel gradle workspace - Fix weird intellij issues with mixin's annotation processor --- build.gradle | 32 +++++++++++++++++++++++++++++--- gradle.properties | 3 ++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index f85727944..709146042 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,9 @@ apply plugin: 'org.spongepowered.mixin' apply plugin: 'org.parchmentmc.librarian.forgegradle' boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false'); +// jozu: I use a gradle workspace with both projects. +// The project is named Flywheel-Forge, but sub-projects are named by folder. +boolean inWorkspace = findProject(':Flywheel') != null ext.buildnumber = 0 project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'custom' @@ -51,6 +54,12 @@ minecraft { create { source sourceSets.main } + + if (inWorkspace) { + flywheel { + source project(":Flywheel").sourceSets.main + } + } } } @@ -64,6 +73,12 @@ minecraft { create { source sourceSets.main } + + if (inWorkspace) { + flywheel { + source project(":Flywheel").sourceSets.main + } + } } } @@ -78,6 +93,12 @@ minecraft { create { source sourceSets.main } + + if (inWorkspace) { + flywheel { + source project(":Flywheel").sourceSets.main + } + } } } } @@ -139,8 +160,8 @@ dependencies { implementation fg.deobf(registrate) shade registrate - if (findProject(':Flywheel-Forge') != null) { - implementation project(':Flywheel-Forge') // jozu: I use a gradle workspace with both projects + if (inWorkspace) { + implementation project(':Flywheel') } else { implementation fg.deobf("com.jozufozu.flywheel:Flywheel-Forge:${flywheel_version}") } @@ -155,7 +176,12 @@ dependencies { // runtimeOnly fg.deobf("slimeknights.mantle:Mantle:1.16.5-1.6.115") // runtimeOnly fg.deobf("slimeknights.tconstruct:TConstruct:1.16.5-3.1.1.252") - annotationProcessor 'org.spongepowered:mixin:0.8.4:processor' + // https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497 + // Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings + // This allows 'Settings > Build, Execution, and Deployment > Build Tools > Gradle > Build and run using' set to IntelliJ to work correctly + if (System.getProperty('idea.sync.active') != 'true') { + annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor" + } } jar { diff --git a/gradle.properties b/gradle.properties index 8d48f1e3f..72694d60a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,11 +6,12 @@ org.gradle.daemon = false # mod version info mod_version = 0.4 minecraft_version = 1.17.1 -forge_version = 37.0.126 +forge_version = 37.1.0 # build dependency versions forgegradle_version = 5.1.+ mixingradle_version = 0.7-SNAPSHOT +mixin_version = 0.8.5 librarian_version = 1.+ shadow_version = 7.1.0 cursegradle_version = 1.4.0