From 29c5dfd3708f325f8a5448d349b4aa354aff4cfb Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 15 Aug 2023 22:37:54 +0800 Subject: [PATCH] add back the user-repo --- tools/scripts/xmake.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/scripts/xmake.lua b/tools/scripts/xmake.lua index bb02927..f1f2e2d 100644 --- a/tools/scripts/xmake.lua +++ b/tools/scripts/xmake.lua @@ -24,6 +24,8 @@ set_xmakever("2.7.2") local dir = "" local rcfiles = os.getenv("XMAKE_RCFILES") +local user_repo = os.getenv("RT_XMAKE_USERREPO_DIR") + if rcfiles then dir = path.directory(rcfiles) .. "/" end @@ -33,9 +35,18 @@ includes(dir .. "rules.lua") includes(dir .. "tasks.lua") includes(dir .. "toolchains.lua") +if user_repo then + add_repositories("user-repo " .. user_repo) +end + for _, item in ipairs(os.dirs(dir .. "../../repo*")) do - bn = path.basename(item) - add_repositories(bn .. " " .. item) + if os.isfile(item .. "/repo/xmake.lua") then + bn = path.basename(item) + add_repositories(bn .. " " .. item .. "/repo") + elseif os.isdir(item .. "/packages") and os.isfile(item .. "/xmake.lua") then + bn = path.basename(item) + add_repositories(bn .. " " .. item) + end end local archs = {