diff options
| author | ruki <[email protected]> | 2023-12-22 23:21:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-12-22 23:21:45 +0800 |
| commit | f7a722e1af4369a7b8f78ebdcf53edf57699d34e (patch) | |
| tree | 816f34971d8f6508d55df1d770516aa4132b8f03 | |
| parent | 959d8fee74f9b68948838467d99673565acfe99e (diff) | |
set remote session
4 files changed, 6 insertions, 3 deletions
diff --git a/xmake/actions/service/xmake.lua b/xmake/actions/service/xmake.lua index 2473c186b..220330f77 100644 --- a/xmake/actions/service/xmake.lua +++ b/xmake/actions/service/xmake.lua @@ -39,6 +39,9 @@ task("service") " - xmake service --connect --remote", " - xmake service --connect --distcc", " - xmake service --connect --remote --distcc" }, + {nil, "session" , "kv", nil,"Connect with the given session name, it will generate a session id via name.", + "e.g.", + " -- xmake service --connect --ccache --session=foo" }, {nil, "reconnect", "k", nil, "Reconnect current project to the remote daemon service." }, {nil, "disconnect", "k", nil, "Disconnect current project in the remote daemon service." }, {nil, "remote", "k", nil, "Start or connect the remote build service." }, diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua index 70b5d4784..51cd74fd5 100644 --- a/xmake/modules/private/service/distcc_build/client.lua +++ b/xmake/modules/private/service/distcc_build/client.lua @@ -499,7 +499,7 @@ function distcc_build_client:_session_id(addr, port) return host.session_id end end - return hash.uuid():split("-", {plain = true})[1]:lower() + return hash.uuid(option.get("session")):split("-", {plain = true})[1]:lower() end -- is connected for the given host diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua index f4385015c..9f8c68504 100644 --- a/xmake/modules/private/service/remote_build/client.lua +++ b/xmake/modules/private/service/remote_build/client.lua @@ -402,7 +402,7 @@ end -- get the session id, only for unique project function remote_build_client:session_id() - return self:status().session_id or hash.uuid():split("-", {plain = true})[1]:lower() + return self:status().session_id or hash.uuid(option.get("session")):split("-", {plain = true})[1]:lower() end -- set the given client address diff --git a/xmake/modules/private/service/remote_cache/client.lua b/xmake/modules/private/service/remote_cache/client.lua index 2f61ad5ec..4deb111e3 100644 --- a/xmake/modules/private/service/remote_cache/client.lua +++ b/xmake/modules/private/service/remote_cache/client.lua @@ -368,7 +368,7 @@ end -- get the session id, only for unique project function remote_cache_client:session_id() - return self:status().session_id or hash.uuid():split("-", {plain = true})[1]:lower() + return self:status().session_id or hash.uuid(option.get("session")):split("-", {plain = true})[1]:lower() end -- set the given client address |
