Implement CodeLite workspace folders
--
-- Header
--
- _p('<?xml version="1.0" encoding="UTF-8"?>')
+ p.w('<?xml version="1.0" encoding="UTF-8"?>')
local tagsdb = ""
-- local tagsdb = "./" .. wks.name .. ".tags"
- _p('<CodeLite_Workspace Name="%s" Database="%s" SWTLW="No">', wks.name, tagsdb)
+ p.push('<CodeLite_Workspace Name="%s" Database="%s" SWTLW="No">', wks.name, tagsdb)
--
-- Project list
prjpath = path.getrelative(prj.workspace.location, prjpath)
if (prj.name == wks.startproject) then
- _x(1, '<Project Name="%s" Path="%s" Active="Yes"/>', prj.name, prjpath)
+ p.w('<Project Name="%s" Path="%s" Active="Yes"/>', prj.name, prjpath)
else
- _x(1, '<Project Name="%s" Path="%s"/>', prj.name, prjpath)
+ p.w('<Project Name="%s" Path="%s"/>', prj.name, prjpath)
end
end,
- onbranch = function(n)
- -- TODO: not sure what situation this appears...?
- -- premake5.lua emit's one of these for 'contrib', which is a top-level folder with the zip projects
+ onbranchenter = function(n)
+ p.push('<VirtualDirectory Name="%s">', n.name)
+ end,
+
+ onbranchexit = function(n)
+ p.pop('</VirtualDirectory>')
end,
})
end
-- for each workspace config
- _p(1, '<BuildMatrix>')
+ p.push('<BuildMatrix>')
for cfg in workspace.eachconfig(wks) do
local cfgname = codelite.cfgname(cfg)
- _p(2, '<WorkspaceConfiguration Name="%s" Selected="yes">', cfgname)
+ p.push('<WorkspaceConfiguration Name="%s" Selected="yes">', cfgname)
local tr = workspace.grouptree(wks)
tree.traverse(tr, {
onleaf = function(n)
local prj = n.project
- _p(3, '<Project Name="%s" ConfigName="%s"/>', prj.name, cfgname)
+ p.w('<Project Name="%s" ConfigName="%s"/>', prj.name, cfgname)
end
})
- _p(2, '</WorkspaceConfiguration>')
+ p.pop('</WorkspaceConfiguration>')
end
- _p(1, '</BuildMatrix>')
+ p.pop('</BuildMatrix>')
- _p('</CodeLite_Workspace>')
+ p.pop('</CodeLite_Workspace>')
end
