Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/ThisAssembly.Git/ThisAssembly.Git.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,4 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageFile Include="Microsoft.SourceLink.Common" Version="1.1.1" PackFolder="Dependency" Visible="false" />
</ItemGroup>

</Project>
5 changes: 4 additions & 1 deletion src/ThisAssembly.Git/ThisAssembly.Git.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- Make sure git info is available before calling source generators -->
<Target Name="InitializeGitInformation"
BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun"
DependsOnTargets="InitializeSourceControlInformation">
DependsOnTargets="InitializeSourceControlInformation;$(SourceLinkUrlInitializerTargets)">

<PropertyGroup Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
<!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. -->
Expand All @@ -54,8 +54,11 @@

<PropertyGroup>
<RepositoryRoot>@(_ThisAssemblyGitSourceRoot)</RepositoryRoot>
<SourceLinkUrl>@(_ThisAssemblyGitSourceRoot -> '%(SourceLinkUrl)')</SourceLinkUrl>
</PropertyGroup>

<Warning Code="THIS002" Text="A valid SourceLink provider does not seem to be installed for the current repository/project. Values will be empty." Condition="'$(SourceLinkUrl)' == ''" />

<PropertyGroup Condition="'$(RepositoryBranch)' == '' and '$(RepositoryRoot)' != ''">
<!-- We may not be in CI at all. If we got a git repo root, we can directly read HEAD -->
<RepositoryHead>$(RepositoryRoot).git/HEAD</RepositoryHead>
Expand Down