Merge pull request #801 from ricka-github/master
Groups in XCode workspace working.
This commit is contained in:
commit
b22de644b7
@ -44,7 +44,10 @@
|
||||
return prj
|
||||
end
|
||||
|
||||
|
||||
function m.createGroup(wks)
|
||||
local prj = group ("MyGroup" .. (#wks.groups + 1))
|
||||
return prj
|
||||
end
|
||||
|
||||
|
||||
function m.getWorkspace(wks)
|
||||
|
@ -75,6 +75,28 @@
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onMultipleProjectsGrouped()
|
||||
test.createGroup(wks)
|
||||
test.createproject(wks)
|
||||
prepare()
|
||||
test.capture [[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:MyProject.xcodeproj">
|
||||
</FileRef>
|
||||
<Group
|
||||
location = "container:"
|
||||
name = "MyGroup1">
|
||||
<FileRef
|
||||
location = "group:MyProject2.xcodeproj">
|
||||
</FileRef>
|
||||
</Group>
|
||||
</Workspace>
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
local p = premake
|
||||
local m = p.modules.xcode
|
||||
|
||||
local tree = p.tree
|
||||
|
||||
|
||||
---
|
||||
@ -53,18 +53,33 @@
|
||||
end
|
||||
|
||||
function m.workspaceFileRefs(wks)
|
||||
for prj in p.workspace.eachproject(wks) do
|
||||
p.push('<FileRef')
|
||||
local contents = p.capture(function()
|
||||
p.callArray(m.elements.workspaceFileRef, prj)
|
||||
end)
|
||||
p.outln(contents .. ">")
|
||||
p.pop('</FileRef>')
|
||||
end
|
||||
local tr = p.workspace.grouptree(wks)
|
||||
tree.traverse(tr, {
|
||||
onleaf = function(n)
|
||||
local prj = n.project
|
||||
|
||||
p.push('<FileRef')
|
||||
local contents = p.capture(function()
|
||||
p.callArray(m.elements.workspaceFileRef, prj)
|
||||
end)
|
||||
p.outln(contents .. ">")
|
||||
p.pop('</FileRef>')
|
||||
end,
|
||||
|
||||
onbranchenter = function(n)
|
||||
local prj = n.project
|
||||
|
||||
p.push('<Group')
|
||||
p.w('location = "container:"')
|
||||
p.w('name = "%s">', n.name)
|
||||
end,
|
||||
|
||||
onbranchexit = function(n)
|
||||
p.pop('</Group>')
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
--
|
||||
-- Handlers for individual project elements
|
||||
|
Reference in New Issue
Block a user