haunted gradle

- Update forge
 - Add Flywheel to the runs when using Create/Flywheel gradle workspace
 - Fix weird intellij issues with mixin's annotation processor
This commit is contained in:
Jozufozu 2021-12-02 14:02:00 -08:00
parent df8f5449f0
commit 2bde87af33
2 changed files with 31 additions and 4 deletions

View file

@ -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 {

View file

@ -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