Skip to content

Commit 844edf2

Browse files
authored
Use Nuget Central Package Version Management (#12)
1 parent 9a11393 commit 844edf2

File tree

9 files changed

+140
-118
lines changed

9 files changed

+140
-118
lines changed

Directory.Packages.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- https://devblogs.microsoft.com/nuget/introducing-central-package-management/ -->
2+
<Project>
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageVersion Include="coverlet.collector" Version="3.1.2" />
9+
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
10+
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
12+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
13+
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.3.1" />
14+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.5.109" PrivateAssets="all" />
15+
<PackageVersion Include="Nullable" Version="1.3.1" PrivateAssets="all" />
16+
<PackageVersion Include="xunit" Version="2.4.2" />
17+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
18+
<PackageVersion Include="ZySharp.Validation" Version="1.2.6" />
19+
</ItemGroup>
20+
</Project>

NuGet.Config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
<!-- https://devblogs.microsoft.com/nuget/introducing-package-source-mapping/ -->
8+
<packageSourceMapping>
9+
<packageSource key="nuget.org">
10+
<package pattern="*" />
11+
</packageSource>
12+
</packageSourceMapping>
13+
</configuration>

ZySharp.Metaprogramming.Examples/ZySharp.Metaprogramming.Examples.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1919
</PropertyGroup>
2020

21+
<ItemGroup>
22+
<None Include="packages.lock.json" Visible="false" />
23+
</ItemGroup>
24+
2125
<ItemGroup>
2226
<ProjectReference Include="..\ZySharp.Metaprogramming\ZySharp.Metaprogramming.csproj" />
2327
</ItemGroup>

ZySharp.Metaprogramming.Examples/packages.lock.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
{
2-
"version": 1,
2+
"version": 2,
33
"dependencies": {
44
"net6.0": {
55
"JetBrains.Annotations": {
66
"type": "Transitive",
77
"resolved": "2022.1.0",
88
"contentHash": "ASfpoFJxiRsC9Xc4TWuPM41Zb/gl64xwfMOhnOZ3RnVWGYIZchjpWQV5zshJgoc/ZxVtgjaF7b577lURj7E6ig=="
99
},
10+
"zysharp.metaprogramming": {
11+
"type": "Project",
12+
"dependencies": {
13+
"ZySharp.Validation": "[1.2.6, )"
14+
}
15+
},
1016
"ZySharp.Validation": {
11-
"type": "Transitive",
17+
"type": "CentralTransitive",
18+
"requested": "[1.2.6, )",
1219
"resolved": "1.2.6",
1320
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
1421
"dependencies": {
1522
"JetBrains.Annotations": "2022.1.0"
1623
}
17-
},
18-
"zysharp.metaprogramming": {
19-
"type": "Project",
20-
"dependencies": {
21-
"ZySharp.Validation": "[1.2.6, )"
22-
}
2324
}
2425
}
2526
}

ZySharp.Metaprogramming.Tests/ZySharp.Metaprogramming.Tests.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,26 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
25+
<None Include="packages.lock.json" Visible="false" />
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
2630
<!-- https://github.com/microsoft/vstest/issues/2469 -->
27-
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.3.1" Condition="$(TargetFramework.StartsWith('net4')) AND '$(OS)' == 'Unix'" />
28-
<PackageReference Include="xunit" Version="2.4.2" />
29-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
31+
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Condition="$(TargetFramework.StartsWith('net4')) AND '$(OS)' == 'Unix'" />
32+
<PackageReference Include="xunit" />
33+
<PackageReference Include="xunit.runner.visualstudio">
3034
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3135
<PrivateAssets>all</PrivateAssets>
3236
</PackageReference>
33-
<PackageReference Include="coverlet.collector" Version="3.1.2">
37+
<PackageReference Include="coverlet.collector">
3438
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3539
<PrivateAssets>all</PrivateAssets>
3640
</PackageReference>
3741
</ItemGroup>
3842

3943
<ItemGroup>
40-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" Condition="'$(TargetFramework)' == 'net4.8'" />
44+
<PackageReference Include="Microsoft.CSharp" Condition="'$(TargetFramework)' == 'net4.8'" />
4145
</ItemGroup>
4246

4347
<ItemGroup>

ZySharp.Metaprogramming.Tests/packages.lock.json

Lines changed: 71 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 1,
2+
"version": 2,
33
"dependencies": {
44
".NETCoreApp,Version=v3.1": {
55
"coverlet.collector": {
@@ -40,39 +40,11 @@
4040
"resolved": "2022.1.0",
4141
"contentHash": "ASfpoFJxiRsC9Xc4TWuPM41Zb/gl64xwfMOhnOZ3RnVWGYIZchjpWQV5zshJgoc/ZxVtgjaF7b577lURj7E6ig=="
4242
},
43-
"Microsoft.Bcl.HashCode": {
44-
"type": "Transitive",
45-
"resolved": "1.1.1",
46-
"contentHash": "MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA=="
47-
},
4843
"Microsoft.CodeCoverage": {
4944
"type": "Transitive",
5045
"resolved": "17.3.1",
5146
"contentHash": "WqB7Ik4v8ku0Y9HZShqTStZdq8R1lyhsZr7IMp8zV/OcL5sHVYvlMnardQR+SDQc3dmbniCIl9mYxYM+V7x8MA=="
5247
},
53-
"Microsoft.CSharp": {
54-
"type": "Transitive",
55-
"resolved": "4.0.1",
56-
"contentHash": "17h8b5mXa87XYKrrVqdgZ38JefSUqLChUQpXgSnpzsM0nDOhE40FTeNWOJ/YmySGV6tG6T8+hjz6vxbknHJr6A==",
57-
"dependencies": {
58-
"System.Collections": "4.0.11",
59-
"System.Diagnostics.Debug": "4.0.11",
60-
"System.Dynamic.Runtime": "4.0.11",
61-
"System.Globalization": "4.0.11",
62-
"System.Linq": "4.1.0",
63-
"System.Linq.Expressions": "4.1.0",
64-
"System.ObjectModel": "4.0.12",
65-
"System.Reflection": "4.1.0",
66-
"System.Reflection.Extensions": "4.0.1",
67-
"System.Reflection.Primitives": "4.0.1",
68-
"System.Reflection.TypeExtensions": "4.1.0",
69-
"System.Resources.ResourceManager": "4.0.1",
70-
"System.Runtime": "4.1.0",
71-
"System.Runtime.Extensions": "4.1.0",
72-
"System.Runtime.InteropServices": "4.1.0",
73-
"System.Threading": "4.0.11"
74-
}
75-
},
7648
"Microsoft.NETCore.Platforms": {
7749
"type": "Transitive",
7850
"resolved": "1.1.0",
@@ -83,15 +55,6 @@
8355
"resolved": "1.1.0",
8456
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
8557
},
86-
"Microsoft.TestPlatform.ObjectModel": {
87-
"type": "Transitive",
88-
"resolved": "17.3.1",
89-
"contentHash": "n1WSFCMiFt6KmD5JzV+Wye5Ntomez3YP2+d15bu5PS5Z1U0g+V7VBLdJIaJRnahz5BsXJDTnLYNVOUdntwjx6Q==",
90-
"dependencies": {
91-
"NuGet.Frameworks": "5.11.0",
92-
"System.Reflection.Metadata": "1.6.0"
93-
}
94-
},
9558
"Microsoft.TestPlatform.TestHost": {
9659
"type": "Transitive",
9760
"resolved": "17.3.1",
@@ -1104,20 +1067,43 @@
11041067
"xunit.extensibility.core": "[2.4.2]"
11051068
}
11061069
},
1107-
"ZySharp.Validation": {
1108-
"type": "Transitive",
1109-
"resolved": "1.2.6",
1110-
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
1111-
"dependencies": {
1112-
"JetBrains.Annotations": "2022.1.0"
1113-
}
1114-
},
11151070
"zysharp.metaprogramming": {
11161071
"type": "Project",
11171072
"dependencies": {
11181073
"Microsoft.Bcl.HashCode": "[1.1.1, )",
11191074
"ZySharp.Validation": "[1.2.6, )"
11201075
}
1076+
},
1077+
"Microsoft.Bcl.HashCode": {
1078+
"type": "CentralTransitive",
1079+
"requested": "[1.1.1, )",
1080+
"resolved": "1.1.1",
1081+
"contentHash": "MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA=="
1082+
},
1083+
"Microsoft.CSharp": {
1084+
"type": "CentralTransitive",
1085+
"requested": "[4.7.0, )",
1086+
"resolved": "4.7.0",
1087+
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
1088+
},
1089+
"Microsoft.TestPlatform.ObjectModel": {
1090+
"type": "CentralTransitive",
1091+
"requested": "[17.3.1, )",
1092+
"resolved": "17.3.1",
1093+
"contentHash": "n1WSFCMiFt6KmD5JzV+Wye5Ntomez3YP2+d15bu5PS5Z1U0g+V7VBLdJIaJRnahz5BsXJDTnLYNVOUdntwjx6Q==",
1094+
"dependencies": {
1095+
"NuGet.Frameworks": "5.11.0",
1096+
"System.Reflection.Metadata": "1.6.0"
1097+
}
1098+
},
1099+
"ZySharp.Validation": {
1100+
"type": "CentralTransitive",
1101+
"requested": "[1.2.6, )",
1102+
"resolved": "1.2.6",
1103+
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
1104+
"dependencies": {
1105+
"JetBrains.Annotations": "2022.1.0"
1106+
}
11211107
}
11221108
},
11231109
".NETFramework,Version=v4.8": {
@@ -1164,11 +1150,6 @@
11641150
"resolved": "2022.1.0",
11651151
"contentHash": "ASfpoFJxiRsC9Xc4TWuPM41Zb/gl64xwfMOhnOZ3RnVWGYIZchjpWQV5zshJgoc/ZxVtgjaF7b577lURj7E6ig=="
11661152
},
1167-
"Microsoft.Bcl.HashCode": {
1168-
"type": "Transitive",
1169-
"resolved": "1.1.1",
1170-
"contentHash": "MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA=="
1171-
},
11721153
"Microsoft.CodeCoverage": {
11731154
"type": "Transitive",
11741155
"resolved": "17.3.1",
@@ -1214,20 +1195,27 @@
12141195
"xunit.extensibility.core": "[2.4.2]"
12151196
}
12161197
},
1217-
"ZySharp.Validation": {
1218-
"type": "Transitive",
1219-
"resolved": "1.2.6",
1220-
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
1221-
"dependencies": {
1222-
"JetBrains.Annotations": "2022.1.0"
1223-
}
1224-
},
12251198
"zysharp.metaprogramming": {
12261199
"type": "Project",
12271200
"dependencies": {
12281201
"Microsoft.Bcl.HashCode": "[1.1.1, )",
12291202
"ZySharp.Validation": "[1.2.6, )"
12301203
}
1204+
},
1205+
"Microsoft.Bcl.HashCode": {
1206+
"type": "CentralTransitive",
1207+
"requested": "[1.1.1, )",
1208+
"resolved": "1.1.1",
1209+
"contentHash": "MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA=="
1210+
},
1211+
"ZySharp.Validation": {
1212+
"type": "CentralTransitive",
1213+
"requested": "[1.2.6, )",
1214+
"resolved": "1.2.6",
1215+
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
1216+
"dependencies": {
1217+
"JetBrains.Annotations": "2022.1.0"
1218+
}
12311219
}
12321220
},
12331221
"net6.0": {
@@ -1274,29 +1262,6 @@
12741262
"resolved": "17.3.1",
12751263
"contentHash": "WqB7Ik4v8ku0Y9HZShqTStZdq8R1lyhsZr7IMp8zV/OcL5sHVYvlMnardQR+SDQc3dmbniCIl9mYxYM+V7x8MA=="
12761264
},
1277-
"Microsoft.CSharp": {
1278-
"type": "Transitive",
1279-
"resolved": "4.0.1",
1280-
"contentHash": "17h8b5mXa87XYKrrVqdgZ38JefSUqLChUQpXgSnpzsM0nDOhE40FTeNWOJ/YmySGV6tG6T8+hjz6vxbknHJr6A==",
1281-
"dependencies": {
1282-
"System.Collections": "4.0.11",
1283-
"System.Diagnostics.Debug": "4.0.11",
1284-
"System.Dynamic.Runtime": "4.0.11",
1285-
"System.Globalization": "4.0.11",
1286-
"System.Linq": "4.1.0",
1287-
"System.Linq.Expressions": "4.1.0",
1288-
"System.ObjectModel": "4.0.12",
1289-
"System.Reflection": "4.1.0",
1290-
"System.Reflection.Extensions": "4.0.1",
1291-
"System.Reflection.Primitives": "4.0.1",
1292-
"System.Reflection.TypeExtensions": "4.1.0",
1293-
"System.Resources.ResourceManager": "4.0.1",
1294-
"System.Runtime": "4.1.0",
1295-
"System.Runtime.Extensions": "4.1.0",
1296-
"System.Runtime.InteropServices": "4.1.0",
1297-
"System.Threading": "4.0.11"
1298-
}
1299-
},
13001265
"Microsoft.NETCore.Platforms": {
13011266
"type": "Transitive",
13021267
"resolved": "1.1.0",
@@ -1307,15 +1272,6 @@
13071272
"resolved": "1.1.0",
13081273
"contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg=="
13091274
},
1310-
"Microsoft.TestPlatform.ObjectModel": {
1311-
"type": "Transitive",
1312-
"resolved": "17.3.1",
1313-
"contentHash": "n1WSFCMiFt6KmD5JzV+Wye5Ntomez3YP2+d15bu5PS5Z1U0g+V7VBLdJIaJRnahz5BsXJDTnLYNVOUdntwjx6Q==",
1314-
"dependencies": {
1315-
"NuGet.Frameworks": "5.11.0",
1316-
"System.Reflection.Metadata": "1.6.0"
1317-
}
1318-
},
13191275
"Microsoft.TestPlatform.TestHost": {
13201276
"type": "Transitive",
13211277
"resolved": "17.3.1",
@@ -2328,19 +2284,36 @@
23282284
"xunit.extensibility.core": "[2.4.2]"
23292285
}
23302286
},
2287+
"zysharp.metaprogramming": {
2288+
"type": "Project",
2289+
"dependencies": {
2290+
"ZySharp.Validation": "[1.2.6, )"
2291+
}
2292+
},
2293+
"Microsoft.CSharp": {
2294+
"type": "CentralTransitive",
2295+
"requested": "[4.7.0, )",
2296+
"resolved": "4.7.0",
2297+
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
2298+
},
2299+
"Microsoft.TestPlatform.ObjectModel": {
2300+
"type": "CentralTransitive",
2301+
"requested": "[17.3.1, )",
2302+
"resolved": "17.3.1",
2303+
"contentHash": "n1WSFCMiFt6KmD5JzV+Wye5Ntomez3YP2+d15bu5PS5Z1U0g+V7VBLdJIaJRnahz5BsXJDTnLYNVOUdntwjx6Q==",
2304+
"dependencies": {
2305+
"NuGet.Frameworks": "5.11.0",
2306+
"System.Reflection.Metadata": "1.6.0"
2307+
}
2308+
},
23312309
"ZySharp.Validation": {
2332-
"type": "Transitive",
2310+
"type": "CentralTransitive",
2311+
"requested": "[1.2.6, )",
23332312
"resolved": "1.2.6",
23342313
"contentHash": "nz8AfHi7E59k9ArgapYXG/UHQJNCGHW3LVcj/spHlKZErjMMvjDuzOoKiToqIZk2UtRnoYPR2XE4Nh9XlnM7KA==",
23352314
"dependencies": {
23362315
"JetBrains.Annotations": "2022.1.0"
23372316
}
2338-
},
2339-
"zysharp.metaprogramming": {
2340-
"type": "Project",
2341-
"dependencies": {
2342-
"ZySharp.Validation": "[1.2.6, )"
2343-
}
23442317
}
23452318
}
23462319
}

ZySharp.Metaprogramming.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ EndProject
1212
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{480F96DD-6F16-4691-85E6-C609F0C114E5}"
1313
ProjectSection(SolutionItems) = preProject
1414
.editorconfig = .editorconfig
15+
Directory.Packages.props = Directory.Packages.props
16+
NuGet.Config = NuGet.Config
17+
version.json = version.json
1518
EndProjectSection
1619
EndProject
1720
Global

0 commit comments

Comments
 (0)