Skip to content

Commit dd1b261

Browse files
authored
Adopt central package management and clean up props/targets (#415)
Introduces Directory.Packages.props for centralized NuGet package version management. Removes explicit package versions from project files and Directory.build.props, and updates paths and minor configuration in props/targets files. Also updates the solution file for Visual Studio 18 and adds new solution items.
1 parent 91fdded commit dd1b261

File tree

6 files changed

+48
-48
lines changed

6 files changed

+48
-48
lines changed

src/Directory.Packages.props

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
6+
<ItemGroup>
7+
<PackageVersion Include="System.Reactive" Version="6.1.0" />
8+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
9+
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.9.50" />
10+
<PackageVersion Include="stylecop.analyzers" Version="1.2.0-beta.556" />
11+
<PackageVersion Include="Roslynator.Analyzers" Version="4.14.1" />
12+
13+
<PackageVersion Include="DynamicData" Version="9.4.1" />
14+
<PackageVersion Include="PublicApiGenerator" Version="11.4.6" />
15+
<PackageVersion Include="Verify.NUnit" Version="30.10.0" />
16+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
17+
<PackageVersion Include="NUnit" Version="4.4.0" />
18+
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
19+
<PackageVersion Include="FluentAssertions" Version="8.6.0" />
20+
<PackageVersion Include="DiffEngine" Version="16.8.0" />
21+
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
22+
</ItemGroup>
23+
</Project>

src/Directory.build.props

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<RepositoryUrl>https://github.com/reactiveui/punchclock</RepositoryUrl>
1515
<RepositoryType>git</RepositoryType>
1616
<GenerateDocumentationFile>true</GenerateDocumentationFile>
17-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)analyzers.ruleset</CodeAnalysisRuleSet>
17+
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/analyzers.ruleset</CodeAnalysisRuleSet>
1818
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
1919
<DebugType>Embedded</DebugType>
2020
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
@@ -26,33 +26,32 @@
2626

2727
<EnableNETAnalyzers>True</EnableNETAnalyzers>
2828
<AnalysisLevel>latest</AnalysisLevel>
29-
<LangVersion>preview</LangVersion>
3029
</PropertyGroup>
3130

3231
<PropertyGroup Condition="$(IsTestProject)">
3332
<IsPackable>false</IsPackable>
3433
</PropertyGroup>
3534

3635
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
37-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
36+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
3837
</ItemGroup>
3938

4039
<ItemGroup>
41-
<None Include="$(MSBuildThisFileDirectory)..\images\logo.png" Pack="true" PackagePath="\" />
42-
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
43-
<None Include="$(MSBuildThisFileDirectory)..\README.md" Pack="true" PackagePath="\" />
40+
<None Include="$(MSBuildThisFileDirectory)../images/logo.png" Pack="true" PackagePath="\" />
41+
<None Include="$(MSBuildThisFileDirectory)../LICENSE" Pack="true" PackagePath="LICENSE" />
42+
<None Include="$(MSBuildThisFileDirectory)../README.md" Pack="true" PackagePath="\" />
4443
</ItemGroup>
4544

4645
<ItemGroup>
47-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" PrivateAssets="all" />
46+
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" />
4847
</ItemGroup>
4948

5049
<ItemGroup>
51-
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
52-
<PackageReference Include="Roslynator.Analyzers" Version="4.14.1" PrivateAssets="All" />
50+
<PackageReference Include="stylecop.analyzers" PrivateAssets="all" />
51+
<PackageReference Include="Roslynator.Analyzers" PrivateAssets="All" />
5352
</ItemGroup>
5453

5554
<ItemGroup>
56-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
55+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)/stylecop.json" Link="stylecop.json" />
5756
</ItemGroup>
5857
</Project>

src/Directory.build.targets

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,4 @@
22
<PropertyGroup>
33
<Product>$(AssemblyName) ($(TargetFramework))</Product>
44
</PropertyGroup>
5-
6-
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
7-
<DefineConstants>$(DefineConstants);NET_45;XAML</DefineConstants>
8-
</PropertyGroup>
9-
<PropertyGroup Condition="$(TargetFramework.StartsWith('uap'))">
10-
<DefineConstants>$(DefineConstants);NETFX_CORE;XAML;WINDOWS_UWP</DefineConstants>
11-
</PropertyGroup>
12-
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS'))">
13-
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
14-
</PropertyGroup>
15-
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac'))">
16-
<DefineConstants>$(DefineConstants);MONO;COCOA</DefineConstants>
17-
</PropertyGroup>
18-
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.TVOS'))">
19-
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
20-
</PropertyGroup>
21-
<PropertyGroup Condition="$(TargetFramework.StartsWith('Xamarin.WatchOS'))">
22-
<DefineConstants>$(DefineConstants);MONO;UIKIT;COCOA</DefineConstants>
23-
</PropertyGroup>
24-
<PropertyGroup Condition="$(TargetFramework.StartsWith('MonoAndroid'))">
25-
<DefineConstants>$(DefineConstants);MONO;ANDROID</DefineConstants>
26-
</PropertyGroup>
27-
<PropertyGroup Condition="$(TargetFramework.StartsWith('tizen'))">
28-
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
29-
</PropertyGroup>
305
</Project>

src/Punchclock.Tests/Punchclock.Tests.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="DynamicData" Version="9.4.1" />
12-
<PackageReference Include="PublicApiGenerator" Version="11.4.6" />
13-
<PackageReference Include="Verify.NUnit" Version="30.20.1" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
15-
<PackageReference Include="NUnit" Version="4.4.0" />
16-
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
17-
<PackageReference Include="FluentAssertions" Version="8.6.0" />
18-
<PackageReference Include="DiffEngine" Version="16.8.0" />
19-
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
11+
<PackageReference Include="DynamicData" />
12+
<PackageReference Include="PublicApiGenerator" />
13+
<PackageReference Include="Verify.NUnit" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
15+
<PackageReference Include="NUnit" />
16+
<PackageReference Include="NUnit3TestAdapter" />
17+
<PackageReference Include="FluentAssertions" />
18+
<PackageReference Include="DiffEngine" />
19+
<PackageReference Include="coverlet.msbuild">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2222
</PackageReference>
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<ProjectReference Include="..\Punchclock\Punchclock.csproj" />
26+
<ProjectReference Include="../Punchclock/Punchclock.csproj" />
2727
</ItemGroup>
2828
</Project>

src/Punchclock.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
3-
VisualStudioVersion = 17.3.32922.545
2+
# Visual Studio Version 18
3+
VisualStudioVersion = 18.0.11205.157 d18.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Punchclock", "Punchclock\Punchclock.csproj", "{D3D5E08E-2DAA-4C14-BDF1-C15BD81247F5}"
66
EndProject
@@ -10,7 +10,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Items", "Items", "{E035091F
1010
ProjectSection(SolutionItems) = preProject
1111
analyzers.ruleset = analyzers.ruleset
1212
analyzers.tests.ruleset = analyzers.tests.ruleset
13+
..\.github\workflows\ci-build.yml = ..\.github\workflows\ci-build.yml
1314
Directory.build.props = Directory.build.props
15+
Directory.build.targets = Directory.build.targets
16+
Directory.Packages.props = Directory.Packages.props
1417
..\LICENSE = ..\LICENSE
1518
..\README.md = ..\README.md
1619
stylecop.json = stylecop.json

src/Punchclock/Punchclock.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="System.Reactive" Version="6.1.0" />
11+
<PackageReference Include="System.Reactive" />
1212
</ItemGroup>
1313

1414
</Project>

0 commit comments

Comments
 (0)