[config-compiler-plugin] Configure default config inject task based on jar
This commit is contained in:
parent
f6ef4544a8
commit
00f1a74bc0
|
@ -18,5 +18,5 @@ fabric_version=0.60.0+1.19.2
|
||||||
commons_version=2022.9.25+10-22-41
|
commons_version=2022.9.25+10-22-41
|
||||||
modmenu_version=4.0.6
|
modmenu_version=4.0.6
|
||||||
|
|
||||||
asm_version=9.3
|
asm_version=9.4
|
||||||
ant_version=1.10.12
|
ant_version=1.10.12
|
|
@ -2,10 +2,19 @@ package io.gitlab.jfronny.libjf.config.plugin;
|
||||||
|
|
||||||
import org.gradle.api.Plugin;
|
import org.gradle.api.Plugin;
|
||||||
import org.gradle.api.Project;
|
import org.gradle.api.Project;
|
||||||
|
import org.gradle.api.plugins.BasePluginExtension;
|
||||||
|
import org.gradle.api.tasks.bundling.Jar;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class ConfigPlugin implements Plugin<Project> {
|
public class ConfigPlugin implements Plugin<Project> {
|
||||||
@Override
|
@Override
|
||||||
public void apply(Project project) {
|
public void apply(Project project) {
|
||||||
|
project.getTasks().register("injectCompiledConfig", ConfigInjectTask.class, task -> {
|
||||||
|
task.from(project.getTasks().named("jar", Jar.class));
|
||||||
|
task.getModId().set(project.getExtensions().getByType(BasePluginExtension.class).getArchivesName());
|
||||||
|
task.getArchiveClassifier().set("config-inject");
|
||||||
|
task.getDestinationDirectory().set(new File(project.getBuildDir(), "devlibs"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user