Skip to content

Commit c7a490f

Browse files
authored
Source package cleanup (#49041)
1 parent b2460a2 commit c7a490f

29 files changed

+117
-0
lines changed

Directory.Build.targets

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,33 @@
7878
</KnownFrameworkReference>
7979
</ItemGroup>
8080

81+
<!--
82+
Common content for all SDK source packages.
83+
-->
84+
85+
<PropertyGroup Condition="'$(IsSourcePackage)' == 'true'">
86+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddEditorConfigToSourcePackage;_AddLinkedCompileItemsToSourcePackage</TargetsForTfmSpecificContentInPackage>
87+
<PackageDescription>
88+
$(PackageDescription)
89+
90+
The source code included in this package is subject to arbitrary changes in future versions.
91+
Updating a reference to this package to a newer version of the package may require changes in the referencing project.
92+
No compatibility guarantees are provided.
93+
</PackageDescription>
94+
</PropertyGroup>
95+
96+
<!-- Include SourcePackage.editorconfig in all source packages. -->
97+
<Target Name="_AddEditorConfigToSourcePackage">
98+
<ItemGroup>
99+
<TfmSpecificPackageFile Include="$(MSBuildThisFileDirectory)eng\SourcePackage.editorconfig" PackagePath="contentFiles/cs/$(TargetFramework)/.editorconfig" />
100+
</ItemGroup>
101+
</Target>
102+
103+
<!-- Include linked files. Arcade SDK only includes files in the project directory. -->
104+
<Target Name="_AddLinkedCompileItemsToSourcePackage">
105+
<ItemGroup>
106+
<TfmSpecificPackageFile Include="@(Compile)" Condition="'%(Compile.Link)' != ''" PackagePath="contentFiles/cs/$(TargetFramework)/%(Compile.Link)" BuildAction="Compile"/>
107+
</ItemGroup>
108+
</Target>
109+
81110
</Project>

eng/SourcePackage.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
# C# files
5+
[*.cs]
6+
7+
# We don't want any analyzer diagnostics to be reported for people consuming this as a source package.
8+
dotnet_analyzer_diagnostic.severity = none
9+
10+
generated_code = true
11+
12+
# The above configurations don't apply to compiler warnings. Requiring all params to be documented
13+
# is not something we require for this project, so suppressing it directly here.
14+
dotnet_diagnostic.CS1573.severity = none
15+
16+
# As above, we need to specifically disable compiler warnings that we don't want to break downstream
17+
# builds
18+
dotnet_diagnostic.IDE0005.severity = none
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*.cs]
2+
3+
# IDE0240: Remove redundant nullable directive
4+
# The directive needs to be included since all sources in a source package are considered generated code
5+
# when referenced from a project via package reference.
6+
dotnet_diagnostic.IDE0240.severity = none

src/BuiltInTools/AspireService/AspireServerService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57
using System.Collections.Generic;
68
using System.Net;

src/BuiltInTools/AspireService/Contracts/IAspireServerEvents.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System.Threading;
57
using System.Threading.Tasks;
68
using System.Collections.Generic;

src/BuiltInTools/AspireService/Helpers/CertGenerator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57
using System.Security.Cryptography;
68
using System.Security.Cryptography.X509Certificates;

src/BuiltInTools/AspireService/Helpers/ExceptionExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57

68
namespace Aspire.Tools.Service;

src/BuiltInTools/AspireService/Helpers/HttpContextExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57
using System.Threading;
68
using System.Threading.Tasks;

src/BuiltInTools/AspireService/Helpers/LoggerProvider.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57
using Microsoft.Extensions.Logging;
68

src/BuiltInTools/AspireService/Helpers/SocketConnectionManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#nullable enable
5+
46
using System;
57
using System.Collections.Generic;
68
using System.Net.WebSockets;

0 commit comments

Comments
 (0)