Renamed file config fullpath to relpath; better matches corresponding abspath field, less confusing

This commit is contained in:
Jason Perkins 2012-03-21 16:10:16 -04:00
parent a2aa2f83e1
commit a1f9c7c376
5 changed files with 13 additions and 15 deletions

View File

@ -702,7 +702,7 @@
-- source files are handled at the leaves
onleaf = function(node, depth)
_p(depth, '<File')
_p(depth, '\tRelativePath="%s"', path.translate(node.cfg.fullpath))
_p(depth, '\tRelativePath="%s"', path.translate(node.cfg.relpath))
_p(depth, '\t>')
vc200x.fileConfiguration(prj, node, depth + 1)

View File

@ -380,7 +380,7 @@
if #files > 0 then
_p(1,'<ItemGroup>')
for _, file in ipairs(files) do
_x(2,'<%s Include=\"%s\" />', group, path.translate(file.fullpath))
_x(2,'<%s Include=\"%s\" />', group, path.translate(file.relpath))
end
_p(1,'</ItemGroup>')
end
@ -389,18 +389,16 @@
function vc2010.compilerfilesgroup_ng(prj)
local files = vc2010.getfilegroup_ng(prj, "ClCompile")
if #files > 0 then
local pchsource = project.getrelative(prj, prj.pchsource)
_p(1,'<ItemGroup>')
for _, file in ipairs(files) do
_x(2,'<ClCompile Include=\"%s\">', path.translate(file.fullpath))
_x(2,'<ClCompile Include=\"%s\">', path.translate(file.relpath))
for cfg in project.eachconfig(prj) do
local filecfg = config.getfileconfig(cfg, file.abspath)
if not filecfg then
_p(3,'<ExcludedFromBuild %s>true</ExcludedFromBuild>', vc2010.condition(cfg))
end
if pchsource == file.fullpath and not cfg.flags.NoPCH then
if prj.pchsource == file.abspath and not cfg.flags.NoPCH then
_p(3,'<PrecompiledHeader %s>Create</PrecompiledHeader>', vc2010.condition(cfg))
end
end
@ -415,7 +413,7 @@
if #files > 0 then
_p(1,'<ItemGroup>')
for _, file in ipairs(files) do
_x(2,'<CustomBuild Include=\"%s\">', path.translate(file.fullpath))
_x(2,'<CustomBuild Include=\"%s\">', path.translate(file.relpath))
_p(3,'<FileType>Document</FileType>')
for cfg in project.eachconfig(prj) do
@ -457,11 +455,11 @@
local filecfg = config.getfileconfig(cfg, file.abspath)
if filecfg and filecfg.buildrule then
table.insert(groups.CustomBuild, file)
elseif path.iscppfile(file.fullpath) then
elseif path.iscppfile(file.relpath) then
table.insert(groups.ClCompile, file)
elseif path.iscppheader(file.fullpath) then
elseif path.iscppheader(file.relpath) then
table.insert(groups.ClInclude, file)
elseif path.isresourcefile(file.fullpath) then
elseif path.isresourcefile(file.relpath) then
table.insert(groups.ResourceCompile, file)
else
table.insert(groups.None, file)

View File

@ -80,11 +80,11 @@
for _, file in ipairs(files) do
local filter = path.getdirectory(file.vpath)
if filter ~= "." then
_p(2,'<%s Include=\"%s\">', group, path.translate(file.fullpath))
_p(2,'<%s Include=\"%s\">', group, path.translate(file.relpath))
_p(3,'<Filter>%s</Filter>', path.translate(filter))
_p(2,'</%s>', group)
else
_p(2,'<%s Include=\"%s\" />', group, path.translate(file.fullpath))
_p(2,'<%s Include=\"%s\" />', group, path.translate(file.relpath))
end
end
_p(1,'</ItemGroup>')

View File

@ -105,14 +105,14 @@
i = i + 1
if i <= #files then
local fcfg = {}
fcfg.fullpath = project.getrelative(prj, files[i])
fcfg.relpath = project.getrelative(prj, files[i])
fcfg.abspath = files[i]
local vpath = project.getvpath(prj, files[i])
if vpath ~= files[i] then
fcfg.vpath = vpath
else
fcfg.vpath = fcfg.fullpath
fcfg.vpath = fcfg.relpath
end
return fcfg

View File

@ -20,7 +20,7 @@
local function prepare(field)
if not field then
field = "fullpath"
field = "relpath"
end
for file in project.eachfile(prj) do
_p(2, file[field])