Add <ProjectName> to VS 2010 projects when project and file names differ

This commit is contained in:
Jason Perkins 2013-05-01 12:08:41 -04:00
parent 8d76cc55dd
commit 89a85f0250
2 changed files with 27 additions and 0 deletions

View File

@ -154,6 +154,7 @@
end
end
vc2010.projectName(prj)
_p(1,'</PropertyGroup>')
end
@ -981,6 +982,13 @@
end
function vc2010.projectName(prj)
if prj.name ~= prj.filename then
_x(2,'<ProjectName>%s</ProjectName>', prj.name)
end
end
function vc2010.propertyGroup(cfg, label)
local cond
if cfg then

View File

@ -108,3 +108,22 @@
</PropertyGroup>
]]
end
---
-- If the project name differs from the project filename, output a
-- <ProjectName> element to indicate that.
---
function suite.addsFilename_onDifferentFilename()
filename "MyProject_2012"
prepare()
test.capture [[
<PropertyGroup Label="Globals">
<ProjectGuid>{42B5DBC6-AE1F-903D-F75D-41E363076E92}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MyProject</RootNamespace>
<ProjectName>MyProject</ProjectName>
</PropertyGroup>
]]
end