Skip to content

Commit

Permalink
Add module declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Dec 25, 2023
1 parent 7b75ff2 commit 589abd7
Show file tree
Hide file tree
Showing 25 changed files with 194 additions and 30 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ subprojects { subProject ->
manifest.attributes(
'Git-Commit' : gradleutils.gitInfo.abbreviatedId,
'Build-Number': "${subProject.version}",
'Automatic-Module-Name' : "fml_${subProject.name.replace("-", "_")}",
'FMLModType' : subProject.name.startsWith("language") ? 'LANGPROVIDER' : subProject.name == "events" ? 'GAMELIBRARY' : 'LIBRARY',
'Specification-Title' : "FML${subProject.name}",
'Specification-Vendor' : 'NeoForged',
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dependencies {
api("net.neoforged:bus:${eventbus_version}")

implementation("commons-io:commons-io:${commons_io_version}")
implementation("org.slf4j:slf4j-api:${slf4j_api_version}")
}
27 changes: 27 additions & 0 deletions core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
open module net.neoforged.fancymodloader.core {
requires com.electronwill.nightconfig.core;
requires com.electronwill.nightconfig.toml;
requires com.google.common;
requires com.google.gson;
requires cpw.mods.modlauncher;
requires java.net.http;
requires logging;
requires maven.artifact;
requires net.neoforged.bus;
requires net.neoforged.neoforgespi;
requires net.neoforged.mergetool.api;
requires net.neoforged.fancymodloader.loader;
requires org.apache.commons.io;
requires org.apache.logging.log4j;
requires org.slf4j;
requires static org.jetbrains.annotations;

exports net.neoforged.fml;
exports net.neoforged.fml.config;
exports net.neoforged.fml.event;
exports net.neoforged.fml.util;
exports net.neoforged.fml.util.thread;

uses net.neoforged.fml.IModStateProvider;
uses net.neoforged.fml.IBindingsProvider;
}
18 changes: 18 additions & 0 deletions earlydisplay/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
open module net.neoforged.fancymodloader.earlydisplay {
requires java.desktop;
requires java.management;
requires jdk.management;
requires jopt.simple;
requires net.neoforged.fancymodloader.loader;
requires org.lwjgl.glfw;
requires org.lwjgl.opengl;
requires org.lwjgl.stb;
requires org.lwjgl.tinyfd;
requires org.slf4j;
requires static org.jetbrains.annotations;

exports net.neoforged.fml.earlydisplay;

provides net.neoforged.fml.loading.ImmediateWindowProvider with
net.neoforged.fml.earlydisplay.DisplayWindow;
}

This file was deleted.

14 changes: 14 additions & 0 deletions events/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
open module net.neoforged.fancymodloader.events {
requires net.neoforged.fancymodloader.core;
requires net.neoforged.mergetool.api;
requires net.neoforged.fancymodloader.loader;
requires cpw.mods.modlauncher;
requires net.neoforged.bus;

exports net.neoforged.fml.core;
exports net.neoforged.fml.event.config;
exports net.neoforged.fml.event.lifecycle;

provides net.neoforged.fml.IModStateProvider with
net.neoforged.fml.core.ModStateProvider;
}
17 changes: 17 additions & 0 deletions languages/java/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
open module net.neoforged.fancymodloader.language.java {
requires cpw.mods.modlauncher;
requires cpw.mods.securejarhandler;
requires net.neoforged.bus;
requires net.neoforged.neoforgespi;
requires net.neoforged.mergetool.api;
requires net.neoforged.fancymodloader.core;
requires net.neoforged.fancymodloader.loader;
requires org.apache.logging.log4j;
requires org.objectweb.asm;

exports net.neoforged.fml.common;
exports net.neoforged.fml.javafmlmod;

provides net.neoforged.neoforgespi.language.IModLanguageProvider with
net.neoforged.fml.javafmlmod.FMLJavaModLanguageProvider;
}

This file was deleted.

16 changes: 16 additions & 0 deletions languages/lowcode/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
open module net.neoforged.fancymodloader.language.lowcode {
requires cpw.mods.modlauncher;
requires logging;
requires net.neoforged.bus;
requires net.neoforged.neoforgespi;
requires net.neoforged.fancymodloader.core;
requires net.neoforged.fancymodloader.loader;
requires org.apache.logging.log4j;
requires org.slf4j;
requires static org.jetbrains.annotations;

exports net.neoforged.fml.lowcodemod;

provides net.neoforged.neoforgespi.language.IModLanguageProvider with
net.neoforged.fml.lowcodemod.LowCodeModLanguageProvider;
}

This file was deleted.

12 changes: 12 additions & 0 deletions languages/minecraft/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
open module net.neoforged.fancymodloader.language.minecraft {
requires net.neoforged.bus;
requires net.neoforged.neoforgespi;
requires net.neoforged.fancymodloader.core;
requires org.apache.logging.log4j;
requires static org.jetbrains.annotations;

exports net.neoforged.fml.mclanguageprovider;

provides net.neoforged.neoforgespi.language.IModLanguageProvider with
net.neoforged.fml.mclanguageprovider.MinecraftModLanguageProvider;
}

This file was deleted.

2 changes: 2 additions & 0 deletions loader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dependencies {
api("org.ow2.asm:asm:${asm_version}")
api("org.ow2.asm:asm-tree:${asm_version}")
api("org.ow2.asm:asm-commons:${asm_version}")
api("org.ow2.asm:asm-analysis:${asm_version}")
api("org.ow2.asm:asm-util:${asm_version}")
api(project(':spi'))
api("net.neoforged:mergetool:${mergetool_version}:api")
api("org.apache.logging.log4j:log4j-api:${log4j_version}")
Expand Down
71 changes: 71 additions & 0 deletions loader/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
open module net.neoforged.fancymodloader.loader {
requires net.neoforged.accesstransformer;
requires net.neoforged.accesstransformer.modlauncher;
requires com.electronwill.nightconfig.core;
requires com.google.common;
requires com.google.gson;
requires cpw.mods.modlauncher;
requires cpw.mods.securejarhandler;
requires JarJarSelector;
requires logging;
requires maven.artifact;
requires net.neoforged.neoforgespi;
requires net.neoforged.mergetool.api;
requires org.apache.commons.lang3;
requires org.apache.logging.log4j.core;
requires org.apache.logging.log4j;
requires org.objectweb.asm.commons;
requires org.objectweb.asm.tree;
requires org.objectweb.asm.tree.analysis;
requires org.objectweb.asm.util;
requires org.objectweb.asm;
requires org.slf4j;
requires org.spongepowered.mixin;
requires terminalconsoleappender;
requires static org.jetbrains.annotations;

exports net.neoforged.fml.common.asm;
exports net.neoforged.fml.loading;
exports net.neoforged.fml.loading.log4j;
exports net.neoforged.fml.loading.moddiscovery;
exports net.neoforged.fml.loading.progress;
exports net.neoforged.fml.loading.targets;
exports net.neoforged.fml.loading.toposort;
exports net.neoforged.fml.server;

uses net.neoforged.neoforgespi.coremod.ICoreModProvider;
uses net.neoforged.neoforgespi.language.IModLanguageProvider;
uses net.neoforged.neoforgespi.locating.IModLocator;
uses net.neoforged.neoforgespi.locating.IDependencyLocator;
uses net.neoforged.fml.loading.ImmediateWindowProvider;

provides cpw.mods.modlauncher.api.ILaunchHandlerService with
net.neoforged.fml.loading.targets.ForgeClientLaunchHandler,
net.neoforged.fml.loading.targets.ForgeClientDevLaunchHandler,
net.neoforged.fml.loading.targets.ForgeClientUserdevLaunchHandler,
net.neoforged.fml.loading.targets.ForgeServerLaunchHandler,
net.neoforged.fml.loading.targets.ForgeServerDevLaunchHandler,
net.neoforged.fml.loading.targets.ForgeServerUserdevLaunchHandler,
net.neoforged.fml.loading.targets.ForgeDataDevLaunchHandler,
net.neoforged.fml.loading.targets.ForgeDataUserdevLaunchHandler;
provides cpw.mods.modlauncher.api.INameMappingService with
net.neoforged.fml.loading.MCPNamingService;
provides cpw.mods.modlauncher.api.ITransformationService with
net.neoforged.fml.loading.FMLServiceProvider;
provides cpw.mods.modlauncher.serviceapi.ILaunchPluginService with
net.neoforged.fml.loading.log4j.SLF4JFixerLaunchPluginService,
net.neoforged.fml.common.asm.RuntimeDistCleaner,
net.neoforged.fml.common.asm.RuntimeEnumExtender;
provides cpw.mods.modlauncher.serviceapi.ITransformerDiscoveryService with
net.neoforged.fml.loading.ModDirTransformerDiscoverer,
net.neoforged.fml.loading.ClasspathTransformerDiscoverer;
provides net.neoforged.neoforgespi.locating.IDependencyLocator with
net.neoforged.fml.loading.moddiscovery.JarInJarDependencyLocator;
provides net.neoforged.neoforgespi.locating.IModLocator with
net.neoforged.fml.loading.moddiscovery.ModsFolderLocator,
net.neoforged.fml.loading.moddiscovery.MavenDirectoryLocator,
net.neoforged.fml.loading.moddiscovery.ExplodedDirectoryLocator,
net.neoforged.fml.loading.moddiscovery.MinecraftLocator,
net.neoforged.fml.loading.moddiscovery.ClasspathLocator,
net.neoforged.fml.loading.moddiscovery.BuiltinGameLibraryLocator;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void configureTransformationClassLoader(final ITransformingClassLoaderBui

protected String[] preLaunch(String[] arguments, ModuleLayer layer) {
URI uri;
try (var reader = layer.configuration().findModule("fml_loader").orElseThrow().reference().open()) {
try (var reader = layer.configuration().findModule("net.neoforged.fancymodloader.loader").orElseThrow().reference().open()) {
uri = reader.find("log4j2.xml").orElseThrow();
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class FMLClientLaunchHandler extends CommonClientLaunchHandler {

@Override
protected void processMCStream(VersionInfo versionInfo, Stream.Builder<Path> mc, Stream.Builder<List<Path>> mods) {
var fmlonly = LibraryFinder.findPathForMaven("net.neoforged.fml", "fmlonly", "", "universal", versionInfo.mcAndFmlVersion());
var fmlonly = LibraryFinder.findPathForMaven("net.neoforged.fancymodloader", "fmlonly", "", "universal", versionInfo.mcAndFmlVersion());
mods.add(List.of(fmlonly));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class FMLServerLaunchHandler extends CommonServerLaunchHandler {

@Override
protected void processMCStream(VersionInfo versionInfo, Stream.Builder<Path> mc, Stream.Builder<List<Path>> mods) {
var fmlonly = LibraryFinder.findPathForMaven("net.neoforged.fml", "fmlonly", "", "universal", versionInfo.mcAndFmlVersion());
var fmlonly = LibraryFinder.findPathForMaven("net.neoforged.fancymodloader", "fmlonly", "", "universal", versionInfo.mcAndFmlVersion());
mods.add(List.of(fmlonly));
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions spi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
open module net.neoforged.neoforgespi {
requires maven.artifact;
requires net.neoforged.mergetool.api;
requires org.apache.logging.log4j;
requires org.objectweb.asm;
requires cpw.mods.securejarhandler;
requires cpw.mods.modlauncher;

exports net.neoforged.neoforgespi;
exports net.neoforged.neoforgespi.coremod;
exports net.neoforged.neoforgespi.language;
exports net.neoforged.neoforgespi.locating;
}

0 comments on commit 589abd7

Please sign in to comment.