Commit 63bb707
refactor(Core): 折叠 6 段 TFM 条件 ItemGroup 为 2 段
违反架构不变量:csproj 重复了 props 已表达的 TFM 维度。
原状:6 段几乎相同的 ItemGroup 表达 6 个 TFM。
- ns2.0 / ns2.1 各 1 段(几乎完全相同,差异在 System.Runtime.Loader 都引入)
- net6/7/8/10 各 1 段(完全相同,都是同 2 个包)
折叠后:2 段。
- ns2.x 段(OR 条件):引入 3 个包(含 System.Runtime.Loader)
- 其余 .NET 段(AND-NOT 条件):引入 2 个包
dotnet list package --include-transitive 验证所有 TFM 仍拿到正确版本:
- ns2.0 → 2.2.0 / 3.1.6 / 4.3.0
- ns2.1 → 3.1.2 / 3.1.6 / 4.3.0
- net6 → 6.0.0 / 6.0.0
- net7 → 7.0.0 / 7.0.0
- net8 → 8.0.0 / 8.0.0
- net10 → 10.0.0 / 10.0.0
未来新增 TFM (e.g. net11) 只需在 props 加 Update 段,csproj 无需改。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 322c5c7 commit 63bb707
1 file changed
Lines changed: 4 additions & 26 deletions
Lines changed: 4 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 9 | | |
16 | | - | |
17 | | - | |
| 10 | + | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
22 | 16 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 17 | + | |
| 18 | + | |
36 | 19 | | |
37 | 20 | | |
38 | 21 | | |
39 | 22 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 23 | | |
46 | 24 | | |
47 | 25 | | |
| |||
0 commit comments