Move Iface injection to new MinecraftJarProcessor API

This commit is contained in:
modmuss50
2022-10-09 14:08:23 +01:00
parent 47987b2aa3
commit 00a3b7ff4e
14 changed files with 202 additions and 254 deletions

View File

@@ -38,15 +38,15 @@ public interface InterfaceInjectionExtensionAPI {
*/
Property<Boolean> getEnableDependencyInterfaceInjection();
Property<Boolean> getIsEnabled();
/**
* Contains a list of {@link SourceSet} that may contain a fabric.mod.json file with interfaces to inject.
* By default, this list contains only the main {@link SourceSet}.
*
* @return the list property containing the {@link SourceSet}
* @deprecated now uses the source sets defined in {@link LoomGradleExtensionAPI#getMods()}
*/
@Deprecated(forRemoval = true)
ListProperty<SourceSet> getInterfaceInjectionSourceSets();
default boolean isEnabled() {
return getEnableDependencyInterfaceInjection().get() || !getInterfaceInjectionSourceSets().get().isEmpty();
return getIsEnabled().get();
}
}

View File

@@ -24,7 +24,9 @@
package net.fabricmc.loom.api.processor;
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace;
import net.fabricmc.loom.configuration.providers.minecraft.MinecraftJarConfiguration;
import net.fabricmc.tinyremapper.TinyRemapper;
public interface ProcessorContext {
MinecraftJarConfiguration getJarConfiguration();
@@ -34,4 +36,6 @@ public interface ProcessorContext {
boolean includesClient();
boolean includesServer();
TinyRemapper createRemapper(MappingsNamespace from, MappingsNamespace to);
}

View File

@@ -34,6 +34,9 @@ public interface SpecContext {
List<FabricModJson> localMods();
// Returns mods that are both on the compile and runtime classpath
List<FabricModJson> modDependenciesCompileRuntime();
default List<FabricModJson> allMods() {
return Stream.concat(modDependencies().stream(), localMods().stream()).toList();
}