Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ asm_deprecated = 7.1
netty_version = 4.2.9.Final
lwjgl_version = 3.3.6

# Nsight Graphics
# Check https://docs.nvidia.com/nsight-graphics/UserGuide/launch-application-overview.html#cli-arguments-details for details
# Available Activities:
# Frame Debugger | Graphics Capture | GPU Trace Profiler
nsight_activity = Frame Debugger
# NGFX path should be something like this on Windows: C:\\Program Files\\NVIDIA Corporation\\Nsight Graphics 2025.5.0\\host\\windows-desktop-nomad-x64\\ngfx.exe
nsight_ngfx_path =

# Sets default memory used for Gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx4G
Expand Down
45 changes: 45 additions & 0 deletions projects/cleanroom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,51 @@ tasks.register('userdevExtrasReobf', ReobfuscateJar) {
srg = tasks.createMcp2Srg.output
}

tasks.register("cleanroomClientNsight", Exec) {
group 'forgegradle runs'
dependsOn {
tasks.cleanroomClient.dependsOn
}
doFirst {
def os = org.gradle.internal.os.OperatingSystem.current()
if (!os.isWindows() && !os.isLinux()) {
throw new GradleException("$it.name is only supported on Windows and Linux")
}
os = os.isWindows() ? "Windows" : "Linux"

def activity = props.nsight_activity
if (!activity) {
throw new InvalidUserDataException("\"nsight_activity\" from \"gradle.properties\" must not be empty!")
}

def ngfxPath = props.nsight_ngfx_path
if (!ngfxPath) {
throw new InvalidUserDataException("\"nsight_ngfx_path\" from \"gradle.properties\" must not be empty!")
}

def javaExec = tasks.cleanroomClient.javaLauncher.get().executablePath.asFile.absolutePath
def args = [
"-classpath", rootProject.layout.projectDirectory.file('gradle/wrapper/gradle-wrapper.jar'),
"org.gradle.wrapper.GradleWrapperMain",
tasks.cleanroomClient.name
]

logger.lifecycle "\nJava Executable: $javaExec"
logger.lifecycle "Nsight Graphics NGFX Path: $ngfxPath\n"

commandLine = [
ngfxPath,
"--activity", activity,
"--platform", os,
"--wait-hotkey",
"--dir", workingDir,
"--output-dir", workingDir,
"--exe", javaExec,
"--args", args.join(" ")
]
}
}

userdevJar {
dependsOn userdevExtrasReobf
from(zipTree(tasks.userdevExtrasReobf.output)) {
Expand Down