File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
src/main/java/net/neoforged/nfrtgradle Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -662,6 +662,10 @@ neoFormRuntime {
662662 // Print more information when NFRT cannot use a cached result
663663 // Gradle Property: neoForge.neoFormRuntime.analyzeCacheMisses
664664 analyzeCacheMisses = true
665+
666+ // Overrides the launcher manifest URL used by NFRT to look up Minecraft versions
667+ // Gradle Property: neoForge.neoFormRuntime.launcherManifestUrl
668+ launcherManifestUrl = "https://.../version_manifest_v2.json"
665669}
666670```
667671
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public NeoFormRuntimeExtension(Project project) {
2121 getEnableCache ().convention (PropertyUtils .getBooleanProperty (project , "neoForge.neoFormRuntime.enableCache" ).orElse (true ));
2222 getVerbose ().convention (PropertyUtils .getBooleanProperty (project , "neoForge.neoFormRuntime.verbose" ).orElse (false ));
2323 getAnalyzeCacheMisses ().convention (PropertyUtils .getBooleanProperty (project , "neoForge.neoFormRuntime.analyzeCacheMisses" ).orElse (false ));
24+ getLauncherManifestUrl ().convention (PropertyUtils .getStringProperty (project , "neoForge.neoFormRuntime.launcherManifestUrl" ));
2425 }
2526
2627 /**
@@ -66,4 +67,12 @@ public NeoFormRuntimeExtension(Project project) {
6667 * <b>Gradle property:</b> {@code neoForge.neoFormRuntime.analyzeCacheMisses}.
6768 */
6869 public abstract Property <Boolean > getAnalyzeCacheMisses ();
70+
71+ /**
72+ * URL for the Minecraft Launcher manifest used to resolve Minecraft version information.
73+ * <p>
74+ * <b>Default:</b> {@code https://piston-meta.mojang.com/mc/game/version_manifest_v2.json}<br>
75+ * <b>Gradle property:</b> {@code neoForge.neoFormRuntime.launcherManifestUrl}.
76+ */
77+ public abstract Property <String > getLauncherManifestUrl ();
6978}
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public void apply(Project project) {
3939 project .getTasks ().withType (NeoFormRuntimeTask .class ).configureEach (task -> {
4040 task .getNeoFormRuntime ().convention (toolConfiguration );
4141 task .getVerbose ().convention (extension .getVerbose ());
42+ task .getLauncherManifestUrl ().convention (extension .getLauncherManifestUrl ());
4243 // Every invocation of NFRT should inherit the tools it's using itself via Gradle
4344 task .addArtifactsToManifest (externalToolsConfiguration );
4445 });
Original file line number Diff line number Diff line change 2222import org .gradle .api .tasks .Input ;
2323import org .gradle .api .tasks .InputFiles ;
2424import org .gradle .api .tasks .Internal ;
25+ import org .gradle .api .tasks .Optional ;
2526import org .gradle .jvm .toolchain .JavaLanguageVersion ;
2627import org .gradle .jvm .toolchain .JavaToolchainService ;
2728import org .gradle .process .ExecOperations ;
@@ -53,6 +54,14 @@ public abstract class NeoFormRuntimeTask extends DefaultTask {
5354 @ InputFiles
5455 public abstract ConfigurableFileCollection getNeoFormRuntime ();
5556
57+ /**
58+ * URL for the Minecraft Launcher manifest used to resolve Minecraft version information.
59+ * When none is given, it defaults to {@code https://piston-meta.mojang.com/mc/game/version_manifest_v2.json}.
60+ */
61+ @ Input
62+ @ Optional
63+ public abstract Property <String > getLauncherManifestUrl ();
64+
5665 /**
5766 * Enable verbose output for the NFRT engine. Defaults to false.
5867 */
@@ -125,6 +134,11 @@ public final void run(List<String> args) {
125134 realArgs .add (2 , "--work-dir" );
126135 realArgs .add (3 , getWorkDirectory ().get ().getAsFile ().getAbsolutePath ());
127136
137+ if (getLauncherManifestUrl ().isPresent ()) {
138+ realArgs .add ("--launcher-meta-uri" );
139+ realArgs .add (getLauncherManifestUrl ().get ());
140+ }
141+
128142 if (getVerbose ().get ()) {
129143 realArgs .add ("--verbose" );
130144 }
You can’t perform that action at this time.
0 commit comments