Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit 61c419b

Browse files
authored
Change SDK and NuGet selection (#20)
* Add global.json to use .NET 3.1 SDK * Change applicable versions of NuGet packages * Improve project selection in Azure Pipeline Resolves #18.
1 parent bc053f7 commit 61c419b

File tree

5 files changed

+22
-30
lines changed

5 files changed

+22
-30
lines changed

SpecFlow.DependencyInjection.Tests/SpecFlow.DependencyInjection.Tests.csproj

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,23 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="GitVersionTask" Version="5.1.3">
12-
<PrivateAssets>all</PrivateAssets>
13-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
14-
</PackageReference>
15-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
18-
</PackageReference>
11+
<PackageReference Include="GitVersionTask" Version="5.1.3" PrivateAssets="All" />
12+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
13+
<PackageReference Include="xunit" Version="2.4.1" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" />
1915
</ItemGroup>
2016

21-
<!-- .NET Core 2.1 LTS -->
17+
<!-- .NET Core 2.1 LTS (always use lowest applicable version) -->
2218
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
2319
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.0.188" />
2420
<PackageReference Include="SpecFlow.xUnit" Version="3.0.188" />
25-
<PackageReference Include="xunit" Version="2.4.0" />
26-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0">
27-
<PrivateAssets>all</PrivateAssets>
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
29-
</PackageReference>
3021
</ItemGroup>
3122

32-
<!-- .NET Core 3.1 LTS -->
23+
<!-- .NET Core 3.1 LTS (always use latest applicable version) -->
3324
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
25+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
3426
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.1.82" />
3527
<PackageReference Include="SpecFlow.xUnit" Version="3.1.82" />
36-
<PackageReference Include="xunit" Version="2.4.1" />
37-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
38-
<PrivateAssets>all</PrivateAssets>
39-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
40-
</PackageReference>
4128
</ItemGroup>
4229

4330
<ItemGroup>

SpecFlow.DependencyInjection.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.705
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29721.120
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpecFlow.DependencyInjection", "SpecFlow.DependencyInjection\SpecFlow.DependencyInjection.csproj", "{CACF906A-7230-4E37-984C-739AB1620995}"
77
EndProject
@@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
.gitignore = .gitignore
1212
azure-pipelines.yml = azure-pipelines.yml
1313
GitVersion.yml = GitVersion.yml
14+
global.json = global.json
1415
README.md = README.md
1516
EndProjectSection
1617
EndProject

SpecFlow.DependencyInjection/SpecFlow.DependencyInjection.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
<None Include="build\**" Pack="True" PackagePath="build\" />
2323
</ItemGroup>
2424
<ItemGroup>
25-
<PackageReference Include="GitVersionTask" Version="5.1.3">
26-
<PrivateAssets>all</PrivateAssets>
27-
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
28-
</PackageReference>
25+
<PackageReference Include="GitVersionTask" Version="5.1.3" PrivateAssets="All" />
2926
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1" />
3027
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
3128
<PackageReference Include="SpecFlow" Version="3.0.188" />

azure-pipelines.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,33 @@ steps:
1515
displayName: Restore
1616
inputs:
1717
command: restore
18-
# Build
18+
# Build .NET Standard 2.0
1919
- task: DotNetCoreCLI@2
2020
displayName: Build
2121
inputs:
2222
command: build
23+
projects: 'SpecFlow.DependencyInjection'
2324
arguments: '--configuration $(BuildConfiguration)'
2425
# Test .NET Core 2.1
2526
- task: DotNetCoreCLI@2
2627
displayName: Test .NET Core 2.1
2728
inputs:
2829
command: test
29-
projects: '**/*.Tests/*.csproj'
30+
projects: 'SpecFlow.DependencyInjection.Tests'
3031
arguments: '--configuration $(BuildConfiguration) --framework netcoreapp2.1'
3132
# Test .NET Core 3.1
3233
- task: DotNetCoreCLI@2
3334
displayName: Test .NET Core 3.1
3435
inputs:
3536
command: test
36-
projects: '**/*.Tests/*.csproj'
37+
projects: 'SpecFlow.DependencyInjection.Tests'
3738
arguments: '--configuration $(BuildConfiguration) --framework netcoreapp3.1'
38-
# Pack
39+
# Pack output of Build command
3940
- task: DotNetCoreCLI@2
4041
displayName: Pack
4142
inputs:
4243
command: pack
44+
packagesToPack: 'SpecFlow.DependencyInjection'
4345
nobuild: true
4446
# Publish
4547
- task: PublishBuildArtifacts@1

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.1.101"
4+
}
5+
}

0 commit comments

Comments
 (0)