Skip to content

Commit 4761f25

Browse files
committed
Add source code control properties to the NuGet packages.
Also, fix a small bug with the nupkgproj files. The intermediate output folders conflict between the nupkgproj and csproj with the same name. This causes issues because the project.assets.json file is being shared between the two projects, which isn't correct.
1 parent 761c86d commit 4761f25

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Directory.Build.props

+11-1
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,22 @@
6363
<VersionSuffix Condition="'$(IncludeBuildNumberInPackageVersion)' == 'true'">$(VersionSuffix)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionSuffix>
6464
</PropertyGroup>
6565

66-
<!-- SourceLink properties - need to be set before importing $(ToolsDir)versioning.props -->
66+
<!-- SourceLink properties used by dotnet/buildtools - need to be set before importing $(ToolsDir)versioning.props -->
6767
<PropertyGroup>
6868
<UseSourceLink>true</UseSourceLink>
6969
<GitHubRepositoryName>machinelearning</GitHubRepositoryName>
7070
</PropertyGroup>
7171

72+
<!--
73+
Source code control properties used by the .NET Core SDK to inject SCC info into the NuGet package.
74+
In future versions, these will be used for SourceLink and to generate AssemblyInfo.
75+
-->
76+
<PropertyGroup>
77+
<PrivateRepositoryUrl>https://github.com/dotnet/$(GitHubRepositoryName)</PrivateRepositoryUrl>
78+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
79+
<SourceRevisionId>$(LatestCommit)</SourceRevisionId>
80+
</PropertyGroup>
81+
7282
<!--
7383
Ensure to import versioning.props before overwriting BaseIntermediateOutputPath since
7484
the source link file exists in the root bin/obj folder.

pkg/Directory.Build.props

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
<NoBuild>true</NoBuild>
66
<IncludeBuildOutput>false</IncludeBuildOutput>
77
<IncludeSymbols>false</IncludeSymbols>
8+
9+
<!--
10+
Our .nupkgproj files have conflicting names with src projects, which puts their intermediate
11+
output in the same folder (like project.assets.json). Override the intermediate output to
12+
make it unique for the .nupkgprojs.
13+
-->
14+
<IntermediateOutputPath>$(IntermediateOutputRootPath)$(MSBuildProjectName).NupkgProj\</IntermediateOutputPath>
15+
<BaseIntermediateOutputPath>$(IntermediateOutputPath)</BaseIntermediateOutputPath>
816
</PropertyGroup>
917

1018
<!-- nuspec properties -->

0 commit comments

Comments
 (0)