You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
2.3 KiB

<?xml version="1.0" encoding="utf-8"?>
<Project>
<UsingTask TaskName="Microsoft.SourceLink.Common.SourceLinkHasSingleProvider" AssemblyFile="$(_MicrosoftSourceLinkCommonAssemblyFile)"/>
<Target Name="_SourceLinkHasSingleProvider">
<!--
If there is a single SourceLink provider we can use Repository URL to infer repository host.
If the project references multiple SourceLink providers the user needs to specify hosts explicitly (ImplicitHost will be empty)
as we do not know which providers should be used to produce SourceLink URL for the repository.
Reports an error if there is no SourceLinkUrlInitializerTargets is empty (no SourceLink provider is referenced).
-->
<Microsoft.SourceLink.Common.SourceLinkHasSingleProvider ProviderTargets="$(SourceLinkUrlInitializerTargets)" >
<Output TaskParameter="HasSingleProvider" PropertyName="SourceLinkHasSingleProvider"/>
</Microsoft.SourceLink.Common.SourceLinkHasSingleProvider>
</Target>
<!--
Triggers InitializeSourceControlInformationFromSourceControlManager target defined by a source control package Microsoft.Build.Tasks.{Git|Tfvc|...}.
Notes: No error is reported if InitializeSourceControlInformation is not defined.
-->
<Target Name="_InitializeSourceControlInformationFromSourceControlManager"
DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager;_SourceLinkHasSingleProvider;$(SourceControlManagerUrlTranslationTargets);SourceControlManagerPublishTranslatedUrls"
BeforeTargets="InitializeSourceControlInformation"
Condition="'$(EnableSourceControlManagerQueries)' == 'true'" />
<Target Name="SourceControlManagerPublishTranslatedUrls">
<PropertyGroup>
<!--
If the project already sets RepositoryUrl use it. Such URL is considered final and translations are not applied.
-->
<PrivateRepositoryUrl Condition="'$(PrivateRepositoryUrl)' == ''">$(RepositoryUrl)</PrivateRepositoryUrl>
<PrivateRepositoryUrl Condition="'$(PrivateRepositoryUrl)' == ''">$(ScmRepositoryUrl)</PrivateRepositoryUrl>
</PropertyGroup>
<ItemGroup>
<SourceRoot Update="@(SourceRoot)">
<RepositoryUrl Condition="'%(SourceRoot.RepositoryUrl)' == ''">%(SourceRoot.ScmRepositoryUrl)</RepositoryUrl>
</SourceRoot>
</ItemGroup>
</Target>
</Project>