Merge remote-tracking branch 'refs/remotes/origin/main' into owlsys/dependency-resolving

This commit is contained in:
moehreag 2024-06-03 01:00:40 +02:00
commit e076c98531
18 changed files with 44 additions and 38 deletions

View file

@ -23,7 +23,7 @@ repositories {
}
dependencies {
implementation(libs.remapper){
implementation(libs.thyroxine){
isTransitive = false
}
compileOnly("org.apache.logging.log4j:log4j-slf4j2-impl:3.0.0-beta2")

View file

@ -1,13 +1,13 @@
[versions]
remapper = "1.0.0-SNAPSHOT"
thyroxine = "1.0.0-SNAPSHOT"
nightconfig = "3.7.2"
mixin = "0.13.4+mixin.0.8.5"
annotations = "24.1.0"
[libraries]
remapper = { module = "dev.frogmc:thyroxine", version.ref = "remapper" }
thyroxine = { module = "dev.frogmc:thyroxine", version.ref = "thyroxine" }
nightconfig = { module = "com.electronwill.night-config:toml", version.ref = "nightconfig" }
mixin = { module = "net.fabricmc:sponge-mixin", version.ref = "mixin" }
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }

View file

@ -7,12 +7,12 @@ plugins {
repositories {
maven {
name = "Esnesnon Maven/Snapshots"
url = uri("https://maven-esnesnon.ecorous.org/snapshots")
name = "FrogMC Maven/Snapshots"
url = uri("https://maven-frogmc.ecorous.org/snapshots")
}
maven {
name = "Esnesnon Maven/Releases"
url = uri("https://maven-esnesnon.ecorous.org/releases")
name = "FrogMC Maven/Releases"
url = uri("https://maven-frogmc.ecorous.org/releases")
}
mavenCentral()
}

View file

@ -6,8 +6,8 @@ import java.util.Optional;
import dev.frogmc.frogloader.api.env.Env;
import dev.frogmc.frogloader.api.mod.ModProperties;
import dev.frogmc.frogloader.impl.LoaderImpl;
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
import dev.frogmc.frogloader.impl.LoaderImpl;
public interface Loader {
@ -20,11 +20,15 @@ public interface Loader {
Env getEnv();
Path getGameDir();
Path getConfigDir();
Path getModsDir();
boolean isDevelopment();
boolean isModLoaded(String id);
Optional<ModProperties> getModProperties(String id);
}

View file

@ -12,12 +12,12 @@ import java.util.stream.Collectors;
import com.google.gson.Gson;
import dev.frogmc.frogloader.api.Loader;
import dev.frogmc.frogloader.api.env.Env;
import dev.frogmc.frogloader.api.mod.ModProperties;
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
import dev.frogmc.frogloader.impl.launch.MixinClassLoader;
import dev.frogmc.frogloader.impl.mod.ModUtil;
import lombok.Getter;
import dev.frogmc.frogloader.api.env.Env;
import dev.frogmc.frogloader.api.mod.ModProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.asm.mixin.MixinEnvironment;

View file

@ -1,17 +1,16 @@
package dev.frogmc.frogloader.impl.gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.net.URI;
import java.util.function.BiConsumer;
import dev.frogmc.frogloader.impl.LoaderImpl;
import dev.frogmc.frogloader.impl.mod.ModDependencyResolver;
import dev.frogmc.frogloader.impl.mod.ModUtil;
import dev.frogmc.frogloader.impl.util.URLUtil;
import lombok.AllArgsConstructor;
import dev.frogmc.frogloader.impl.LoaderImpl;
public class LoaderGui {

View file

@ -1,6 +1,8 @@
package dev.frogmc.frogloader.impl.launch;
import java.util.*;
import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;

View file

@ -6,9 +6,9 @@ import java.lang.invoke.MethodType;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter;
import dev.frogmc.frogloader.api.env.Env;
import dev.frogmc.frogloader.impl.mixin.NonsenseMixinService;
import lombok.Getter;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.service.IPropertyKey;

View file

@ -16,13 +16,12 @@ import org.spongepowered.asm.mixin.MixinEnvironment;
public class MixinClassLoader extends URLClassLoader {
private static final ClassLoader SYSTEM = ClassLoader.getSystemClassLoader();
private final List<String> exclusions = new ArrayList<>();
static {
registerAsParallelCapable();
}
private final List<String> exclusions = new ArrayList<>();
public MixinClassLoader() {
super(new URL[0], null);
excludePackage("java");

View file

@ -2,15 +2,18 @@ package dev.frogmc.frogloader.impl.mixin;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import dev.frogmc.frogloader.api.mod.ModProperties;
import dev.frogmc.frogloader.impl.launch.AccessWidener;
import dev.frogmc.frogloader.impl.mod.BuiltinExtensions;
import dev.frogmc.frogloader.api.mod.ModProperties;
public class AWProcessor {

View file

@ -6,12 +6,12 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.Getter;
import dev.frogmc.frogloader.api.mod.ModDependencies;
import dev.frogmc.frogloader.api.mod.ModProperties;
import dev.frogmc.frogloader.api.mod.SemVer;
import dev.frogmc.frogloader.impl.SemVerParseException;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;

View file

@ -13,10 +13,10 @@ import com.electronwill.nightconfig.core.CommentedConfig;
import com.electronwill.nightconfig.core.UnmodifiableConfig;
import com.electronwill.nightconfig.core.file.FileNotFoundAction;
import com.electronwill.nightconfig.toml.TomlParser;
import lombok.AllArgsConstructor;
import dev.frogmc.frogloader.api.mod.ModDependencies;
import dev.frogmc.frogloader.api.mod.ModExtensions;
import dev.frogmc.frogloader.api.mod.ModProperties;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View file

@ -6,9 +6,9 @@ import java.util.function.IntSupplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.NonNull;
import dev.frogmc.frogloader.api.mod.SemVer;
import dev.frogmc.frogloader.impl.SemVerParseException;
import lombok.NonNull;
public record SemVerImpl(int major, int minor, int patch, String prerelease, String build) implements SemVer {
// Adapted from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string

View file

@ -12,8 +12,6 @@ import java.util.*;
import com.google.gson.JsonObject;
import dev.frogmc.frogloader.api.Loader;
import dev.frogmc.frogloader.impl.gui.LoaderGui;
import dev.frogmc.frogloader.impl.mod.*;
import dev.frogmc.frogloader.api.extensions.PreLaunchExtension;
import dev.frogmc.frogloader.api.mod.ModDependencies;
import dev.frogmc.frogloader.api.mod.ModExtensions;
@ -21,9 +19,10 @@ import dev.frogmc.frogloader.api.mod.ModProperties;
import dev.frogmc.frogloader.api.plugin.NonsensePlugin;
import dev.frogmc.frogloader.impl.Discovery;
import dev.frogmc.frogloader.impl.LoaderImpl;
import dev.frogmc.frogloader.impl.gui.LoaderGui;
import dev.frogmc.frogloader.impl.mixin.AWProcessor;
import org.ecorous.esnesnon.nonsense.loader.impl.mod.*;
import org.ecorous.esnesnon.nonsense_remapper.NonsenseRemapper;
import dev.frogmc.frogloader.impl.mod.*;
import dev.frogmc.thyroxine.Thyroxine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.asm.mixin.Mixins;
@ -109,7 +108,7 @@ public class Minecraft implements NonsensePlugin {
if (!loader.isDevelopment()) {
if (!Files.exists(remappedGamePath)) {
NonsenseRemapper.run(version, gamePath, remappedGamePath, true, false);
Thyroxine.run(version, gamePath, remappedGamePath, true, false);
}
}

View file

@ -1,8 +1,8 @@
package dev.frogmc.frogloader.impl.plugin.game.minecraft;
import dev.frogmc.frogloader.impl.mod.SemVerImpl;
import dev.frogmc.frogloader.api.mod.SemVer;
import dev.frogmc.frogloader.impl.SemVerParseException;
import dev.frogmc.frogloader.impl.mod.SemVerImpl;
import org.jetbrains.annotations.NotNull;
public class MinecraftSemVerImpl implements SemVer {

View file

@ -3,10 +3,10 @@ format_version = "1.0.0"
[frog.mod]
id = "frogloader"
name = "Nonsense Loader"
name = "FrogLoader"
version = "${version}"
license = "Apache-2.0"
credits = [
{ name = "Nonsense Team", roles = ["author"] }
{ name = "FrogMC Team", roles = ["author"] }
]