diff --git a/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/LoomExtension.java b/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/LoomExtension.java deleted file mode 100644 index 04fbfae..0000000 --- a/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/LoomExtension.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.lukebemish.opensesame.plugin.loom; - -import net.fabricmc.loom.api.LoomGradleExtensionAPI; -import net.fabricmc.loom.api.remapping.RemapperParameters; -import org.gradle.api.Project; - -import javax.inject.Inject; - -public abstract class LoomExtension { - private final Project project; - - @Inject - public LoomExtension(Project project) { - this.project = project; - } - - @SuppressWarnings({"unchecked", "rawtypes"}) - public void apply() { - LoomGradleExtensionAPI loomExtension = (LoomGradleExtensionAPI) project.getExtensions().getByName("loom"); - loomExtension.addRemapperExtension((Class) OpeningRemapperExtension.class, RemapperParameters.None.class, i -> {}); - loomExtension.getKnownIndyBsms().add("dev/lukebemish/opensesame/runtime/OpeningMetafactory"); - } -} diff --git a/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/OpenSesamePluginLoom.java b/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/OpenSesamePluginLoom.java index 83749c8..c73728d 100644 --- a/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/OpenSesamePluginLoom.java +++ b/plugin/loom/src/main/java/dev/lukebemish/opensesame/plugin/loom/OpenSesamePluginLoom.java @@ -1,16 +1,21 @@ package dev.lukebemish.opensesame.plugin.loom; -import dev.lukebemish.opensesame.plugin.OpenSesameExtension; import dev.lukebemish.opensesame.plugin.OpenSesamePlugin; +import net.fabricmc.loom.api.LoomGradleExtensionAPI; +import net.fabricmc.loom.api.remapping.RemapperParameters; +import net.fabricmc.loom.bootstrap.LoomGradlePluginBootstrap; import org.gradle.api.Plugin; import org.gradle.api.Project; public class OpenSesamePluginLoom implements Plugin { - @Override + + @Override@SuppressWarnings({"unchecked", "rawtypes"}) public void apply(Project target) { target.getPlugins().apply(OpenSesamePlugin.class); + target.getPlugins().apply(LoomGradlePluginBootstrap.class); - var openSesameExtension = (OpenSesameExtension) target.getExtensions().getByName("opensesame"); - openSesameExtension.getExtensions().create("loom", LoomExtension.class); + LoomGradleExtensionAPI loomExtension = (LoomGradleExtensionAPI) target.getExtensions().getByName("loom"); + loomExtension.addRemapperExtension((Class) OpeningRemapperExtension.class, RemapperParameters.None.class, i -> {}); + loomExtension.getKnownIndyBsms().add("dev/lukebemish/opensesame/runtime/OpeningMetafactory"); } } diff --git a/testplugin/loom/build.gradle b/testplugin/loom/build.gradle index 78dc7e2..577352d 100644 --- a/testplugin/loom/build.gradle +++ b/testplugin/loom/build.gradle @@ -37,8 +37,6 @@ dependencies { implementation libs.junit.api } -opensesame.loom.apply() - tasks.named('compileJava', JavaCompile).configure { dependsOn(configurations.testSource) source(configurations.testSource)