Skip to content

Commit

Permalink
allow customizing mixinConfigRefmap (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
WaitingIdly authored Jul 4, 2024
1 parent ef5f07b commit a3b1a81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ propertyDefaultIfUnset("includeCommonDevEnvMods", true)
propertyDefaultIfUnset("stripForgeRequirements", false)
propertyDefaultIfUnset("noPublishedSources", false)
propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("mixinConfigRefmap", "mixins.${project.modId}.refmap.json")
propertyDefaultIfUnsetWithEnvVar("enableCoreModDebug", false, "CORE_MOD_DEBUG")
propertyDefaultIfUnset("generateMixinConfig", true)
propertyDefaultIfUnset("usesShadowedDependencies", false)
Expand Down Expand Up @@ -526,7 +527,7 @@ dependencies {
// should use 2.8.6 but 2.8.9+ has a vulnerability fix
annotationProcessor 'com.google.code.gson:gson:2.8.9'

mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, "mixins.${modId}.refmap.json")
mixinProviderSpec = modUtils.enableMixins(mixinProviderSpec, mixinConfigRefmap)
api (mixinProviderSpec) {
transitive = false
}
Expand Down Expand Up @@ -705,7 +706,6 @@ tasks.register('generateAssets') {
if (usesMixins.toBoolean() && generateMixinConfig.toBoolean()) {
def mixinConfigFile = getFile("src/main/resources/mixins.${modId}.json")
if (!mixinConfigFile.exists()) {
def mixinConfigRefmap = "mixins.${modId}.refmap.json"

mixinConfigFile.text = """{
"package": "${modGroup}.${mixinsPackage}",
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ accessTransformersFile =
usesMixins = false
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Location of the mixin config refmap. If left, blank, defaults to "mixins.${modId}.refmap.json". Target file must have the "json" extension.
mixinConfigRefmap =
# Automatically generates a mixin config json if enabled, with the name mixins.modid.json
generateMixinConfig = true
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
Expand Down

0 comments on commit a3b1a81

Please sign in to comment.