IntelliTect / IntelliTect/EssentialCSharp
Improve GetAllValidNETPreprocessorSymbols
- 主要言語
- C#
- スター
- 418
- フォーク
- 173
- 平均マージ
- 3分
- マージ済み PR(30日)
- 3
説明
This works, but I think it is cleaner, to just write out the individual `yield return` lines.
_Originally posted by @Keboo in https://github.com/IntelliTect/EssentialCSharp/pull/584#discussion_r1383683019_
Maybe something like:
```C#
switch
(
(majorVersion, minorVersion)
)
{
case (5, 0):
yield return "NET5_0_OR_GREATER";
yield return "NET5_0";
goto case (3, 1);
case (3, 1):
yield return "NETCOREAPP3_1_OR_GREATER";
yield return "NETCOREAPP3_1";
goto case (3, 0);
case (3, 0):
yield return "NETCOREAPP3_0_OR_GREATER";
goto case (2, 1);
case (2, 1):
yield return "NETCOREAPP2_1_OR_GREATER";
goto case (2, 0);
case (2, 0):
yield return "NETCOREAPP2_0_OR_GREATER";
goto case (1, 1);
case (1, 1):
yield return "NETCOREAPP1_1_OR_GREATER";
goto case (1, 0);
case (1, 0):
yield return "NETCOREAPP1_0_OR_GREATER";
break;
default:
break;
```
This needs more cleanup and work, but general structure is there
コントリビューションガイド
調査の方向性
GetAllValidNETPreprocessorSymbols のエントリポイントを見つけ、現在の実装を issue で提案されている switch 構造と比較します。サポートされている各バージョンで期待されるシンボルを維持しながら実装を整理し、その後もプロジェクトがビルドでき、既存のチェックにパスすることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- 領域
- build-system
- issue の種類
- リファクタリング
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100