Skip to content

Commit 34f60ee

Browse files
authored
Fix NuGetBuildExtensions import, unify props/targets (#10132)
* Add UseNuGetBuildExtensions to all entry points * Move SdkProjects.props to Directory.Build.props, rename to targets * Move to targets file only, NUGET_SNK_PATH is set after props for legacy csproj * Remove unnecessary package references
1 parent 923741d commit 34f60ee

152 files changed

Lines changed: 33 additions & 260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project>
2+
23
<PropertyGroup>
34
<Authors>.NET Foundation</Authors>
45
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
@@ -24,10 +25,40 @@
2425
</PropertyGroup>
2526

2627
<ItemGroup>
28+
<PackageReference Include="MicroBuild.Core">
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
30+
<PrivateAssets>all</PrivateAssets>
31+
</PackageReference>
2732
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers">
2833
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2934
<PrivateAssets>all</PrivateAssets>
3035
</PackageReference>
36+
<PackageReference Include="Microsoft.SourceLink.GitHub">
37+
<PrivateAssets>all</PrivateAssets>
38+
</PackageReference>
3139
</ItemGroup>
40+
3241
<Import Project="$(NuGetCodeAnalyzerExtensions)" Condition="'$(NuGetCodeAnalyzerExtensions)' != '' And Exists('$(NuGetCodeAnalyzerExtensions)')" />
42+
43+
<!-- NuGet signing block: start -->
44+
<PropertyGroup>
45+
<SignPath>build</SignPath>
46+
<SignPath Condition="'$(BUILD_SOURCESDIRECTORY)' != ''">$(BUILD_SOURCESDIRECTORY)\build</SignPath>
47+
<SignPath Condition="'$(NuGetBuildPath)' != ''">$(NuGetBuildPath)</SignPath>
48+
<SignType Condition="'$(SignType)' == ''">none</SignType>
49+
</PropertyGroup>
50+
<Import Project="sign.thirdparty.props" />
51+
<Import Project="$(SignPath)\sign.targets" Condition="Exists('$(SignPath)\sign.targets')" />
52+
<Import Project="$(SignPath)\sign.microbuild.targets" Condition="Exists('$(SignPath)\sign.microbuild.targets')" />
53+
<!-- NuGet signing block: end -->
54+
55+
<PropertyGroup>
56+
<!-- Enabled for SDK-based web projects. -->
57+
<UseNuGetBuildExtensions Condition="'$(UseNuGetBuildExtensions)' == '' And '$(UsingMicrosoftNETSdkWeb)' == 'true'">true</UseNuGetBuildExtensions>
58+
<!-- Enabled for EXE (console app) projects, which are jobs. -->
59+
<UseNuGetBuildExtensions Condition="'$(UseNuGetBuildExtensions)' == '' And '$(UsingMicrosoftNETSdk)' == 'true' And '$(OutputType)' == 'Exe'">true</UseNuGetBuildExtensions>
60+
<!-- Other projects can opt in by setting the UseNuGetBuildExtensions property to true. -->
61+
</PropertyGroup>
62+
<Import Project="$(NuGetBuildExtensions)" Condition="'$(UseNuGetBuildExtensions)' == 'true' And '$(NuGetBuildExtensions)' != '' And Exists('$(NuGetBuildExtensions)')" />
63+
3364
</Project>

SdkProjects.props

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

src/AccountDeleter/AccountDeleter.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/ArchivePackages/ArchivePackages.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/Catalog/NuGet.Services.Metadata.Catalog.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Import Project="..\..\SdkProjects.props" />
4-
53
<PropertyGroup>
64
<TargetFrameworks>net472;netstandard2.1</TargetFrameworks>
75
<PackageVersion Condition="'$(PackageVersion)' == ''">$(JobsPackageVersion)</PackageVersion>

src/CopyAzureContainer/CopyAzureContainer.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/DatabaseMigrationTools/DatabaseMigrationTools.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/Gallery.CredentialExpiration/Gallery.CredentialExpiration.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/Gallery.Maintenance/Gallery.Maintenance.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

src/GalleryTools/GalleryTools.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\SdkProjects.props" />
32
<PropertyGroup>
43
<TargetFramework>net472</TargetFramework>
54
<OutputType>Exe</OutputType>

0 commit comments

Comments
 (0)