Implemented the startproject option for xcode by copying the functionality from vs2005.

This commit is contained in:
Joshua Bodine 2019-02-06 21:02:26 -07:00
parent 339a5f6f83
commit 0d928d6093

View File

@ -19,6 +19,7 @@
return {
m.xmlDeclaration,
m.workspace,
m.reorderProjects,
m.workspaceFileRefs,
m.workspaceTail,
}
@ -42,6 +43,39 @@
end
--
-- If a startup project is specified, move it (and any enclosing groups)
-- to the front of the project list. This will make Visual Studio treat
-- it like a startup project.
--
-- I force the new ordering into the tree so that it will get applied to
-- all sections of the solution; otherwise the first change to the solution
-- in the IDE will cause the orderings to get rewritten.
--
function m.reorderProjects(wks)
if wks.startproject then
local np
local tr = p.workspace.grouptree(wks)
tree.traverse(tr, {
onleaf = function(n)
if n.project.name == wks.startproject then
np = n
end
end
})
while np and np.parent do
local p = np.parent
local i = table.indexof(p.children, np)
table.remove(p.children, i)
table.insert(p.children, 1, np)
np = p
end
end
end
---
-- Generate the list of project references.
---