From 66221c1af7e7241d8e47ce35a3d4c4aef07bdec1 Mon Sep 17 00:00:00 2001 From: Marc Hermans Date: Sun, 28 Jul 2024 17:44:49 +0200 Subject: [PATCH] Add a default run pattern and set the rendernurse config only for the primary. --- .../neoforged/gradle/common/runs/run/RunTestScopeImpl.java | 3 +-- .../java/net/neoforged/gradle/common/util/run/RunsUtil.java | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/net/neoforged/gradle/common/runs/run/RunTestScopeImpl.java b/common/src/main/java/net/neoforged/gradle/common/runs/run/RunTestScopeImpl.java index 4370744f..614ba42c 100644 --- a/common/src/main/java/net/neoforged/gradle/common/runs/run/RunTestScopeImpl.java +++ b/common/src/main/java/net/neoforged/gradle/common/runs/run/RunTestScopeImpl.java @@ -11,7 +11,6 @@ public abstract class RunTestScopeImpl implements RunTestScope { private static final String DEFAULT_PATTERN = ".*"; - private static final String NOTHING_DEFINED_MARKER = "__________NOTHING_DEFINED__________"; private final Project project; @@ -26,7 +25,7 @@ public RunTestScopeImpl(Project project) { .orElse(getMethod()) .orElse(getCategory()) .getOrNull() == null) { - return NOTHING_DEFINED_MARKER; + return DEFAULT_PATTERN; } return null; diff --git a/common/src/main/java/net/neoforged/gradle/common/util/run/RunsUtil.java b/common/src/main/java/net/neoforged/gradle/common/util/run/RunsUtil.java index c1ad97fc..5b2ed009 100644 --- a/common/src/main/java/net/neoforged/gradle/common/util/run/RunsUtil.java +++ b/common/src/main/java/net/neoforged/gradle/common/util/run/RunsUtil.java @@ -187,12 +187,9 @@ public static void setupRenderDocSupport(Project project, Run run) { run.getDependsOn().add(setupRenderDoc); - Configuration renderNurse; + Configuration renderNurse = null; if (run.getModSources().getPrimary().isPresent()) { renderNurse = addLocalRenderNurse(run.getModSources().getPrimary().get()); - } else { - renderNurse = null; - run.getModSources().whenSourceSetAdded(RunsUtil::addLocalRenderNurse); } if (renderNurse == null) {