Fixed Xcode3 bug with sources in a subdirectory and grouped in virtual path

This commit is contained in:
Jason Perkins 2011-08-16 12:22:08 -04:00
parent 112483417b
commit b101ac117a
3 changed files with 22 additions and 7 deletions

View File

@ -325,8 +325,15 @@
src = "absolute"
else
-- something else; probably a source code file
pth = tree.getlocalpath(node)
src = "group"
-- if the parent node is virtual, it won't have a local path
-- of its own; need to use full relative path from project
if node.parent.isvpath then
pth = node.cfg.name
else
pth = tree.getlocalpath(node)
end
end
_p(2,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = %s; name = "%s"; path = "%s"; sourceTree = "<%s>"; };',

View File

@ -56,8 +56,3 @@ local vc200x = premake.vstudio.vc200x
</Filter>
]]
end
-- TODO: should be NO filter, with uuid
-- can I tell if this is a virtual folder by munging the path?
-- can I build that feature into the source tree?

View File

@ -156,6 +156,7 @@
]]
end
function suite.PBXFileReference_ListsXibCorrectly()
files { "English.lproj/MainMenu.xib", "French.lproj/MainMenu.xib" }
prepare()
@ -191,7 +192,7 @@
end
function suite.PBXFileReference_leavesFrameWorkLocationsAsIsWhenSupplied_pathIsSetToInput()
function suite.PBXFileReference_leavesFrameworkLocationsAsIsWhenSupplied_pathIsSetToInput()
local inputFrameWork = 'somedir/Foo.framework'
links(inputFrameWork)
prepare()
@ -252,6 +253,18 @@
end
function suite.PBXFileReference_UsesFullPath_WhenParentIsVirtual()
files { "src/source.c" }
vpaths { ["Source Files"] = "**.c" }
prepare()
xcode.PBXFileReference(tr)
test.capture [[
/* Begin PBXFileReference section */
[source.c] /* source.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = "source.c"; path = "src/source.c"; sourceTree = "<group>"; };
]]
end
---------------------------------------------------------------------------
-- PBXFrameworksBuildPhase tests
---------------------------------------------------------------------------