Fix C# resource file associations when placed in a subfolder

This commit is contained in:
Jason Perkins 2013-10-30 14:22:53 -04:00
parent 7ef0bf5bc8
commit db77bb3434
3 changed files with 21 additions and 24 deletions

View File

@ -188,8 +188,8 @@
end
if info.dependency then
local dependency = path.translate(project.getrelative(prj, info.dependency))
_x(3,'<DependentUpon>%s</DependentUpon>', dependency)
local dependency = path.getrelative(path.getdirectory(filecfg.abspath), info.dependency)
_x(3,'<DependentUpon>%s</DependentUpon>', path.translate(dependency))
end
_p(2,'</%s>', info.action)

View File

@ -109,7 +109,7 @@
-- the list, then it isn't really part of the project, and I
-- need to output a dummy configuration in its place.
elseif not isRealConfig[tstcfg] then
elseif not isRealConfig[testName] then
-- this is a fake config to make VS happy
vc200x.emptyConfiguration(cfg, arch)
end

View File

@ -50,7 +50,7 @@
-- Test file dependencies
--
function suite.SimpleResourceDependency()
function suite.resourceDesignerDependency()
files { "Resources.resx", "Resources.Designer.cs" }
prepare()
test.capture [[
@ -67,6 +67,23 @@
end
--
-- File associations should always be made relative to the file
-- which is doing the associating.
--
function suite.resourceDependency_inSubfolder()
files { "Forms/TreeListView.resx", "Forms/TreeListView.cs" }
prepare()
test.capture [[
<Compile Include="Forms\TreeListView.cs" />
<EmbeddedResource Include="Forms\TreeListView.resx">
<DependentUpon>TreeListView.cs</DependentUpon>
</EmbeddedResource>
]]
end
--
-- Test build actions.
--
@ -120,26 +137,6 @@
end
--
-- If a resource file has a matching .Designer.cs, the designer
-- file should be marked as auto-generated.
--
function suite.autogenDesignerFromResource()
files { "Hello.Designer.cs", "Hello.resx"}
prepare()
test.capture [[
<Compile Include="Hello.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Hello.resx</DependentUpon>
</Compile>
]]
end
-- test Component
-- test UserControl
--
-- Files that exist outside the project folder should be added as
-- links, with a relative path. Weird but true.