diff options
author | Eric StJohn <ericstj@microsoft.com> | 2018-10-31 21:43:55 +0300 |
---|---|---|
committer | Santiago Fernandez Madero <safern@microsoft.com> | 2018-10-31 21:43:55 +0300 |
commit | 4049b2040a7eb838f7e8563eebd03df3015edbf5 (patch) | |
tree | c25ffaf2a2b5a7bd5c58030372e2a96bad0cf963 /eng/resolveContract.targets | |
parent | d7d278fa58f82640dd8adbf76282b5ec8918f161 (diff) |
Move resolveContract into corefx (dotnet/corefx#33152)
* Move resolveContract into corefx
This moves resolveContract logic into corefx. It also fixes API compat which
hasn't been running for some time due to ResolveMatchingContract property
being set to let to sequence the target.
* Fix System.Drawing.Design.Primitives reference
* Fix resolveContract convention
We only want to add the contract item when building source projects.
Commit migrated from https://github.com/dotnet/corefx/commit/271ed1b719b144a54d10e36dd74e5b763ea5f472
Diffstat (limited to 'eng/resolveContract.targets')
-rw-r--r-- | eng/resolveContract.targets | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets new file mode 100644 index 00000000000..eedc7f2f063 --- /dev/null +++ b/eng/resolveContract.targets @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project> + <PropertyGroup Condition="'$(IsSourceProject)' == 'true'"> + <ContractProject Condition="'$(ContractProject)' == ''">$(SourceDir)/$(MSBuildProjectName)/ref/$(MSBuildProjectName).csproj</ContractProject> + <HasMatchingContract Condition="'$(HasMatchingContract)' == '' and Exists('$(ContractProject)')">true</HasMatchingContract> + <ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == ''">$(ContractOutputPath)/$(MSBuildProjectName).dll</ContractAssemblyPath> + </PropertyGroup> + + <ItemGroup Condition="'$(HasMatchingContract)' == 'true'"> + <ResolvedMatchingContract Condition="Exists('$(ContractAssemblyPath)')" Include="$(ContractAssemblyPath)" /> + <!-- If the contract doesn't exist in the default contract output path add a project reference to the contract project to resolve --> + <ProjectReference Condition="'@(ResolvedMatchingContract)' == ''" Include="$(ContractProject)"> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + <OutputItemType>ResolvedMatchingContract</OutputItemType> + </ProjectReference> + </ItemGroup> + + <!-- intentionally empty since we no longer need a target --> + <Target Name="ResolveMatchingContract" /> + + <Target Name="VerifyMatchingContract" AfterTargets="ResolveReferences"> + <Error Condition="'$(HasMatchingContract)' == 'true' and !Exists('%(ResolvedMatchingContract.Identity)')" Text="ResolveMatchingContract could not find a matching contract '%(ResolvedMatchingContract.Identity)' not found." /> + </Target> +</Project>
\ No newline at end of file |