diff --git a/modules/self-test/test_helpers.lua b/modules/self-test/test_helpers.lua index 4faf2a8b..c6754784 100644 --- a/modules/self-test/test_helpers.lua +++ b/modules/self-test/test_helpers.lua @@ -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) diff --git a/modules/xcode/tests/test_xcode4_workspace.lua b/modules/xcode/tests/test_xcode4_workspace.lua index e4427ed4..d8f6641f 100644 --- a/modules/xcode/tests/test_xcode4_workspace.lua +++ b/modules/xcode/tests/test_xcode4_workspace.lua @@ -75,6 +75,28 @@ ]] end + function suite.onMultipleProjectsGrouped() + test.createGroup(wks) + test.createproject(wks) + prepare() + test.capture [[ + + + + + + + + + + ]] + end + -- diff --git a/modules/xcode/xcode4_workspace.lua b/modules/xcode/xcode4_workspace.lua index 58bf0fd1..547e387f 100644 --- a/modules/xcode/xcode4_workspace.lua +++ b/modules/xcode/xcode4_workspace.lua @@ -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('") - p.pop('') - end + local tr = p.workspace.grouptree(wks) + tree.traverse(tr, { + onleaf = function(n) + local prj = n.project + + p.push('") + p.pop('') + end, + + onbranchenter = function(n) + local prj = n.project + + p.push('', n.name) + end, + + onbranchexit = function(n) + p.pop('') + end, + }) end - - --------------------------------------------------------------------------- -- -- Handlers for individual project elements