Generate proper Link metadata for resources in imported projects
authorLluis Sanchez <lluis@xamarin.com>
Thu, 15 Jan 2015 09:26:15 +0000 (10:26 +0100)
committerLluis Sanchez <lluis@xamarin.com>
Thu, 15 Jan 2015 10:07:49 +0000 (11:07 +0100)
commit639bf661715fc190b595d05193c335f70b3313eb
tree3f9dc48d1224886230b052be43b853a615a5dc30
parent9d8be3d40c21a1e40aa7de7a74f548c2d96788f9
Generate proper Link metadata for resources in imported projects

When importing a project that contains embedded resources, the id
of those resources must be generated using the path relative
to the project file that includes them, not relative to the
main project file. To fix this problem, we now generate a
Link metadata property for those resources that has the correct
relative path, and later this is used to generate the correct
id for the resource. We also now store a new metadata value
for all items (DefiningProjectFullPath) which contains the
path to the project file that defines the element. This is
used to check if an item was defined in an imported file,
in which case the Link assignment may need to be made.

This fixes bug BXC 20966.
14 files changed:
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_3_5.csproj
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_4_5.csproj
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-xbuild_12.csproj
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources
mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignLinkMetadata.cs [new file with mode: 0644]
mcs/tools/xbuild/data/12.0/Microsoft.Common.targets
mcs/tools/xbuild/data/12.0/Microsoft.Common.tasks
mcs/tools/xbuild/data/3.5/Microsoft.Common.targets
mcs/tools/xbuild/data/3.5/Microsoft.Common.tasks
mcs/tools/xbuild/data/4.0/Microsoft.Common.targets
mcs/tools/xbuild/data/4.0/Microsoft.Common.tasks