1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00
Satori/eng/references.targets
Anirudh Agnihotry 0ac72ac366
Remove TargetsNet* from the runtime repo (#35589)
* feedbacl from previous time

* remove TargetsNet* from ItemGroup

* removing targetFramework from .targets
2020-05-04 17:12:23 +02:00

67 lines
No EOL
3.4 KiB
XML

<Project>
<PropertyGroup>
<ContractDependencyPaths>$(RefPath)</ContractDependencyPaths>
<FrameworkPathOverride>$(RefPath)</FrameworkPathOverride>
<AssemblySearchPaths>$(AssemblySearchPaths);$(RefPath);{RawFileName}</AssemblySearchPaths>
<!-- Disable RAR from transitively discovering dependencies for References -->
<_FindDependencies>false</_FindDependencies>
<!--
We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder
that exists to skip the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644).
Need to set these after the common targets import.
-->
<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
</PropertyGroup>
<PropertyGroup Condition="'$(IncludeDefaultReferences)' == ''">
<IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.csproj'">true</IncludeDefaultReferences>
<IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.vbproj'">true</IncludeDefaultReferences>
</PropertyGroup>
<Target Name="SetupDefaultReferences">
<ItemGroup Condition="'$(IncludeDefaultReferences)' == 'true'">
<!-- netstandard is a default reference whenever building for NETStandard or building an implementation assembly -->
<DefaultReference Condition="('$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(IsReferenceAssembly)' != 'true') and Exists('$(RefPath)netstandard.dll')" Include="netstandard" />
</ItemGroup>
</Target>
<Target Name="UpdateReferenceItems" DependsOnTargets="SetupDefaultReferences" BeforeTargets="AddReferencesDynamically">
<ItemGroup>
<Reference Include="@(DefaultReference)" />
</ItemGroup>
<ItemGroup>
<!-- Simple name references will be resolved from the targeting pack folders and should never be copied to output -->
<Reference Condition="'%(Reference.Extension)' != '.dll'">
<Private>false</Private>
</Reference>
</ItemGroup>
</Target>
<Target Name="AddDefaultTestReferences" BeforeTargets="SetupDefaultReferences" Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'">
<ItemGroup>
<DefaultReferenceExclusions Include="@(ReferenceFromRuntime)"/>
<!-- Reference everything in the targeting pack directory -->
<DefaultReferenceDirs Include="$(RefPath)" />
<DefaultReferenceItems Include="%(DefaultReferenceDirs.Identity)/*.dll" />
<DefaultReferenceExclusions>
<RefDir>%(DefaultReferenceDirs.Identity)</RefDir>
</DefaultReferenceExclusions>
<_defaultReferenceExclusionsFullPath Include="%(DefaultReferenceExclusions.RefDir)%(DefaultReferenceExclusions.Identity).dll" />
<!-- Ensure conflict resolution can see these references. -->
<Reference Include="%(DefaultReferenceItems.FullPath)" Private="false" />
</ItemGroup>
</Target>
<Target Name="RemoveConflictResolutionAssetsForTests"
AfterTargets="_HandlePackageFileConflicts"
DependsOnTargets="AddDefaultTestReferences"
Condition="'@(_defaultReferenceExclusionsFullPath)' != ''">
<ItemGroup>
<Reference Remove="@(_defaultReferenceExclusionsFullPath)" />
</ItemGroup>
</Target>
<Target Name="AddReferencesDynamically" BeforeTargets="PrepareForBuild" />
</Project>