summaryrefslogtreecommitdiff
path: root/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets
diff options
context:
space:
mode:
Diffstat (limited to '.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets')
-rwxr-xr-x.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets36
1 files changed, 36 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets b/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets
new file mode 100755
index 0000000000..1bce2266d3
--- /dev/null
+++ b/.packages/microsoft.dotnet.buildtools/3.0.0-preview4-04022-01/lib/resolveContract.targets
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup Condition="'$(ResolveMatchingContract)' == 'true'">
+ <AddProjectReferencesDynamicallyDependsOn>
+ ResolveMatchingContract;
+ $(AddProjectReferencesDynamicallyDependsOn);
+ </AddProjectReferencesDynamicallyDependsOn>
+ <ResolveReferencesDependsOn>
+ $(ResolveReferencesDependsOn);
+ VerifyMatchingContract
+ </ResolveReferencesDependsOn>
+ </PropertyGroup>
+
+ <Target Name="ResolveMatchingContract">
+ <PropertyGroup>
+ <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>
+ </Target>
+
+ <Target Name="VerifyMatchingContract">
+ <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