Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resolveContract.targets « eng - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c4a95eae082fa4ef9051641e4f35a0e9568ed0c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<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)' == ''">$(RefPath)/$(MSBuildProjectName).dll</ContractAssemblyPath>

    <!-- Disable API compat if the project doesn't have reference assembly -->
    <RunApiCompat Condition="'$(HasMatchingContract)' != 'true'">false</RunApiCompat>
  </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" />
</Project>