[xbuild] Add new reserved properties $(MSBuildThisFile*).
Also, fixes bug #668955.
Add new reserved properties $(MSBuildThisFile*).
Unlike the $(MSBuildProjectFile), the *This* properties are evaluated
in the context where they were used. Eg. if such a property was
referenced in a PropertyGroup, then it would refer to the file
containing the that definition, and *not* the main project file.
It applies to items and tasks/targets also.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildChoose.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs:
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs:
Add DefinedInFileName property.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:
Add a stack to keep track the "current" file, which is used to set
the $(MSBuildThisFile*) properties. Update the properties on
Push/Pop.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs:
Push/Pop the "current" file, when evaluating a property/item/etc.
* Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs:
Push/Pop the "current" file, when building. This ensures that the
references in the target definition get evaluated correctly.
* Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs:
Add corresponding test.