Skip to content

Commit

Permalink
Merge pull request #8898 from tmat/SourceControlCrossTargeting
Browse files Browse the repository at this point in the history
Add InitializeSourceControlInformation target to common cross-targeting targets
  • Loading branch information
JanKrivanek committed Jun 22, 2023
2 parents 402af3b + 5f09538 commit 83ac8d9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Tasks/Microsoft.Common.CrossTargeting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,34 @@ Copyright (C) Microsoft Corporation. All rights reserved.

</Target>

<!--
Target that allows targets consuming source control confirmation to establish a dependency on targets producing this information.
Any target that reads SourceRevisionId, PrivateRepositoryUrl, SourceRoot, and other source control properties and items
should depend on this target and be conditioned on '$(SourceControlInformationFeatureSupported)' == 'true'.
SourceRevisionId property uniquely identifies the source control revision of the repository the project belongs to.
For Git repositories this id is a commit hash, for TFVC repositories it's the changeset number, etc.
PrivateRepositoryUrl property stores the URL of the repository supplied by the CI server or retrieved from source control manager.
Targets consuming this property shall not publish its value implicitly as it might inadvertently reveal an internal URL.
Instead, they shall only do so if the project sets PublishRepositoryUrl property to true. For example, the NuGet Pack target
may include the repository URL in the nuspec file generated for NuGet package produced by the project if PublishRepositoryUrl is true.
SourceRoot item group lists all source roots that the project source files reside under and their mapping to source control server URLs,
if available. This includes both source files under source control as well as source files in source packages. SourceRoot items are
used by compilers to determine path map in deterministic build and by SourceLink provider, which maps local paths to URLs of source files
stored on the source control server.
Source control information provider that sets these properties and items shall execute before this target (by including
InitializeSourceControlInformation in its BeforeTargets) and set source control properties and items that haven't been initialized yet.
-->
<Target Name="InitializeSourceControlInformation" />

<PropertyGroup>
<SourceControlInformationFeatureSupported>true</SourceControlInformationFeatureSupported>
</PropertyGroup>

<!--
============================================================
DispatchToInnerBuilds
Expand Down

0 comments on commit 83ac8d9

Please sign in to comment.