Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace;

public abstract class MixinExtensionApiImpl implements MixinExtensionAPI {
static final String MIXIN_AP_DISABLED_ERROR = "The mixin annotation is no longer enabled by default, you should remove any loom.mixin configuration. If you wish to continue to use the mixin AP you can set useLegacyMixinAp = true.";

protected final Project project;
protected final Property<Boolean> useMixinAp;
private final Property<String> refmapTargetNamespace;
Expand Down Expand Up @@ -75,7 +77,7 @@ public Property<Boolean> getUseLegacyMixinAp() {

@Override
public Property<String> getRefmapTargetNamespace() {
if (!getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
if (!getUseLegacyMixinAp().get()) throw new IllegalStateException(MIXIN_AP_DISABLED_ERROR);

return refmapTargetNamespace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public MixinExtensionImpl(Project project) {

@Override
public Property<String> getDefaultRefmapName() {
if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException(MIXIN_AP_DISABLED_ERROR);

return defaultRefmapName;
}
Expand All @@ -81,7 +81,7 @@ private String getDefaultMixinRefmapName() {

@Override
protected PatternSet add0(SourceSet sourceSet, Provider<String> refmapName) {
if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException("You need to set useLegacyMixinAp = true to configure Mixin annotation processor.");
if (!super.getUseLegacyMixinAp().get()) throw new IllegalStateException(MIXIN_AP_DISABLED_ERROR);

PatternSet pattern = new PatternSet().setIncludes(Collections.singletonList("**/*.json"));
MixinExtension.setMixinInformationContainer(sourceSet, new MixinExtension.MixinInformationContainer(sourceSet, refmapName, pattern));
Expand Down