Xcode4 workspace relative location paths and workspace generation

This commit is contained in:
Liam Devine 2011-03-11 17:08:37 +00:00
parent 98b9815534
commit a02fd77b74
3 changed files with 13 additions and 3 deletions

View File

@ -84,8 +84,8 @@
default_platform = "Universal",
onsolution = function(sln)
-- Assign IDs needed for inter-project dependencies
premake.xcode.preparesolution(sln)
--xcode4.workspace_generate(sln)
premake.generate(sln, "%%.xcworkspace/contents.xcworkspacedata", premake.xcode4.workspace_generate)
end,
onproject = function(prj)

View File

@ -16,7 +16,9 @@ end
function xcode4.workspace_file_ref(prj)
local projpath = path.getrelative(prj.solution.location, prj.location)
if projpath == '.' then projpath = '' end
if projpath == '.' then projpath = ''
else projpath = projpath ..'/'
end
_p(1,'<FileRef')
_p(2,'location = "group:%s">',projpath .. prj.name .. '.xcodeproj')
_p(1,'</FileRef>')

View File

@ -61,3 +61,11 @@
.. CONSTANT_PROJECT_NAME .. '.xcodeproj'
..'">%s+</FileRef>')
end
function suite.pathPrefixAndProjectName_pathIsPathIsDifferentDir_pathPostfixSlashAdded()
prj.location = "foo"
local buffer = get_buffer()
test.string_contains(buffer,'.*<FileRef%s+location = "group:'
.. prj.location .. '/'.. CONSTANT_PROJECT_NAME .. '.xcodeproj'
..'">%s+</FileRef>')
end