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: 4 additions & 4 deletions Assets/Tests/Editor/NativeCliInstallerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void RunUninstallCommand_WhenCanceledReportsUninstallCommand()
[Test]
public async Task WaitForUninstallCompletionAsync_WhenTargetRemainsReportsTimeout()
{
// Verifies uninstall completion reports the launcher path when deferred self-removal times out.
// Verifies uninstall completion reports the dispatcher path when deferred self-removal times out.
string targetPath = "C:\\Users\\ExampleUser\\Programs\\uloop\\bin\\uloop.exe";
int delayCount = 0;

Expand All @@ -463,7 +463,7 @@ public async Task WaitForUninstallCompletionAsync_WhenTargetRemainsReportsTimeou
[Test]
public async Task WaitForUninstallCompletionAsync_WhenTargetIsRemovedReturnsSuccess()
{
// Verifies uninstall completion succeeds as soon as deferred launcher self-removal finishes.
// Verifies uninstall completion succeeds as soon as deferred dispatcher self-removal finishes.

CliInstallResult result = await NativeCliUninstallCompletionWaiter.WaitForUninstallCompletionAsync(
"C:\\Users\\ExampleUser\\Programs\\uloop\\bin\\uloop.exe",
Expand All @@ -486,7 +486,7 @@ public void UninstallCompletionTimeout_IsLongEnoughForDeferredWindowsPowerShellC
}

[Test]
public void BuildUninstallCommand_OnMacRunsInstalledLauncher()
public void BuildUninstallCommand_OnMacRunsInstalledDispatcher()
{
// Verifies that editor uninstall delegates removal to the installed uloop command.
NativeCliInstallCommand command = NativeCliCommandBuilder.BuildUninstallCommand(
Expand All @@ -499,7 +499,7 @@ public void BuildUninstallCommand_OnMacRunsInstalledLauncher()
}

[Test]
public void BuildUninstallCommand_OnWindowsRunsInstalledLauncher()
public void BuildUninstallCommand_OnWindowsRunsInstalledDispatcher()
{
// Verifies that Windows editor uninstall delegates removal to the installed uloop command.
NativeCliInstallCommand command = NativeCliCommandBuilder.BuildUninstallCommand(
Expand Down
8 changes: 4 additions & 4 deletions cli/common/clicore/command_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ var NativeCommands = []NativeCommandEntry{
{Name: PausePointStatusUserCommandName, Description: "Show the state of a named UloopPausePoint.Pause marker", Owner: RunnerOwned},
{Name: SkillsCommandName, Description: "List, install, or uninstall agent skills", Owner: DispatcherOwned},
{Name: CompletionCommand, Description: "Deprecated: shell completion has been removed; this command is now a no-op", Owner: DispatcherOwned},
{Name: InstallCommandName, Description: "Configure the global uloop launcher binary", Owner: DispatcherOwned},
{Name: UpdateCommandName, Description: "Update the global uloop launcher binary", Owner: DispatcherOwned},
{Name: UninstallCommandName, Description: "Remove the global uloop launcher binary", Owner: DispatcherOwned},
{Name: InstallCommandName, Description: "Configure the global uloop dispatcher binary", Owner: DispatcherOwned},
{Name: UpdateCommandName, Description: "Update the global uloop dispatcher binary", Owner: DispatcherOwned},
{Name: UninstallCommandName, Description: "Remove the global uloop dispatcher binary", Owner: DispatcherOwned},
{Name: VersionCommandName, Description: "Show the installed uloop version", Owner: DispatcherOwned},
}

// IsDispatcherOwnedCommandName reports whether a native command belongs to the
// global launcher's process. This is the single source of truth for the
// global dispatcher's process. This is the single source of truth for the
// dispatcher/runner command split: the dispatcher handles these in-process, and
// the project runner must reject them instead of executing them.
func IsDispatcherOwnedCommandName(command string) bool {
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/dispatchercontract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var contractFiles embed.FS
var DispatcherCurrent = mustLoadDispatcherContract()

type DispatcherContract struct {
// DispatcherVersion is the launcher release version. It moves only when the dispatcher
// DispatcherVersion is the dispatcher release version. It moves only when the dispatcher
// itself is released, not when project-local CLI releases move.
DispatcherVersion string `json:"dispatcherVersion"`
}
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/dispatchercontract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestDispatcherContractProvidesRuntimeVersion(t *testing.T) {
// Verifies that the launcher owns a release version independent from project-local CLI releases.
// Verifies that the dispatcher owns a release version independent from project-local CLI releases.
clitest.RequireValidContractVersion(t, "dispatcherVersion", DispatcherCurrent.DispatcherVersion)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func unsupportedPlatformError(message string, context clierrors.ErrorContext) (c
context,
[]string{
"Run `uloop update` on macOS or Windows.",
"Install the latest uloop launcher manually on this platform.",
"Install the latest uloop dispatcher manually on this platform.",
}), true
case installUnsupportedOSMessage:
return invalidArgumentExecutionError(
Expand All @@ -30,7 +30,7 @@ func unsupportedPlatformError(message string, context clierrors.ErrorContext) (c
context,
[]string{
"Run `uloop uninstall` on macOS or Windows.",
"Remove the uloop launcher binary manually on this platform.",
"Remove the uloop dispatcher binary manually on this platform.",
}), true
default:
return clierrors.CLIError{}, false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// project pin, so each test runs from an empty working directory where any
// accidental forwarding would fail with a pin resolution error.

// Verifies the global launcher reports dispatcher identity fields in JSON version output.
// Verifies the global uloop binary reports dispatcher identity fields in JSON version output.
func TestRunDispatcherVersionJSONReportsDispatcherIdentity(t *testing.T) {
t.Chdir(t.TempDir())

Expand Down Expand Up @@ -102,7 +102,7 @@ func TestRunDispatcherUpdateRunsInDispatcherProcess(t *testing.T) {
if !updateExecuted {
t.Fatal("expected update to run in the dispatcher process")
}
if !strings.Contains(stdout.String(), "Updating global uloop launcher") {
if !strings.Contains(stdout.String(), "Updating global uloop dispatcher") {
t.Fatalf("update output mismatch: %s", stdout.String())
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/internal/dispatcher/dispatcher_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func tryHandleProjectScopeHelpRequest(args []string, projectPath string, stdout

func tryHandleDispatcherInfoRequest(args []string, stdout io.Writer) (bool, int) {
if len(args) == 0 || clicore.IsHelpRequest(args) {
printLauncherHelp(stdout)
printDispatcherHelp(stdout)
return true, 0
}
if clicore.IsVersionJSONRequest(args) {
Expand Down
4 changes: 2 additions & 2 deletions cli/dispatcher/internal/dispatcher/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func TestRunDispatcherLaunchOptionsDoNotRequireProjectPin(t *testing.T) {
}

func TestRunDispatcherVersionUsesDispatcherVersion(t *testing.T) {
// Verifies the global launcher reports its own dispatcher release version.
// Verifies `uloop --version` reports the dispatcher release version instead of the project runner version.
t.Chdir(t.TempDir())

var stdout bytes.Buffer
Expand Down Expand Up @@ -469,7 +469,7 @@ func TestEnforceDispatcherFreshnessMarksFailedOptionalUpdateChecked(t *testing.T
}

func TestEnforceDispatcherFreshnessReportsOptionalUpdateVersionChange(t *testing.T) {
// Verifies optional dispatcher self-updates tell users which launcher version will run next.
// Verifies optional dispatcher self-updates tell users which dispatcher version will run next.
t.Setenv(nativepath.CacheDirEnvName, t.TempDir())
deps, restoreDispatcherUpdateHooks := stubDispatcherUpdateHooks(t, "9.9.9")
defer restoreDispatcherUpdateHooks()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ func writeOptionalDispatcherUpdateCompletion(stderr io.Writer, fromVersion strin
}
clicore.WriteFormat(
stderr,
"uloop: dispatcher updated from %s to %s. Future uloop commands will use the updated launcher.\n",
"uloop: dispatcher updated from %s to %s. Future uloop commands will use the updated dispatcher.\n",
normalizedFromVersion,
normalizedToVersion)
}

func writeManualDispatcherUpdateCompletion(stdout io.Writer, fromVersion string, toVersion string) {
if toVersion == "" {
clicore.WriteLine(stdout, "uloop launcher update completed.")
clicore.WriteLine(stdout, "uloop dispatcher update completed.")
return
}
normalizedFromVersion, normalizedToVersion, changed := normalizedDispatcherUpdateVersions(fromVersion, toVersion)
if !changed {
clicore.WriteLine(stdout, "uloop launcher is already up to date at "+normalizedToVersion+".")
clicore.WriteLine(stdout, "uloop dispatcher is already up to date at "+normalizedToVersion+".")
return
}
clicore.WriteLine(stdout, "uloop launcher updated from "+normalizedFromVersion+" to "+normalizedToVersion+".")
clicore.WriteLine(stdout, "uloop dispatcher updated from "+normalizedFromVersion+" to "+normalizedToVersion+".")
}
8 changes: 4 additions & 4 deletions cli/dispatcher/internal/dispatcher/help_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import (
"github.com/hatayama/unity-cli-loop/common/clitest"
)

// Tests that launcher help lists native commands and live-tool discovery guidance without baked-in tools.
func TestPrintLauncherHelpListsNativeCommandsAndLiveToolGuidance(t *testing.T) {
// Tests that dispatcher help lists native commands and live-tool discovery guidance without baked-in tools.
func TestPrintDispatcherHelpListsNativeCommandsAndLiveToolGuidance(t *testing.T) {
var stdout bytes.Buffer

printLauncherHelp(&stdout)
printDispatcherHelp(&stdout)

output := stdout.String()
for _, expected := range []string{
"Dispatcher launcher. Finds the Unity project, then dispatches live Unity tool commands.",
"Dispatcher. Finds the Unity project, then dispatches live Unity tool commands.",
"Native commands:",
" launch",
" focus-window",
Expand Down
4 changes: 2 additions & 2 deletions cli/dispatcher/internal/dispatcher/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func tryHandleInstallRequest(ctx context.Context, args []string, stdout io.Write
return true, 1
}

clicore.WriteLine(stdout, "Configuring global uloop launcher...")
clicore.WriteLine(stdout, "Configuring global uloop dispatcher...")
command := exec.CommandContext(ctx, installCommand.Name, installCommand.Args...)
command.Stdout = stdout
var installerStderr bytes.Buffer
Expand Down Expand Up @@ -153,7 +153,7 @@ func printInstallHelp(stdout io.Writer) {
clicore.WriteLine(stdout, "Usage:")
clicore.WriteLine(stdout, " uloop install [--dir <install-dir>]")
clicore.WriteLine(stdout, "")
clicore.WriteLine(stdout, "Configures the global uloop launcher after the installer places the binary.")
clicore.WriteLine(stdout, "Configures the global uloop dispatcher after the installer places the binary.")
clicore.WriteLine(stdout, "Set ULOOP_INSTALL_DIR or pass --dir to choose the install directory.")
clicore.WriteLine(stdout, "On Windows, updates User PATH and removes legacy npm uloop-cli launchers.")
clicore.WriteLine(stdout, "On macOS, updates shell PATH and removes legacy npm uloop-cli launchers.")
Expand Down
4 changes: 2 additions & 2 deletions cli/dispatcher/internal/dispatcher/run_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ func printHelpForResolvedProject(stdout io.Writer, explicitProjectPath string) {
printMainHelp(stdout, clicontract.ProjectRunnerVersion(), nativeCLIDescription, cache, ok)
}

func printLauncherHelp(stdout io.Writer) {
func printDispatcherHelp(stdout io.Writer) {
printMainHelp(
stdout,
dispatcherVersion,
"Dispatcher launcher. Finds the Unity project, then dispatches live Unity tool commands.",
"Dispatcher. Finds the Unity project, then dispatches live Unity tool commands.",
clicore.ToolsCache{},
false)
}
Expand Down
8 changes: 4 additions & 4 deletions cli/dispatcher/internal/dispatcher/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func tryHandleUninstallRequest(ctx context.Context, args []string, stdout io.Wri
return true, 1
}

clicore.WriteLine(stdout, "Uninstalling global uloop launcher...")
clicore.WriteLine(stdout, "Uninstalling global uloop dispatcher...")
command := exec.CommandContext(ctx, uninstallCommand.Name, uninstallCommand.Args...)
command.Stdout = stdout
command.Stderr = stderr
Expand All @@ -72,9 +72,9 @@ func tryHandleUninstallRequest(ctx context.Context, args []string, stdout io.Wri
}

if uninstallCommand.Deferred {
clicore.WriteFormat(stdout, "Scheduled uloop launcher removal: %s\n", uninstallCommand.TargetPath)
clicore.WriteFormat(stdout, "Scheduled uloop dispatcher removal: %s\n", uninstallCommand.TargetPath)
} else {
clicore.WriteFormat(stdout, "Removed uloop launcher: %s\n", uninstallCommand.TargetPath)
clicore.WriteFormat(stdout, "Removed uloop dispatcher: %s\n", uninstallCommand.TargetPath)
}
writeUninstallPathCompletion(stdout, runtime.GOOS)
return true, 0
Expand All @@ -93,7 +93,7 @@ func printUninstallHelp(stdout io.Writer) {
clicore.WriteLine(stdout, "Usage:")
clicore.WriteLine(stdout, " uloop uninstall")
clicore.WriteLine(stdout, "")
clicore.WriteLine(stdout, "Removes the global uloop launcher binary from the install directory.")
clicore.WriteLine(stdout, "Removes the global uloop dispatcher binary from the install directory.")
clicore.WriteLine(stdout, "Set ULOOP_INSTALL_DIR to uninstall from a custom install directory.")
clicore.WriteLine(stdout, "On Windows, also removes the package-owned install directory from User PATH.")
clicore.WriteLine(stdout, "On macOS, PATH settings are not changed automatically.")
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/internal/dispatcher/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func tryHandleUpdateRequest(ctx context.Context, args []string, stdout io.Writer
return true, 1
}

clicore.WriteLine(stdout, "Updating global uloop launcher...")
clicore.WriteLine(stdout, "Updating global uloop dispatcher...")
if err := updateRunCommand(ctx, updateCommand, stdout, stderr); err != nil {
clierrors.WriteErrorEnvelope(stderr, clierrors.CLIError{
ErrorCode: clierrors.ErrorCodeInternalError,
Expand Down
8 changes: 4 additions & 4 deletions cli/dispatcher/internal/dispatcher/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func TestUpdateExecutionArgsRunsDownloadedInstallerFile(t *testing.T) {
}

func TestTryHandleUpdateRequestReportsVersionChange(t *testing.T) {
// Verifies manual dispatcher updates tell users which launcher version was installed.
// Verifies manual dispatcher updates tell users which dispatcher version was installed.
skipWhenNativeUpdateIsUnsupported(t)
restoreUpdateHooks := stubManualUpdateHooks(t, "9.9.9")
defer restoreUpdateHooks()
Expand All @@ -336,7 +336,7 @@ func TestTryHandleUpdateRequestReportsVersionChange(t *testing.T) {
if !handled || code != 0 {
t.Fatalf("update result mismatch: handled=%t code=%d stderr=%s", handled, code, stderr.String())
}
expected := "uloop launcher updated from " + dispatcherVersion + " to 9.9.9."
expected := "uloop dispatcher updated from " + dispatcherVersion + " to 9.9.9."
if !bytes.Contains(stdout.Bytes(), []byte(expected)) {
t.Fatalf("update output mismatch: %s", stdout.String())
}
Expand All @@ -346,7 +346,7 @@ func TestTryHandleUpdateRequestReportsVersionChange(t *testing.T) {
}

func TestTryHandleUpdateRequestReportsAlreadyCurrentVersion(t *testing.T) {
// Verifies manual dispatcher updates explain when the selected release matches the installed launcher.
// Verifies manual dispatcher updates explain when the selected release matches the installed dispatcher.
skipWhenNativeUpdateIsUnsupported(t)
restoreUpdateHooks := stubManualUpdateHooks(t, dispatcherVersion)
defer restoreUpdateHooks()
Expand All @@ -358,7 +358,7 @@ func TestTryHandleUpdateRequestReportsAlreadyCurrentVersion(t *testing.T) {
if !handled || code != 0 {
t.Fatalf("update result mismatch: handled=%t code=%d stderr=%s", handled, code, stderr.String())
}
expected := "uloop launcher is already up to date at " + dispatcherVersion + "."
expected := "uloop dispatcher is already up to date at " + dispatcherVersion + "."
if !bytes.Contains(stdout.Bytes(), []byte(expected)) {
t.Fatalf("update output mismatch: %s", stdout.String())
}
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/internal/install/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ func TestPosixInstallScriptSilencesLegacyFailureWhenLegacyShimRemains(t *testing
}

func TestPosixInstallScriptSkipsDefaultNpmCleanupForInstallPrefix(t *testing.T) {
// Verifies default npm cleanup does not remove the freshly installed native launcher.
// Verifies default npm cleanup does not remove the freshly installed native dispatcher.
if runtime.GOOS == "windows" {
t.Skip("POSIX shell setup is not available on Windows")
}
Expand Down
6 changes: 3 additions & 3 deletions cli/dispatcher/internal/nativepath/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func DefaultEnvironment() Environment {
}
}

// ResolveInstallDir returns the explicit, environment, or OS default launcher directory.
// ResolveInstallDir returns the explicit, environment, or OS default dispatcher directory.
func ResolveInstallDir(goos string, explicitInstallDir string, environment Environment) (string, error) {
if explicitInstallDir != "" {
return explicitInstallDir, nil
Expand All @@ -45,7 +45,7 @@ func ResolveInstallDir(goos string, explicitInstallDir string, environment Envir
return DefaultInstallDir(goos, environment)
}

// DefaultInstallDir returns the OS default package-owned launcher directory.
// DefaultInstallDir returns the OS default package-owned dispatcher directory.
func DefaultInstallDir(goos string, environment Environment) (string, error) {
switch goos {
case "darwin":
Expand Down Expand Up @@ -96,7 +96,7 @@ func CacheRoot(goos string, environment Environment) (string, error) {
}
}

// CommandPath joins a launcher command name to an install directory using target OS separators.
// CommandPath joins a dispatcher command name to an install directory using target OS separators.
func CommandPath(goos string, installDir string, posixCommandName string, windowsCommandName string) string {
trimmedInstallDir := TrimInstallDir(goos, installDir)
if goos == "windows" {
Expand Down
8 changes: 4 additions & 4 deletions cli/dispatcher/internal/uninstall/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func TestCommandForDarwinRemovesUloopFromInstallDirectory(t *testing.T) {
// Verifies macOS uninstall removes the launcher binary from the selected install directory.
// Verifies macOS uninstall removes the dispatcher binary from the selected install directory.
command, err := CommandForOS("darwin", Options{
InstallDir: "/Users/ExampleUser/.local/bin",
CurrentPID: 1234,
Expand Down Expand Up @@ -41,7 +41,7 @@ func TestCommandForDarwinRemovesUloopFromInstallDirectory(t *testing.T) {
}

func TestCommandForWindowsSchedulesRemovalAfterCurrentProcessExits(t *testing.T) {
// Verifies Windows uninstall defers deletion until the running launcher process exits.
// Verifies Windows uninstall defers deletion until the running dispatcher process exits.
command, err := CommandForOS("windows", Options{
InstallDir: `C:\Users\ExampleUser\AppData\Local\Programs\uloop\bin`,
CurrentPID: 5678,
Expand Down Expand Up @@ -202,8 +202,8 @@ func decodePowerShellCommandForTest(t *testing.T, encodedCommand string) string
return string(utf16.Decode(utf16Values))
}

func TestCommandForWindowsRemovesUserPathBeforeDeletingLauncher(t *testing.T) {
// Verifies Unity does not observe launcher removal before persistent PATH cleanup finishes.
func TestCommandForWindowsRemovesUserPathBeforeDeletingDispatcher(t *testing.T) {
// Verifies Unity does not observe dispatcher removal before persistent PATH cleanup finishes.
deletionScript := windowsDeletionScript(
`C:\Users\ExampleUser\AppData\Local\Programs\uloop\bin\uloop.exe`,
5678)
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/shared-inputs-stamp.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"schemaVersion": 1,
"sharedInputsHash": "4a146ae2b32c8ea65ce2c81cfb254c825ef856b7"
"sharedInputsHash": "417686b615796ec8240c7bb104c4abd43c76dceb"
}
Loading
Loading