diff options
4 files changed, 14 insertions, 6 deletions
diff --git a/xmake/modules/private/service/client_config.lua b/xmake/modules/private/service/client_config.lua index 3c5156673..3c041626b 100644 --- a/xmake/modules/private/service/client_config.lua +++ b/xmake/modules/private/service/client_config.lua @@ -22,6 +22,7 @@ import("core.base.global") import("core.base.base64") import("core.base.bytes") +import("core.project.config") import("private.service.server_config") -- get a local server token @@ -67,6 +68,13 @@ end -- get config file path function configfile() + local projectfile = os.projectfile() + if projectfile and os.isfile(projectfile) then + local localconf = path.join(config.directory(), "service", "client.conf") + if os.isfile(localconf) then + return localconf + end + end return path.join(global.directory(), "service", "client.conf") end diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua index 89715f024..f18c98728 100644 --- a/xmake/modules/private/service/distcc_build/client.lua +++ b/xmake/modules/private/service/distcc_build/client.lua @@ -51,7 +51,7 @@ function distcc_build_client:init() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then self._PROJECTDIR = projectdir - self._WORKDIR = path.join(project_config.directory(), "distcc_build") + self._WORKDIR = path.join(project_config.directory(), "service", "distcc_build") else raise("we need to enter a project directory with xmake.lua first!") end @@ -686,7 +686,7 @@ function is_connected() local projectdir = os.projectdir() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then - local workdir = path.join(project_config.directory(), "distcc_build") + local workdir = path.join(project_config.directory(), "service", "distcc_build") local statusfile = path.join(workdir, "status.txt") if os.isfile(statusfile) then local status = io.load(statusfile) diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua index aaacb2bd1..aea6320c7 100644 --- a/xmake/modules/private/service/remote_build/client.lua +++ b/xmake/modules/private/service/remote_build/client.lua @@ -50,7 +50,7 @@ function remote_build_client:init() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then self._PROJECTDIR = projectdir - self._WORKDIR = path.join(project_config.directory(), "remote_build") + self._WORKDIR = path.join(project_config.directory(), "service", "remote_build") else raise("we need to enter a project directory with xmake.lua first!") end @@ -618,7 +618,7 @@ function is_connected() local projectdir = os.projectdir() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then - local workdir = path.join(project_config.directory(), "remote_build") + local workdir = path.join(project_config.directory(), "service", "remote_build") local statusfile = path.join(workdir, "status.txt") if os.isfile(statusfile) then local status = io.load(statusfile) diff --git a/xmake/modules/private/service/remote_cache/client.lua b/xmake/modules/private/service/remote_cache/client.lua index b6c4d8354..db6525491 100644 --- a/xmake/modules/private/service/remote_cache/client.lua +++ b/xmake/modules/private/service/remote_cache/client.lua @@ -50,7 +50,7 @@ function remote_cache_client:init() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then self._PROJECTDIR = projectdir - self._WORKDIR = path.join(project_config.directory(), "remote_cache") + self._WORKDIR = path.join(project_config.directory(), "service", "remote_cache") else raise("we need to enter a project directory with xmake.lua first!") end @@ -487,7 +487,7 @@ function is_connected() local projectdir = os.projectdir() local projectfile = os.projectfile() if projectfile and os.isfile(projectfile) and projectdir then - local workdir = path.join(project_config.directory(), "remote_cache") + local workdir = path.join(project_config.directory(), "service", "remote_cache") local statusfile = path.join(workdir, "status.txt") if os.isfile(statusfile) then local status = io.load(statusfile) |
