Skip to content
Merged
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
28 changes: 28 additions & 0 deletions src/Tasks/Microsoft.Common.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,34 @@ Copyright (C) Microsoft Corporation. All rights reserved.
</EmbeddedResource>
</ItemDefinitionGroup>

<!--
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" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you decide that we didn't need a DependsOn property here? I thought we wanted that for some packages that wanted to support downlevel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added SourceControlInformationFeatureSupported so that they can condition on that. Let me double check that this property is actually reasonable to use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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

<!--
***********************************************************************************************
***********************************************************************************************
Expand Down