Skip to content

Commit 1040be3

Browse files
authored
Include third-party-notices.txt in all packages (#20166)
* Include third-party-notices.txt in all packages * Fix version test filename
1 parent 68908b5 commit 1040be3

13 files changed

+29
-9
lines changed

Directory.Build.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@
104104
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
105105
</PropertyGroup>
106106

107+
<PropertyGroup>
108+
<PackageThirdPartyNoticesFile Condition="'$(PackageThirdPartyNoticesFile)' == ''">$(RepoRoot)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
109+
</PropertyGroup>
110+
111+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
112+
<None Include="$(PackageThirdPartyNoticesFile)" Pack="true" PackagePath="." />
113+
</ItemGroup>
114+
107115
<ItemGroup Condition="'$(Language)' == 'C#' AND '$(IsReferenceAssemblyProject)' == 'true'">
108116
<Compile Include="$(SharedSourceRoot)ReferenceAssemblyInfo.cs" LinkBase="Properties" />
109117
</ItemGroup>

src/Components/Blazor/Build/src/Microsoft.AspNetCore.Blazor.Build.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<NuspecProperty Include="componentsversion=$(ComponentsPackageVersion)" />
2424
<NuspecProperty Include="razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion)" />
2525
<NuspecProperty Include="blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion)" />
26+
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
2627
</ItemGroup>
2728

2829
<ItemGroup>

src/Components/Blazor/Build/src/Microsoft.AspNetCore.Blazor.Build.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</metadata>
99
<files>
1010
$CommonFileElements$
11-
<file src="..\..\..\THIRD-PARTY-NOTICES.txt" />
11+
<file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
1212
<file src="build\**" target="build" />
1313
<file src="targets\**" target="targets" />
1414
<file src="$publishdir$**\*" target="tools/" />

src/Components/Blazor/DevServer/src/Microsoft.AspNetCore.Blazor.DevServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<NuspecProperty Include="publishDir=$(PublishDir)" />
3434
<NuspecProperty Include="componentsrootdir=..\..\..\" />
3535
<NuspecProperty Include="blazorversion=$(PackageVersion)" />
36+
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
3637
</ItemGroup>
3738

3839
</Project>

src/Components/Blazor/DevServer/src/Microsoft.AspNetCore.Blazor.DevServer.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
$CommonFileElements$
88
<file src="build\**" target="build" />
99
<file src="$publishDir$**\*" target="tools" />
10-
<file src="$componentsrootdir$THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
10+
<file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
1111
</files>
1212
</package>

src/Components/Components/src/Microsoft.AspNetCore.Components.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<NuspecProperty Condition="'$(DotNetBuildFromSource)' != 'true'" Include="systemComponentModelAnnotationsPackageVersion=$(SystemComponentModelAnnotationsPackageVersion)" />
5555
<NuspecProperty Include="AssemblyName=$(AssemblyName)" />
5656
<NuspecProperty Include="OutputPath=$(OutputPath)" />
57+
<NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
5758
</ItemGroup>
5859

5960
</Project>

src/Components/Components/src/Microsoft.AspNetCore.Components.multitarget.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
2222
<file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
2323
<file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
24-
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
24+
<file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
2525
</files>
2626
</package>

src/Components/Components/src/Microsoft.AspNetCore.Components.netcoreapp.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
<file src="$OutputPath$**\$AssemblyName$.dll" target="lib\" />
1616
<file src="$OutputPath$**\$AssemblyName$.pdb" target="lib\" />
1717
<file src="$OutputPath$**\$AssemblyName$.xml" target="lib\" />
18-
<file src="..\..\THIRD-PARTY-NOTICES.txt" target=".\THIRD-PARTY-NOTICES.txt" />
18+
<file src="$PackageThirdPartyNoticesFile$" target=".\THIRD-PARTY-NOTICES.txt" />
1919
</files>
2020
</package>

src/Components/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
<!-- So we can use the tool from source within the repo without having to pack -->
1818
<BlazorToolsDir>$(MSBuildThisFileDirectory)Blazor\Build\src\bin\$(Configuration)\$(DefaultNetCoreTargetFramework)\</BlazorToolsDir>
19+
20+
<PackageThirdPartyNoticesFile>$(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.txt</PackageThirdPartyNoticesFile>
1921
</PropertyGroup>
2022

2123
<PropertyGroup>

src/Components/Directory.Build.targets

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
</PropertyGroup>
55

66
<ItemGroup>
7-
<None Include="$(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="." />
8-
97
<!-- Add a project dependency without reference output assemblies to enforce build order -->
108
<!-- Applying workaround for https://github.com/microsoft/msbuild/issues/2661 and https://github.com/dotnet/sdk/issues/952 -->
119
<ProjectReference

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
6767
<!-- There is no way to suppress the .dev.runtimeconfig.json generation. -->
6868
<ProjectRuntimeConfigDevFilePath>$(IntermediateOutputPath)ignoreme.dev.runtimeconfig.json</ProjectRuntimeConfigDevFilePath>
6969

70-
<VersionFileIntermediateOutputPath>$(IntermediateOutputPath).version</VersionFileIntermediateOutputPath>
70+
<VersionFileIntermediateOutputPath>$(IntermediateOutputPath)$(SharedFxName).versions.txt</VersionFileIntermediateOutputPath>
7171

7272
<!-- The project representing the shared framework doesn't produce a .NET assembly or symbols. -->
7373
<DebugType>none</DebugType>
@@ -497,4 +497,13 @@ This package is an internal implementation of the .NET Core SDK and is not meant
497497
</ItemGroup>
498498
</Target>
499499

500+
<Target Name="IncludeVersionFile"
501+
DependsOnTargets="GenerateSharedFxVersionsFiles"
502+
BeforeTargets="_GetPackageFiles">
503+
504+
<ItemGroup>
505+
<None Include="$(VersionFileIntermediateOutputPath)" Pack="true" PackagePath="." />
506+
</ItemGroup>
507+
</Target>
508+
500509
</Project>

src/Framework/test/SharedFxTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void ItContainsValidDepsJson()
131131
[Fact]
132132
public void ItContainsVersionFile()
133133
{
134-
var versionFile = Path.Combine(_sharedFxRoot, ".version");
134+
var versionFile = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.versions.txt");
135135
AssertEx.FileExists(versionFile);
136136
var lines = File.ReadAllLines(versionFile);
137137
Assert.Equal(2, lines.Length);

src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</GetCurrentProjectStaticWebAssetsDependsOn>
2424

2525
<IdentityUIFrameworkVersion Condition="'$(IdentityUIFrameworkVersion)' == ''">Bootstrap4</IdentityUIFrameworkVersion>
26+
<PackageThirdPartyNoticesFile>$(MSBuildThisFileDirectory)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
2627

2728
</PropertyGroup>
2829

@@ -32,7 +33,6 @@
3233
<None Include="build\*" Pack="true" PackagePath="build\" />
3334
<None Include="buildMultiTargeting\*" Pack="true" PackagePath="buildMultiTargeting\" />
3435
<None Include="buildTransitive\*" Pack="true" PackagePath="buildTransitive\" />
35-
<None Include="THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="/THIRD-PARTY-NOTICES.txt" />
3636
</ItemGroup>
3737

3838
<ItemGroup>

0 commit comments

Comments
 (0)