Skip to content

Commit c00e7cc

Browse files
authored
Merge pull request #4 from dotnet-campus/t/walterlv/refactor
弃用多个包,仅使用单一全功能包(避免开发者难维护,用户难选)
2 parents 634bcba + d17befe commit c00e7cc

33 files changed

Lines changed: 359 additions & 692 deletions

.github/workflows/dotnet-build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ jobs:
1414
uses: actions/setup-dotnet@v1
1515
with:
1616
dotnet-version: |
17-
3.1.x
18-
5.0.x
19-
6.0.x
20-
7.0.x
17+
8.0.x
2118
2219
- name: Build with dotnet
23-
run: dotnet build --configuration Release
20+
run: dotnet build --configuration release
2421

25-
- name: Test
26-
run: dotnet test --configuration Release
22+
# No need because all tests passed if the solution is successfully built
23+
# - name: Test
24+
# run: dotnet test --configuration release

.github/workflows/nuget-master-publish.yml

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

.github/workflows/nuget-tag-publish.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: publish nuget
22

3-
on:
3+
on:
44
push:
55
tags:
66
- '*'
@@ -17,10 +17,7 @@ jobs:
1717
uses: actions/setup-dotnet@v1
1818
with:
1919
dotnet-version: |
20-
3.1.x
21-
5.0.x
22-
6.0.x
23-
7.0.x
20+
8.0.x
2421
2522
- name: Install dotnet tool
2623
run: dotnet tool install -g dotnetCampus.TagToVersion
@@ -30,8 +27,8 @@ jobs:
3027

3128
- name: Build with dotnet
3229
run: |
33-
dotnet build --configuration Release
34-
dotnet pack --configuration Release --no-build
30+
dotnet build --configuration release
31+
dotnet pack --configuration release --no-build
3532
3633
- name: Install Nuget
3734
uses: nuget/setup-nuget@v1
@@ -44,5 +41,5 @@ jobs:
4441
4542
- name: Push generated package to GitHub registry
4643
run: |
47-
nuget push .\bin\Release\*.nupkg -Source github -SkipDuplicate
48-
nuget push .\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}
44+
nuget push .\artifacts\package\release\*.nupkg -Source github -SkipDuplicate
45+
nuget push .\artifacts\package\release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }}

.gitignore

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## Ignore Visual Studio temporary files, build results, and
1+
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
4-
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
4+
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
55

66
# User-specific files
77
*.rsuser
@@ -29,7 +29,6 @@ x86/
2929
bld/
3030
[Bb]in/
3131
[Oo]bj/
32-
[Oo]ut/
3332
[Ll]og/
3433
[Ll]ogs/
3534

@@ -91,6 +90,7 @@ StyleCopReport.xml
9190
*.tmp_proj
9291
*_wpftmp.csproj
9392
*.log
93+
*.tlog
9494
*.vspscc
9595
*.vssscc
9696
.builds
@@ -294,6 +294,17 @@ node_modules/
294294
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295295
*.vbw
296296

297+
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
298+
*.vbp
299+
300+
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
301+
*.dsw
302+
*.dsp
303+
304+
# Visual Studio 6 technical files
305+
*.ncb
306+
*.aps
307+
297308
# Visual Studio LightSwitch build output
298309
**/*.HTMLClient/GeneratedArtifacts
299310
**/*.DesktopClient/GeneratedArtifacts
@@ -350,6 +361,9 @@ ASALocalRun/
350361
# Local History for Visual Studio
351362
.localhistory/
352363

364+
# Visual Studio History (VSHistory) files
365+
.vshistory/
366+
353367
# BeatPulse healthcheck temp database
354368
healthchecksdb
355369

@@ -360,4 +374,26 @@ MigrationBackup/
360374
.ionide/
361375

362376
# Fody - auto-generated XML schema
363-
FodyWeavers.xsd
377+
FodyWeavers.xsd
378+
379+
# VS Code files for those working on multiple tools
380+
.vscode/*
381+
!.vscode/settings.json
382+
!.vscode/tasks.json
383+
!.vscode/launch.json
384+
!.vscode/extensions.json
385+
*.code-workspace
386+
387+
# Local History for Visual Studio Code
388+
.history/
389+
390+
# Windows Installer files from build outputs
391+
*.cab
392+
*.msi
393+
*.msix
394+
*.msm
395+
*.msp
396+
397+
# JetBrains Rider
398+
.idea/
399+
*.sln.iml

Directory.Build.props

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,34 @@
22

33
<Import Project="build\Version.props" />
44

5+
<!-- 框架和语言信息 -->
56
<PropertyGroup>
6-
77
<LangVersion>latest</LangVersion>
8+
<Nullable>enable</Nullable>
9+
<Deterministic>true</Deterministic>
810
<GenerateDocumentationFile>True</GenerateDocumentationFile>
11+
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
12+
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
13+
</PropertyGroup>
914

15+
<PropertyGroup>
1016
<!--
1117
NETSDK1138: 目标框架 netxx 不受支持,将来不会收到安全更新。
12-
NU5100: 程序集不在 lib 文件夹内
18+
NU5100: 程序集不在 lib 文件夹内。
19+
NU5128: 依赖的框架没有完全匹配项。
1320
-->
14-
<NoWarn>$(NoWarn);NETSDK1138;NU5100</NoWarn>
21+
<NoWarn>$(NoWarn);NETSDK1138;NU5100;NU5128</NoWarn>
22+
</PropertyGroup>
1523

16-
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)</PackageOutputPath>
17-
<Company>dotnet campus(.NET 职业技术学院)</Company>
24+
<!--库信息 -->
25+
<PropertyGroup>
26+
<Description>提供统一的日志记录方法。使用源生成器允许库的作者在不依赖本日志库的情况下完成日志的记录,并且还能对接到产品中完成日志的统一输出。</Description>
1827
<Authors>dotnet-campus</Authors>
28+
<Company>dotnet campus(.NET 职业技术学院)</Company>
29+
<Copyright>Copyright © 2023-2024 dotnet campus, All Rights Reserved.</Copyright>
30+
<RepositoryType>git</RepositoryType>
1931
<RepositoryUrl>https://github.com/dotnet-campus/dotnetCampus.LatestCSharpFeatures</RepositoryUrl>
2032
<PackageProjectUrl>https://github.com/dotnet-campus/dotnetCampus.LatestCSharpFeatures</PackageProjectUrl>
21-
<RepositoryType>git</RepositoryType>
22-
<Copyright>Copyright © 2023 dotnet campus, All Rights Reserved.</Copyright>
23-
2433
</PropertyGroup>
2534

26-
<ItemGroup>
27-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all"/>
28-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
29-
</ItemGroup>
30-
31-
</Project>
35+
</Project>

README.md

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,37 @@
11
# Latest CSharp Features
22

3-
| Language |
4-
| --- |
3+
| Language |
4+
| ---------------------------------- |
55
| [简体中文](/docs/README.zh-CHS.md) |
66
| [繁體中文](/docs/README.zh-CHT.md) |
7-
| [English](/README.md) |
8-
| [日本語](/docs/README.jp.md) |
7+
| [English](/README.md) |
98

10-
This open-source project provides a series of NuGet packages that allow you to use the latest C# language features in older versions of .NET (including older .NET Framework, .NET Standard, as well as older .NET Core App, .NET).
9+
[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.LatestCSharpFeatures.svg)](https://www.nuget.org/packages/dotnetCampus.LatestCSharpFeatures)
1110

12-
## NuGet Packages
13-
14-
We currently offer 8 NuGet packages for you to choose from based on your needs.
15-
16-
|Package Name|Function|Link|
17-
|---|---|---|
18-
|dotnetCampus.LatestCSharpFeatures|All-in-one package, includes all new C# features|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.LatestCSharpFeatures.svg)](https://www.nuget.org/packages/dotnetCampus.LatestCSharpFeatures)|
19-
|dotnetCampus.LatestCSharpFeatures.Source|Source code version of the all-in-one package|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.LatestCSharpFeatures.Source.svg)](https://www.nuget.org/packages/dotnetCampus.LatestCSharpFeatures.Source)|
20-
|dotnetCampus.IsExternalInit|Supports the use of init syntax|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.IsExternalInit.svg)](https://www.nuget.org/packages/dotnetCampus.IsExternalInit)|
21-
|dotnetCampus.IsExternalInit.Source|Source code version that supports the use of init syntax|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.IsExternalInit.Source.svg)](https://www.nuget.org/packages/dotnetCampus.IsExternalInit.Source)|
22-
|dotnetCampus.Nullable|Supports the use of rich nullable features|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.Nullable.svg)](https://www.nuget.org/packages/dotnetCampus.Nullable)|
23-
|dotnetCampus.Nullable.Source|Source code version that supports the use of rich nullable features|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.Nullable.Source.svg)](https://www.nuget.org/packages/dotnetCampus.Nullable.Source)|
24-
|dotnetCampus.Required|Adds support for the required syntax*|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.Required.svg)](https://www.nuget.org/packages/dotnetCampus.Required)|
25-
|dotnetCampus.Required.Source|Source code version that adds support for the required syntax*|[![NuGet](https://img.shields.io/nuget/v/dotnetCampus.Required.Source.svg)](https://www.nuget.org/packages/dotnetCampus.Required.Source)|
26-
27-
\* For an introduction to the required syntax, you can refer to this [description](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/required)【7†source】【9†source】.
11+
This open-source project provides a NuGet package, dotnetCampus.LatestCSharpFeatures, which allows you to use the latest C# language features in older versions of .NET, including the old .NET Framework, .NET Standard, and older versions of .NET Core App and .NET.
2812

2913
## How to Use
3014

31-
For both the all-in-one package and the single-feature packages, we provide two versions. Packages without the .Source suffix will generate a dll, so all projects that reference this project can use these new features. Packages with the .Source suffix are only effective for the project where the package is installed, and there are no additional dlls in the final generated project.
15+
Simply install the dotnetCampus.LatestCSharpFeatures NuGet package.
16+
17+
```xml
18+
<!-- Since dotnetCampus.LatestCSharpFeatures only contains source generators, it does not introduce any runtime dependencies.
19+
We can set it to PrivateAssets="all" to avoid passing it on to other projects. -->
20+
<PackageReference Include="dotnetCampus.LatestCSharpFeatures" Version="12.0.0" PrivateAssets="all" />
21+
```
3222

33-
If you want the .Source package to be effective for other projects that reference this project, you can add a conditional compilation symbol in the csproj file:
23+
If you want these new language features to also be effective for other projects that reference this project, you can add a conditional compilation symbol in the csproj file:
3424

3525
```xml
36-
<!-- By default, installing packages with a .Source suffix imports the new C# features into the current project as internal.
37-
By using this conditional compilation symbol, these types can be set as public, allowing other projects referencing this project to also use these new features. -->
26+
<!-- By default, dotnetCampus.LatestCSharpFeatures introduces new C# features into the current project using the internal modifier.
27+
By using this conditional compilation symbol, these types can be set to public, allowing other projects referencing this project to also use these new features. -->
3828
<DefineConstants>$(DefineConstants);USE_PUBLIC_LATEST_CSHARP_FEATURES</DefineConstants>
3929
```
4030

4131
## Feedback and Contributions
4232

43-
We welcome feedback and contributions from all users. If you encounter any problems during use, or have any suggestions for improvement, you can submit them via GitHub Issues.
33+
We welcome feedback and contributions from all users. If you encounter any problems during use, or have any suggestions for improvements, you can submit them via GitHub Issues.
4434

45-
If you wish to participate in the development of the project, you are very welcome! You can Fork this repository and then submit a Pull Request.
35+
If you wish to participate in the development of the project, you are also very welcome! You can Fork this repository and then submit a Pull Request.
4636

4737
Thank you for your support and help with dotnetCampus.LatestCSharpFeatures!

build/Version.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>11.0.0</Version>
3+
<!-- 此版本号仅作标记使用,标记当前支持的最新 C# 版本 -->
4+
<Version>12.0.0</Version>
45
</PropertyGroup>
5-
</Project>
6+
</Project>

docs/README.jp.md

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

0 commit comments

Comments
 (0)