Skip to content

Commit

Permalink
refactor: jump from MBL to UniMixins;
Browse files Browse the repository at this point in the history
  • Loading branch information
MJaroslav committed May 27, 2024
1 parent 80ab76c commit 0bae2e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
28 changes: 23 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ buildscript {
apply plugin: 'java'
apply plugin: 'forge'
apply plugin: 'maven-publish'
apply from: 'https://raw.githubusercontent.com/tox1cozZ/mixin-booter-legacy/master/gradle/configurations/v1.gradle'
apply from: 'https://raw.githubusercontent.com/MJaroslav/MCInGameTester/master/gradle/configurations/v1.gradle'
apply plugin: 'bon2gradle'

Expand Down Expand Up @@ -101,10 +100,6 @@ minecraft {
// srgExtra "PK: io/github/mjaroslav/sharedjava io/github/mjaroslav/mjutils/library/io/github/mjaroslav/sharedjava"
}

mixin {
mixinRefMapName = "mixin.${project.name.replace(" ", "").toLowerCase()}.refmap.json"
}

dependencies {
shade "blue.endless:jankson:${buildprop.jankson_version}"
shade "com.github.MJaroslav:Shared-Java:${buildprop.sharedjava_version}"
Expand All @@ -118,6 +113,10 @@ dependencies {
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
implementation bon2.deobf("curse.maven:crafttweaker-239197:2838720")

implementation "com.github.LegacyModdingMC.UniMixins:unimixins-mixin-1.7.10:${buildprop.unimixins_version}"
annotationProcessor "com.github.LegacyModdingMC.UniMixins:unimixins-mixin-1.7.10:${buildprop.unimixins_version}"
implementation bon2.deobf("com.github.LegacyModdingMC.UniMixins:unimixins-mixinbooterlegacy-1.7.10:${buildprop.unimixins_version}")

compileOnly "org.jetbrains:annotations:${buildprop.jetbrains_annotations_version}"
testCompileOnly "org.jetbrains:annotations:${buildprop.jetbrains_annotations_version}"

Expand All @@ -133,6 +132,17 @@ dependencies {
testImplementation "junit:junit:${buildprop.junit_version}"
}

runClient {
args += ["--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"]
}

runServer {
args += ["--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"]
}

def outSrgFile = "${tasks.compileJava.temporaryDir}/outSrg.srg"
def outRefMapFile = "${tasks.compileJava.temporaryDir}/mixin.${project.name.replace(" ", "").toLowerCase()}.refmap.json"

test {
useJUnit()
}
Expand All @@ -154,10 +164,18 @@ jar {
attributes "FMLCorePlugin": "${project.group}.${project.name.replace(" ", "").toLowerCase()}" +
".asm.${project.name.replace(" ", "")}Plugin"
attributes "FMLCorePluginContainsFMLMod": "true"
attributes "ForceLoadAsMod": "true"
}
configurations.shade.each { dep ->
from project.zipTree(dep)
}
from outRefMapFile
}

tasks.compileJava.options.compilerArgs += ["-AreobfSrgFile=${tasks.reobf.srg}", "-AoutSrgFile=${outSrgFile}", "-AoutRefMapFile=${outRefMapFile}"]

reobf {
addExtraSrgFile outSrgFile
}

publishing {
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ run_dir=run
#########################
# Library mods versions #
#########################
# Mixin booter legacy
mixin_booter=1.1.2
# UniMixins
unimixins_version=0.1.17
#######################
# Other libs versions #
#######################
Expand Down

0 comments on commit 0bae2e2

Please sign in to comment.