forked from dotnet/sourcelink
/
Microsoft.SourceLink.AzureRepos.Tfvc.targets
26 lines (21 loc) · 1.63 KB
/
Microsoft.SourceLink.AzureRepos.Tfvc.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the License.txt file in the project root for more information. -->
<Project>
<PropertyGroup>
<_SourceLinkAzureReposTfvcAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\Microsoft.SourceLink.AzureRepos.Tfvc.dll</_SourceLinkAzureReposTfvcAssemblyFile>
<_SourceLinkAzureReposTfvcAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\core\Microsoft.SourceLink.AzureRepos.Tfvc.dll</_SourceLinkAzureReposTfvcAssemblyFile>
</PropertyGroup>
<UsingTask TaskName="Microsoft.SourceLink.AzureRepos.Tfvc.GetSourceLinkUrl" AssemblyFile="$(_SourceLinkAzureReposTfvcAssemblyFile)"/>
<PropertyGroup>
<SourceLinkUrlInitializerTargets>$(SourceLinkUrlInitializerTargets);_InitializeAzureReposTfvcSourceLinkUrl</SourceLinkUrlInitializerTargets>
</PropertyGroup>
<Target Name="_InitializeAzureReposTfvcSourceLinkUrl" Inputs="@(SourceRoot)" Outputs="|%(Identity)|">
<Microsoft.SourceLink.AzureRepos.Tfvc.GetSourceLinkUrl SourceRoot="@(SourceRoot)">
<Output TaskParameter="SourceLinkUrl" PropertyName="_SourceLinkUrlToUpdate"/>
</Microsoft.SourceLink.AzureRepos.Tfvc.GetSourceLinkUrl>
<ItemGroup>
<!-- Only update the SourceLinkUrl metadata if the SourceRoot belongs to this source control -->
<SourceRoot Update="%(Identity)" SourceLinkUrl="$(_SourceLinkUrlToUpdate)" Condition="'$(_SourceLinkUrlToUpdate)' != 'N/A'"/>
</ItemGroup>
</Target>
</Project>