From 47b56ae8eb591e0fff8160fa32b9e1712694cf55 Mon Sep 17 00:00:00 2001 From: "Eric St. John" Date: Wed, 11 Jan 2017 15:41:26 -0800 Subject: Refactor build traversal Change contract of cross-project target to return configuration rather than trying to construct a project item. This preserves the metadata of the original Project/ProjectReference. When the MSBuild task creates the TargetOutputs it will copy all the original metadata from the Project items and create the OriginalItemSpec metadata. From this we can simply transform back to a Project/ProjectReference and prepend Configuration to the AdditionalProperties. This fixes a case where projects were setting AdditionalProperties and we were squashing it. This exposed an issue in traversal where we were still setting TestTFM (previously this was squashed, only with other AdditionalProperties). To make it clearer how this worked I made the targets only return a property so that we don't accidentally squash any metadata set on the project. I've also cleaned up the targets to make things a bit more consistent and added comments. --- buildvertical.targets | 134 +++++++++++++++++++++----------------------------- 1 file changed, 55 insertions(+), 79 deletions(-) (limited to 'buildvertical.targets') diff --git a/buildvertical.targets b/buildvertical.targets index f778ae367f..eeadbcf580 100644 --- a/buildvertical.targets +++ b/buildvertical.targets @@ -5,106 +5,82 @@ true - - + + - - - - - - - - - - - + + - - - - Configuration=$(_BestConfiguration);%(ProjectWithConfiguration.AdditionalProperties) - Configuration;%(ProjectWithConfiguration.UndefineProperties) - - - - - - - - - <_Configuration Remove="@(_Configuration)" /> - - - + + + + - <_Configuration Condition="'$(BuildConfigurations)' == ''" Include="$(BuildConfiguration)" /> + + + Configuration=%(Identity);%(_ProjectBestConfigurations.AdditionalProperties) + - - <_BestConfiguration>%(_Configuration.Identity) - - - + + + - - <_Configuration Remove="@(_Configuration)" /> - + + + - - - - - <_Configuration Condition="'$(BuildConfigurations)' == ''" Include="$(BuildConfiguration)" /> - + BuildConfiguration="$(BuildConfiguration)"> + + + + + + <_BestConfiguration Condition="'$(BuildConfigurations)' == ''">$(BuildConfiguration) + + + + + + + - - <_ProjectReferenceToAnnotate>%(ProjectReference.Identity) - - <_Configuration Remove="@(_Configuration)" /> - - + + + - - <_BestConfiguration>%(_Configuration.Identity) - <_AdditionalProperties /> - <_AdditionalProperties Condition="'$(_BestConfiguration)' != ''">Configuration=$(_BestConfiguration) - - - $(_AdditionalProperties);%(ProjectReference.AdditionalProperties) - Configuration;%(ProjectReference.Configuration) - + + + Configuration=%(Identity);%(_ProjectReferenceBestConfigurations.AdditionalProperties) + + + + + + \ No newline at end of file -- cgit v1.2.3