Skip to content

Commit 6a39670

Browse files
committed
Add more options and condition checks
1 parent 9cc2d4f commit 6a39670

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ netty_version = 4.2.9.Final
2222
lwjgl_version = 3.3.6
2323

2424
# Nsight Graphics
25-
# Should be something like C:\\Program Files\\NVIDIA Corporation\\Nsight Graphics 2025.5.0\\host\\windows-desktop-nomad-x64\\ngfx.exe
25+
# Activity could be Graphics Capture OR Frame Debugger OR GPU Trace Profiler, etc.
26+
# Check https://docs.nvidia.com/nsight-graphics/UserGuide/launch-application-overview.html#cli-arguments-details for details
27+
nsight_activity = Frame Debugger
28+
# Platform must be either Windows OR Linux
29+
nsight_platform =
30+
# NGFX path should be something like C:\\Program Files\\NVIDIA Corporation\\Nsight Graphics 2025.5.0\\host\\windows-desktop-nomad-x64\\ngfx.exe
2631
nsight_ngfx_path =
2732

2833
# Sets default memory used for Gradle commands. Can be overridden by user or command line properties.

projects/cleanroom/build.gradle

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,28 @@ tasks.register('userdevExtrasReobf', ReobfuscateJar) {
883883
}
884884

885885
tasks.register("cleanroomClientNsight", Exec) {
886+
def activity = props.nsight_activity
887+
if (!activity) {
888+
throw new InvalidUserDataException("\"nsight_activity\" from \"gradle.properties\" must not be empty!")
889+
}
890+
891+
def platform = props.nsight_platform
892+
if (!platform) {
893+
throw new InvalidUserDataException("\"nsight_platform\" from \"gradle.properties\" must not be empty!")
894+
}
895+
if (platform != "Windows" && platform != "Linux") {
896+
throw new InvalidUserDataException("\"nsight_platform\"=$platform is an invalid value! Must be either Windows OR Linux.")
897+
}
898+
899+
def ngfxPath = props.nsight_ngfx_path
900+
if (!ngfxPath) {
901+
throw new InvalidUserDataException("\"nsight_ngfx_path\" from \"gradle.properties\" must not be empty!")
902+
}
903+
886904
def javaExecTask = tasks.named('cleanroomClient', JavaExec).get()
887905
def workingDir = javaExecTask.workingDir.absolutePath
888906
def javaHome = javaExecTask.getJavaLauncher().get().getMetadata().getInstallationPath().asFile.absolutePath
889907
def gradleWrapperJar = project.rootDir.toPath().resolve("gradle/wrapper/gradle-wrapper.jar").toFile().absolutePath
890-
def ngfxPath = props.nsight_ngfx_path
891908

892909
println "Working Dir: $workingDir"
893910
println "Java Home: $javaHome"
@@ -904,8 +921,8 @@ tasks.register("cleanroomClientNsight", Exec) {
904921

905922
commandLine = [
906923
ngfxPath,
907-
"--activity", "\"Frame Debugger\"",
908-
"--platform", "\"Windows\"",
924+
"--activity", activity,
925+
"--platform", platform,
909926
"--wait-hotkey",
910927
"--dir", workingDir,
911928
"--output-dir", workingDir,

0 commit comments

Comments
 (0)