Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Perkins <starkos@industriousone.com>2011-08-16 20:22:08 +0400
committerJason Perkins <starkos@industriousone.com>2011-08-16 20:22:08 +0400
commitb101ac117a34cee87989dbba913b8f044ad27aa1 (patch)
treeb681b8829c798d117a152839cd1e12b5e62f19cb
parent112483417bfdf95a3d59db42b3c8f1296332dccd (diff)
Fixed Xcode3 bug with sources in a subdirectory and grouped in virtual path4.4-beta3
-rw-r--r--src/actions/xcode/xcode_common.lua9
-rw-r--r--tests/actions/vstudio/vc200x/test_filters.lua5
-rw-r--r--tests/actions/xcode/test_xcode_project.lua15
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
---------------------------------------------------------------------------