diff options
-rw-r--r-- | src/actions/xcode/xcode_common.lua | 9 | ||||
-rw-r--r-- | tests/actions/vstudio/vc200x/test_filters.lua | 5 | ||||
-rw-r--r-- | tests/actions/xcode/test_xcode_project.lua | 15 |
3 files changed, 22 insertions, 7 deletions
diff --git a/src/actions/xcode/xcode_common.lua b/src/actions/xcode/xcode_common.lua index bda20e4..5ebfb0d 100644 --- a/src/actions/xcode/xcode_common.lua +++ b/src/actions/xcode/xcode_common.lua @@ -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>"; };', diff --git a/tests/actions/vstudio/vc200x/test_filters.lua b/tests/actions/vstudio/vc200x/test_filters.lua index 0d057ef..d2bb3cd 100644 --- a/tests/actions/vstudio/vc200x/test_filters.lua +++ b/tests/actions/vstudio/vc200x/test_filters.lua @@ -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?
\ No newline at end of file diff --git a/tests/actions/xcode/test_xcode_project.lua b/tests/actions/xcode/test_xcode_project.lua index 642e68e..4ab50ba 100644 --- a/tests/actions/xcode/test_xcode_project.lua +++ b/tests/actions/xcode/test_xcode_project.lua @@ -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 --------------------------------------------------------------------------- |