@@ -67,9 +67,6 @@ public class ModDevPlugin implements Plugin<Project> {
6767 */
6868 static final String JUNIT_GAME_DIR = "build/minecraft-junit" ;
6969
70- private static final String TASK_GROUP = "mod development" ;
71- static final String INTERNAL_TASK_GROUP = "mod development/internal" ;
72-
7370 /**
7471 * Name of the configuration in which we place the required dependencies to develop mods for use in the runtime-classpath.
7572 * We cannot use "runtimeOnly", since the contents of that are published.
@@ -110,7 +107,7 @@ public void apply(Project project) {
110107 var layout = project .getLayout ();
111108 var tasks = project .getTasks ();
112109
113- var ideIntegration = IdeIntegration .of (project );
110+ var ideIntegration = IdeIntegration .of (project , Branding . MDG );
114111
115112 // We use this directory to store intermediate files used during moddev
116113 var modDevBuildDir = layout .getBuildDirectory ().dir ("moddev" );
@@ -182,7 +179,7 @@ public void apply(Project project) {
182179
183180 // it has to contain client-extra to be loaded by FML, and it must be added to the legacy CP
184181 var createArtifacts = tasks .register ("createMinecraftArtifacts" , CreateMinecraftArtifacts .class , task -> {
185- task .setGroup (INTERNAL_TASK_GROUP );
182+ task .setGroup (Branding . MDG . internalTaskGroup () );
186183 task .setDescription ("Creates the NeoForge and Minecraft artifacts by invoking NFRT." );
187184 for (var configuration : createManifestConfigurations ) {
188185 task .addArtifactsToManifest (configuration );
@@ -215,7 +212,7 @@ public void apply(Project project) {
215212
216213 var downloadAssets = tasks .register ("downloadAssets" , DownloadAssets .class , task -> {
217214 // Not in the internal group in case someone wants to "preload" the asset before they go offline
218- task .setGroup (TASK_GROUP );
215+ task .setGroup (Branding . MDG . publicTaskGroup () );
219216 task .setDescription ("Downloads the Minecraft assets and asset index needed to run a Minecraft client or generate client-side resources." );
220217 // While downloadAssets does not require *all* of the dependencies, it does need NeoForge/NeoForm to benefit
221218 // from any caching/overrides applied to these dependencies in Gradle
@@ -306,6 +303,7 @@ public void apply(Project project) {
306303
307304 setupRuns (
308305 project ,
306+ Branding .MDG ,
309307 modDevBuildDir ,
310308 extension .getRuns (),
311309 userDevConfigOnly ,
@@ -342,6 +340,7 @@ public void apply(Project project) {
342340
343341 setupTestTask (
344342 project ,
343+ Branding .MDG ,
345344 userDevConfigOnly ,
346345 tasks .named ("test" , Test .class ),
347346 extension .getUnitTest ().getLoadedMods (),
@@ -473,14 +472,15 @@ private List<Configuration> configureArtifactManifestConfigurations(Project proj
473472 }
474473
475474 static void setupRuns (Project project ,
475+ Branding branding ,
476476 Provider <Directory > argFileDir ,
477477 DomainObjectCollection <RunModel > runs ,
478478 Object runTemplatesSourceFile ,
479479 Consumer <Configuration > configureModulePath ,
480480 Consumer <Configuration > configureLegacyClasspath ,
481481 Provider <RegularFile > assetPropertiesFile
482482 ) {
483- var ideIntegration = IdeIntegration .of (project );
483+ var ideIntegration = IdeIntegration .of (project , branding );
484484
485485 // Create a configuration to resolve DevLaunch without leaking it to consumers
486486 var devLaunchConfig = project .getConfigurations ().create ("devLaunchConfig" , spec -> {
@@ -492,6 +492,7 @@ static void setupRuns(Project project,
492492 runs .all (run -> {
493493 var prepareRunTask = setupRunInGradle (
494494 project ,
495+ branding ,
495496 argFileDir ,
496497 run ,
497498 runTemplatesSourceFile ,
@@ -513,6 +514,7 @@ static void setupRuns(Project project,
513514 */
514515 private static TaskProvider <PrepareRun > setupRunInGradle (
515516 Project project ,
517+ Branding branding ,
516518 Provider <Directory > argFileDir ,
517519 RunModel run ,
518520 Object runTemplatesFile ,
@@ -521,7 +523,7 @@ private static TaskProvider<PrepareRun> setupRunInGradle(
521523 Provider <RegularFile > assetPropertiesFile ,
522524 Configuration devLaunchConfig
523525 ) {
524- var ideIntegration = IdeIntegration .of (project );
526+ var ideIntegration = IdeIntegration .of (project , branding );
525527 var configurations = project .getConfigurations ();
526528 var javaExtension = ExtensionUtils .getExtension (project , "java" , JavaPluginExtension .class );
527529 var tasks = project .getTasks ();
@@ -561,14 +563,14 @@ private static TaskProvider<PrepareRun> setupRunInGradle(
561563 });
562564
563565 var writeLcpTask = tasks .register (InternalModelHelper .nameOfRun (run , "write" , "legacyClasspath" ), WriteLegacyClasspath .class , writeLcp -> {
564- writeLcp .setGroup (INTERNAL_TASK_GROUP );
566+ writeLcp .setGroup (branding . internalTaskGroup () );
565567 writeLcp .setDescription ("Writes the legacyClasspath file for the " + run .getName () + " Minecraft run, containing all dependencies that shouldn't be considered boot modules." );
566568 writeLcp .getLegacyClasspathFile ().set (argFileDir .map (dir -> dir .file (InternalModelHelper .nameOfRun (run , "" , "legacyClasspath" ) + ".txt" )));
567569 writeLcp .addEntries (legacyClasspathConfiguration );
568570 });
569571
570572 var prepareRunTask = tasks .register (InternalModelHelper .nameOfRun (run , "prepare" , "run" ), PrepareRun .class , task -> {
571- task .setGroup (INTERNAL_TASK_GROUP );
573+ task .setGroup (branding . internalTaskGroup () );
572574 task .setDescription ("Prepares all files needed to launch the " + run .getName () + " Minecraft run." );
573575
574576 task .getGameDirectory ().set (run .getGameDirectory ());
@@ -592,7 +594,7 @@ private static TaskProvider<PrepareRun> setupRunInGradle(
592594 ideIntegration .runTaskOnProjectSync (prepareRunTask );
593595
594596 var createLaunchScriptTask = tasks .register (InternalModelHelper .nameOfRun (run , "create" , "launchScript" ), CreateLaunchScriptTask .class , task -> {
595- task .setGroup (INTERNAL_TASK_GROUP );
597+ task .setGroup (branding . internalTaskGroup () );
596598 task .setDescription ("Creates a bash/shell-script to launch the " + run .getName () + " Minecraft run from outside Gradle or your IDE." );
597599
598600 task .getWorkingDirectory ().set (run .getGameDirectory ().map (d -> d .getAsFile ().getAbsolutePath ()));
@@ -619,7 +621,7 @@ private static TaskProvider<PrepareRun> setupRunInGradle(
619621 ideIntegration .runTaskOnProjectSync (createLaunchScriptTask );
620622
621623 tasks .register (InternalModelHelper .nameOfRun (run , "run" , "" ), RunGameTask .class , task -> {
622- task .setGroup (TASK_GROUP );
624+ task .setGroup (branding . publicTaskGroup () );
623625 task .setDescription ("Runs the " + run .getName () + " Minecraft run configuration." );
624626
625627 // Launch with the Java version used in the project
@@ -656,6 +658,7 @@ public void setupTestTask() {
656658 * @see #setupRunInGradle for a description of the parameters
657659 */
658660 static void setupTestTask (Project project ,
661+ Branding branding ,
659662 Object runTemplatesSourceFile ,
660663 TaskProvider <Test > testTask ,
661664 SetProperty <ModModel > loadedMods ,
@@ -667,7 +670,7 @@ static void setupTestTask(Project project,
667670 ) {
668671 var gameDirectory = new File (project .getProjectDir (), JUNIT_GAME_DIR );
669672
670- var ideIntegration = IdeIntegration .of (project );
673+ var ideIntegration = IdeIntegration .of (project , branding );
671674
672675 var tasks = project .getTasks ();
673676 var configurations = project .getConfigurations ();
@@ -698,7 +701,7 @@ static void setupTestTask(Project project,
698701 var runArgsDir = argFileDir .map (dir -> dir .dir ("junit" ));
699702
700703 var writeLcpTask = tasks .register ("writeNeoForgeTestClasspath" , WriteLegacyClasspath .class , writeLcp -> {
701- writeLcp .setGroup (INTERNAL_TASK_GROUP );
704+ writeLcp .setGroup (branding . internalTaskGroup () );
702705 writeLcp .setDescription ("Writes the legacyClasspath file for the test run, containing all dependencies that shouldn't be considered boot modules." );
703706 writeLcp .getLegacyClasspathFile ().convention (runArgsDir .map (dir -> dir .file ("legacyClasspath.txt" )));
704707 writeLcp .addEntries (legacyClasspathConfiguration );
@@ -708,7 +711,7 @@ static void setupTestTask(Project project,
708711 var programArgsFile = runArgsDir .map (dir -> dir .file ("programArgs.txt" ));
709712 var log4j2ConfigFile = runArgsDir .map (dir -> dir .file ("log4j2.xml" ));
710713 var prepareTask = tasks .register ("prepareNeoForgeTestFiles" , PrepareTest .class , task -> {
711- task .setGroup (INTERNAL_TASK_GROUP );
714+ task .setGroup (branding . internalTaskGroup () );
712715 task .setDescription ("Prepares all files needed to run the JUnit test task." );
713716 task .getGameDirectory ().set (gameDirectory );
714717 task .getVmArgsFile ().set (vmArgsFile );
@@ -748,7 +751,7 @@ private static void setupJarJar(Project project) {
748751 SourceSetContainer sourceSets = ExtensionUtils .getExtension (project , "sourceSets" , SourceSetContainer .class );
749752 sourceSets .all (sourceSet -> {
750753 var jarJarTask = JarJar .registerWithConfiguration (project , sourceSet .getTaskName (null , "jarJar" ));
751- jarJarTask .configure (task -> task .setGroup (INTERNAL_TASK_GROUP ));
754+ jarJarTask .configure (task -> task .setGroup (Branding . MDG . internalTaskGroup () ));
752755
753756 // The target jar task for this source set might not exist, and #named(String) requires the task to exist
754757 var jarTaskName = sourceSet .getJarTaskName ();
0 commit comments