Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge SPI into loader sourceset #109

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ changelog.txt
*.7z
/logs/

# SPI tests produce this...
/spi/logs/
# Our tests produce this...
/loader/logs/
10 changes: 9 additions & 1 deletion loader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ 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(project(':spi'))
api("net.neoforged:mergetool:${mergetool_version}:api")
api("org.apache.logging.log4j:log4j-api:${log4j_version}")
api("org.slf4j:slf4j-api:${slf4j_api_version}")
Expand Down Expand Up @@ -36,6 +35,11 @@ dependencies {

testCompileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}")
testRuntimeOnly("cpw.mods:bootstraplauncher:${bootstraplauncher_version}")
testRuntimeOnly("org.apache.logging.log4j:log4j-core:$log4j_version")
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiter_version")
testImplementation("org.powermock:powermock-core:$powermock_version")
testImplementation("org.hamcrest:hamcrest-core:2.2+")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$jupiter_version")
}

spotless {
Expand All @@ -56,3 +60,7 @@ spotless {
bumpThisNumberIfACustomStepChanges(1)
}
}

test {
useJUnitPlatform()
}
8 changes: 0 additions & 8 deletions loader/src/main/java/net/neoforged/fml/loading/FMLLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.neoforged.fml.loading.moddiscovery.ModFile;
import net.neoforged.fml.loading.moddiscovery.ModValidator;
import net.neoforged.fml.loading.targets.CommonLaunchHandler;
import net.neoforged.neoforgespi.Environment;
import org.slf4j.Logger;

public class FMLLoader {
Expand Down Expand Up @@ -92,13 +91,6 @@ static void onInitialLoad(IEnvironment environment, Set<String> otherServices) t
coreModEngine = new CoreModScriptingEngine();
LOGGER.debug(LogMarkers.CORE, "FML found CoreMods version : {}", coreModEngine.getClass().getPackage().getImplementationVersion());

LOGGER.debug(LogMarkers.CORE, "Found ForgeSPI package implementation version {}", Environment.class.getPackage().getImplementationVersion());
LOGGER.debug(LogMarkers.CORE, "Found ForgeSPI package specification {}", Environment.class.getPackage().getSpecificationVersion());
if (Integer.parseInt(Environment.class.getPackage().getSpecificationVersion()) < 2) {
LOGGER.error(LogMarkers.CORE, "Found an out of date ForgeSPI implementation: {}, loading cannot continue", Environment.class.getPackage().getSpecificationVersion());
throw new IncompatibleEnvironmentException("ForgeSPI is out of date, we cannot continue");
}

try {
Class.forName("com.electronwill.nightconfig.core.Config", false, environment.getClass().getClassLoader());
Class.forName("com.electronwill.nightconfig.toml.TomlFormat", false, environment.getClass().getClassLoader());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
package net.neoforged.neoforgespi.language;

import java.lang.annotation.ElementType;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
import org.objectweb.asm.Type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import net.neoforged.neoforgespi.language.*;
import net.neoforged.neoforgespi.language.IModFileInfo;
import net.neoforged.neoforgespi.language.IModInfo;
import net.neoforged.neoforgespi.language.IModLanguageProvider;
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ rootProject.name = 'FancyModLoader'

include 'loader'
include 'earlydisplay'
include 'spi'
29 changes: 0 additions & 29 deletions spi/build.gradle

This file was deleted.

Loading