Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 2936750

Browse files
committed
Enable msbuild /t:pack on library packages (#593)
Progress on NuGet/Engineering#1673
1 parent 79c8107 commit 2936750

8 files changed

Lines changed: 45 additions & 149 deletions

File tree

build.ps1

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,17 @@ Invoke-BuildStep 'Creating artifacts' {
147147
# We need a few projects to be published for sharing the common bits with other repos.
148148
# We need symbols published for those, too. All other packages are deployment ones and
149149
# don't need to be shared, hence no need for symbols for them
150-
$ProjectsWithSymbols =
150+
$CsprojProjects =
151151
"src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj",
152152
"src/Validation.Common.Job/Validation.Common.Job.csproj",
153153
"src/Validation.ScanAndSign.Core/Validation.ScanAndSign.Core.csproj",
154154
"src/Validation.Symbols.Core/Validation.Symbols.Core.csproj"
155155

156-
$Projects = `
156+
$CsprojProjects | ForEach-Object {
157+
New-ProjectPackage (Join-Path $PSScriptRoot $_) -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch -Symbols
158+
}
159+
160+
$NuspecProjects = `
157161
"src/Stats.CollectAzureCdnLogs/Stats.CollectAzureCdnLogs.csproj", `
158162
"src/Stats.AggregateCdnDownloadsInGallery/Stats.AggregateCdnDownloadsInGallery.csproj", `
159163
"src/Stats.ImportAzureCdnStatistics/Stats.ImportAzureCdnStatistics.csproj", `
@@ -181,12 +185,10 @@ Invoke-BuildStep 'Creating artifacts' {
181185
"src/Monitoring.RebootSearchInstance/Monitoring.RebootSearchInstance.csproj", `
182186
"src/StatusAggregator/StatusAggregator.csproj", `
183187
"src/Validation.Symbols.Core/Validation.Symbols.Core.csproj", `
184-
"src/Validation.Symbols/Validation.Symbols.csproj" `
185-
+ $ProjectsWithSymbols
188+
"src/Validation.Symbols/Validation.Symbols.csproj"
186189

187-
Foreach ($Project in $Projects) {
188-
$Symbols = $ProjectsWithSymbols -contains $Project;
189-
New-Package (Join-Path $PSScriptRoot "$Project") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch -MSBuildVersion "$msBuildVersion" -Symbols:$Symbols
190+
Foreach ($Project in $NuspecProjects) {
191+
New-Package (Join-Path $PSScriptRoot "$Project") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch -MSBuildVersion "$msBuildVersion"
190192
}
191193
} `
192194
-ev +BuildErrors

src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<DefineConstants>TRACE</DefineConstants>
1616
<TargetFrameworkProfile />
1717
</PropertyGroup>
18+
<PropertyGroup>
19+
<Authors>.NET Foundation</Authors>
20+
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
21+
</PropertyGroup>
1822
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1923
<DebugSymbols>true</DebugSymbols>
2024
<DebugType>full</DebugType>
@@ -90,6 +94,11 @@
9094
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions">
9195
<Version>1.1.2</Version>
9296
</PackageReference>
97+
<PackageReference Include="NuGet.Build.Tasks.Pack">
98+
<Version>4.8.0</Version>
99+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
100+
<PrivateAssets>all</PrivateAssets>
101+
</PackageReference>
93102
<PackageReference Include="NuGet.Services.Configuration">
94103
<Version>2.27.0</Version>
95104
</PackageReference>

src/Validation.Common.Job/Validation.Common.Job.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1515
<TargetFrameworkProfile />
1616
</PropertyGroup>
17+
<PropertyGroup>
18+
<Authors>.NET Foundation</Authors>
19+
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
20+
</PropertyGroup>
1721
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1822
<DebugSymbols>true</DebugSymbols>
1923
<DebugType>full</DebugType>
@@ -90,6 +94,11 @@
9094
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions">
9195
<Version>1.1.2</Version>
9296
</PackageReference>
97+
<PackageReference Include="NuGet.Build.Tasks.Pack">
98+
<Version>4.8.0</Version>
99+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
100+
<PrivateAssets>all</PrivateAssets>
101+
</PackageReference>
93102
<PackageReference Include="NuGet.Packaging">
94103
<Version>4.8.0-preview4.5289</Version>
95104
</PackageReference>
@@ -127,11 +136,6 @@
127136
<Name>NuGet.Jobs.Common</Name>
128137
</ProjectReference>
129138
</ItemGroup>
130-
<ItemGroup>
131-
<None Include="Validation.Common.Job.nuspec">
132-
<SubType>Designer</SubType>
133-
</None>
134-
</ItemGroup>
135139
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
136140
<PropertyGroup>
137141
<SignPath>..\..\build</SignPath>

src/Validation.Common.Job/Validation.Common.Job.nuspec

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Validation.ScanAndSign.Core/Validation.ScanAndSign.Core.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1515
<TargetFrameworkProfile />
1616
</PropertyGroup>
17+
<PropertyGroup>
18+
<Authors>.NET Foundation</Authors>
19+
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
20+
</PropertyGroup>
1721
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1822
<DebugSymbols>true</DebugSymbols>
1923
<DebugType>full</DebugType>
@@ -54,6 +58,11 @@
5458
<PackageReference Include="Microsoft.Extensions.Options">
5559
<Version>1.1.2</Version>
5660
</PackageReference>
61+
<PackageReference Include="NuGet.Build.Tasks.Pack">
62+
<Version>4.8.0</Version>
63+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
64+
<PrivateAssets>all</PrivateAssets>
65+
</PackageReference>
5766
<PackageReference Include="NuGet.Services.ServiceBus">
5867
<Version>2.27.0</Version>
5968
</PackageReference>

src/Validation.Symbols.Core/Validation.Symbols.Core.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<Deterministic>true</Deterministic>
1515
<TargetFrameworkProfile />
1616
</PropertyGroup>
17+
<PropertyGroup>
18+
<Authors>.NET Foundation</Authors>
19+
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
20+
</PropertyGroup>
1721
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1822
<DebugSymbols>true</DebugSymbols>
1923
<DebugType>full</DebugType>
@@ -58,6 +62,11 @@
5862
<Compile Include="ZipArchiveService.cs" />
5963
</ItemGroup>
6064
<ItemGroup>
65+
<PackageReference Include="NuGet.Build.Tasks.Pack">
66+
<Version>4.8.0</Version>
67+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
68+
<PrivateAssets>all</PrivateAssets>
69+
</PackageReference>
6170
<PackageReference Include="NuGet.Services.ServiceBus">
6271
<Version>2.29.0</Version>
6372
</PackageReference>

tests/Validation.Common.Job.Tests/CsprojNuspecConsistencyFacts.cs

Lines changed: 0 additions & 105 deletions
This file was deleted.

tests/Validation.Common.Job.Tests/Validation.Common.Job.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
</ItemGroup>
4343
<ItemGroup>
4444
<Compile Include="CommonTelemetryServiceFacts.cs" />
45-
<Compile Include="CsprojNuspecConsistencyFacts.cs" />
4645
<Compile Include="FileStreamUtilityFacts.cs" />
4746
<Compile Include="LoggerDiagnosticSourceFacts.cs" />
4847
<Compile Include="PathUtilityFacts.cs" />

0 commit comments

Comments
 (0)