Skip to content

Commit 83ac8d9

Browse files
authored
Merge pull request #8898 from tmat/SourceControlCrossTargeting
Add InitializeSourceControlInformation target to common cross-targeting targets
2 parents 402af3b + 5f09538 commit 83ac8d9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/Tasks/Microsoft.Common.CrossTargeting.targets

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,34 @@ Copyright (C) Microsoft Corporation. All rights reserved.
7676

7777
</Target>
7878

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

0 commit comments

Comments
 (0)