Skip to content

Commit

Permalink
Merge SPI into loader sourceset (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n authored Apr 8, 2024
1 parent df388c3 commit 2dfe2ee
Show file tree
Hide file tree
Showing 24 changed files with 17 additions and 43 deletions.
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.

0 comments on commit 2dfe2ee

Please sign in to comment.