mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 21:47:42 -05:00
Improve loom.mixin error message now that the AP is disabled by default. (#1383)
This commit is contained in:
@@ -40,6 +40,8 @@ import net.fabricmc.loom.api.MixinExtensionAPI;
|
||||
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;
|
||||
@@ -75,7 +77,7 @@ public abstract class MixinExtensionApiImpl implements MixinExtensionAPI {
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx
|
||||
|
||||
@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));
|
||||
|
||||
Reference in New Issue
Block a user