Skip to content

Commit

Permalink
Add "productionRuntimeMods" configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jan 27, 2025
1 parent fc26023 commit 74795b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public void run() {
extendsFrom(Constants.Configurations.MINECRAFT_TEST_CLIENT_RUNTIME_LIBRARIES, Constants.Configurations.MINECRAFT_NATIVES);
extendsFrom(Constants.Configurations.MINECRAFT_TEST_CLIENT_RUNTIME_LIBRARIES, Constants.Configurations.MINECRAFT_CLIENT_RUNTIME_LIBRARIES);
extendsFrom(Constants.Configurations.MINECRAFT_TEST_CLIENT_RUNTIME_LIBRARIES, Constants.Configurations.LOADER_DEPENDENCIES);

register(Constants.Configurations.PRODUCTION_RUNTIME_MODS, Role.RESOLVABLE);
}

private NamedDomainObjectProvider<Configuration> register(String name, Role role) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ public AbstractProductionRunTask() {
if (!GradleUtils.getBooleanProperty(getProject(), Constants.Properties.DONT_REMAP)) {
getMods().from(getProject().getTasks().named(RemapTaskConfiguration.REMAP_JAR_TASK_NAME));
}

getMods().from(getProject().getConfigurations().named(Constants.Configurations.PRODUCTION_RUNTIME_MODS));
}

@TaskAction
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/fabricmc/loom/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public static final class Configurations {
* The configuration that contains the Minecraft client and loader runtime libraries, as used by the production run tasks.
*/
public static final String MINECRAFT_TEST_CLIENT_RUNTIME_LIBRARIES = "minecraftTestClientRuntimeLibraries";
/**
* Mods to be used by {@link net.fabricmc.loom.task.prod.AbstractProductionRunTask} tasks by default.
*/
public static final String PRODUCTION_RUNTIME_MODS = "productionRuntimeMods";

private Configurations() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,16 @@ class RunConfigTest extends Specification implements GradleProjectTestTrait {
def gradle = gradleProject(project: "minimalBase", version: version)
gradle.buildGradle << '''
configurations {
productionMods
}
dependencies {
minecraft "com.mojang:minecraft:1.21.4"
mappings "net.fabricmc:yarn:1.21.4+build.4:v2"
modImplementation "net.fabricmc:fabric-loader:0.16.9"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.114.0+1.21.4"
productionMods "net.fabricmc.fabric-api:fabric-api:0.114.0+1.21.4"
productionRuntimeMods "net.fabricmc.fabric-api:fabric-api:0.114.0+1.21.4"
}
tasks.register("prodClient", net.fabricmc.loom.task.prod.ClientProductionRunTask) {
mods.from(configurations.productionMods)
jvmArgs.add("-Dfabric.client.gametest")
tracy {
Expand Down

0 comments on commit 74795b0

Please sign in to comment.