Skip to content

Commit

Permalink
Change plugin application
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Jan 15, 2024
1 parent 7c9e2fd commit ccc84ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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<Project> {
@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");
}
}
2 changes: 0 additions & 2 deletions testplugin/loom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ dependencies {
implementation libs.junit.api
}

opensesame.loom.apply()

tasks.named('compileJava', JavaCompile).configure {
dependsOn(configurations.testSource)
source(configurations.testSource)
Expand Down

0 comments on commit ccc84ba

Please sign in to comment.