summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-11-07 22:45:06 +0800
committerruki <[email protected]>2024-11-07 22:45:06 +0800
commit8b871d5c3a04a3529423d22ef4d55a5060b2c314 (patch)
tree2b546ae32f0424593efd5bdb8f399ee45be0eb3a
parent86936573d8659a0a3a0d4507c1e89f65459e202f (diff)
improve group
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 8c1a477e7..e566ab160 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -301,18 +301,25 @@ function _make_vsinfo_groups()
for targetname, target in table.orderpairs(project.targets()) do
local group_path = target:get("group")
if group_path and #(group_path:trim()) > 0 then
+ group_path = path.normalize(group_path)
local group_name = path.filename(group_path)
local group_names = path.split(group_path)
+ local group_current_path
for idx, name in ipairs(group_names) do
- local group = groups["group." .. name] or {}
+ group_current_path = group_current_path and path.join(group_current_path, name) or name
+ local group = groups["group." .. group_current_path] or {}
group.group = name
- group.group_id = hash.uuid4("group." .. name)
+ group.group_id = hash.uuid4("group." .. group_current_path)
if idx > 1 then
- group_deps["group_dep." .. name] = {current_id = group.group_id, parent_id = hash.uuid4("group." .. group_names[idx - 1])}
+ group_deps["group_dep." .. group_current_path] = {
+ current_id = group.group_id,
+ parent_id = hash.uuid4("group." .. path.directory(group_current_path))}
end
- groups["group." .. name] = group
+ groups["group." .. group_current_path] = group
end
- group_deps["group_dep.target." .. targetname] = {current_id = hash.uuid4(targetname), parent_id = groups["group." .. group_name].group_id}
+ group_deps["group_dep.target." .. targetname] = {
+ current_id = hash.uuid4(targetname),
+ parent_id = groups["group." .. group_path].group_id}
end
end
return groups, group_deps