Skip to content

Mixin Java System Properties

Pokechu22 edited this page Jan 25, 2018 · 5 revisions

The following table summaries the Java System Properties supported by Mixin to enable the various debugging and auditing features. Set any property to true to enable the option:

System Property Description
mixin.debug Enables all mixin debug options
mixin.debug.export The export debug option causes the mixin processor to emit post-mixin bytecode to disk for all mixin targets. The bytecode data are output to a typical package/class structure under the .mixin.out directory under your run directory.

Having the fernflower jar on your runtime classpath will also cause these class files to be decompiled.

mixin.debug.export.filter Export filter, if omitted allows all transformed classes to be exported. If specified, acts as a filter for class names to export and only matching classes will be exported. This is useful when using Fernflower as exporting can be otherwise very slow. The following wildcards are allowed:
*
Matches one or more characters except dot (.)
**
Matches any number of characters
?
Matches exactly one character
mixin.debug.export.decompile Set to false for fernflower to be disabled even if it is found on the classpath.
mixin.debug.export.decompile.async Run fernflower in a separate thread. In general this will allow export to impact startup time much less (decompiling normally adds about 20% to load times) with the trade-off that crashes may lead to undecompiled exports.
mixin.debug.verify The verify option runs ASM's CheckClassAdapter on the post-mixin bytecode in order to check that mixin transformations have been applied correctly. This option is only intended for use when working on the Mixin library itself and it is not recommended to enable it during general debugging of mixins themselves.
mixin.debug.verbose The verbose option promotes all DEBUG-level logging messages generated by the mixin processor to INFO level so they are emitted to the console at runtime. This is a useful option to enabled when developing with mixins as it allows more interactive monitoring of the mixin application process.
mixin.debug.countInjections Elevates failed injections to an error condition; see Inject.expect for details.
mixin.debug.strict Enables strict checks.
mixin.debug.strict.unique If false (default), Unique public methods merely raise a warning when encountered and are not merged into the target. If true, an exception is thrown instead.
mixin.debug.strict.targets Enable strict checking for mixin targets.
mixin.debug.profiler Enable the performance profiler for all mixin operations (normally it is only enabled during mixin prepare operations).
mixin.dumpTargetOnFailure Sometimes a mixin will fail with a cryptic message such as a shadow target not being present in the target or other unexpected error which indicates the target class is not in the state expected by a particular mixin. Sometimes this may be because another transformer is mutating the bytecode in the way that the mixin transformer cannot anticipate, or other unexpected changes to the target class have happened. Enabling this option causes InvalidMixinException and other runtime mixin failures to dump the incoming (un-mixed-in) class bytecode to disk. This allows the target class bytecode to then be inspected with javap or a Java Disassembler to determine the cause of the mismatch.
mixin.checks Enables all mixin check operations
mixin.checks.interfaces

Enables Interface Implementation Audit Mode. With this mode enabled, the mixin processor will output an audit report for every mixin applied which provides a summary of which interface methods are declared by class methods but are not implemented by the class or any superclasses, in essence which methods will cause an AbstractMethodError to be thrown were they to be invoked.

The report is generated to standard error (STDERR) output and is also written to flatfiles in the .mixin.out directory under your run directory.

mixin.checks.interfaces.strict If interface check is enabled, "strict mode" (default) applies the implementation check even to abstract target classes. Setting this option to false causes abstract targets to be skipped when generating the implementation report.
mixin.ignoreConstraints Disables constraint checking, demotes constraint violations from fatal errors to only output a warning. Useful in development or for in-the-wild testing of out-of-band targets.
mixin.hotSwap Enables the hot-swap agent.
mixin.env Parent for environment settings. Not actually a setting; always false.
mixin.env.obf Force refmap obf type when required. Always false.
mixin.env.disableRefMap Disable refmap when required.
mixin.env.remapRefMap Rather than disabling the refMap, you may wish to remap existing refMaps at runtime. This can be achieved by setting this property and supplying values for mixin.env.refMapRemappingFile and mixin.env.refMapRemappingEnv. Though those properties can be ignored if starting via GradleStart (this property is also automatically enabled if loading via GradleStart).
mixin.env.refMapRemappingFile If mixin.env.remapRefMap is enabled, this setting can be used to override the name of the SRG file to read mappings from. The mappings must have a source type of searge and a target type matching the current development environment. If the source type is not searge then the mixin.env.refMapRemappingEnv should be set to the correct source environment type.
mixin.env.refMapRemappingEnv When using mixin.env.refMapRemappingFile, this setting overrides the default source environment (searge). However note that the specified environment type must exist in the orignal refmap.
mixin.env.ignoreRequired Globally ignore the "required" attribute of all configurations.
mixin.env.compatLevel Default compatibility level to operate at.
mixin.env.shiftByViolation Behaviour when the maximum defined At.by value is exceeded in a mixin. Currently the behaviour is to warn. In later versions of Mixin this may be promoted to error.

Available values for this option are:

ignore
Pre-0.7 behaviour, no action is taken when a violation is encountered
warn
Current behaviour, a WARN-level message is raised for violations
error
Violations throw an exception
mixin.initialiserInjectionMode Behaviour for initialiser injections, current supported options are "default" and "safe".