Skip to content

Commit d001e7e

Browse files
AroglDarthujmezach
andauthored
Remove support for netcoreapp2.1 and add support for net6.0 (#194)
* Remove support for netcoreapp2.1 and add support for net6.0 * Use DACFX preview * Update workflow for .NET 6 * Change TFM logic yet again * Fix version dependency in workflow * Yet more fixes * Fix comment Co-authored-by: Jonathan Mezach <[email protected]>
1 parent d20c524 commit d001e7e

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

.github/workflows/main.yml

+13-14
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ jobs:
2626
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2727
submodules: 'true' # need to check out the SqlTools submodule to build successfully.
2828

29-
# Install .NET Core SDK's for 2.1, 3.1 and 5.0
30-
- name: Setup dotnet 2.1
31-
uses: actions/setup-dotnet@v1
32-
with:
33-
dotnet-version: '2.1.x'
34-
29+
# Install .NET Core SDK's for 3.1, 5.0 and 6.0
3530
- name: Setup dotnet 3.1
3631
uses: actions/setup-dotnet@v1
3732
with:
@@ -42,6 +37,11 @@ jobs:
4237
with:
4338
dotnet-version: '5.0.x'
4439

40+
- name: Setup dotnet 6.0
41+
uses: actions/setup-dotnet@v1
42+
with:
43+
dotnet-version: '6.0.x'
44+
4545
# Install Nerdbank.GitVersioning
4646
- name: install nbgv
4747
run: dotnet tool install --tool-path . nbgv
@@ -112,7 +112,7 @@ jobs:
112112
strategy:
113113
matrix:
114114
os: [ "ubuntu-18.04", "macos-10.15", "windows-2019" ]
115-
dotnet: [ '2.1.x', '3.1.x', '5.0.x' ]
115+
dotnet: [ '3.1.x', '5.0.x', '6.0.x' ]
116116
fail-fast: false
117117

118118
steps:
@@ -176,13 +176,12 @@ jobs:
176176

177177
# Build the project using double wildcard (i.e. 1.*-*)
178178
- name: build project (double floating version / dotnet 3)
179-
if: ${{ matrix.dotnet != '2.1.x' }}
180-
run: dotnet build ./test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj /bl /p:DependencyVersion="1.*-*" /warnaserror:SQL71502
179+
run: dotnet build ./test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj /bl /p:DependencyVersion="2.*-*" /warnaserror:SQL71502
181180
shell: pwsh
182181

183182
# Upload dacpac
184183
- name: upload
185-
if: ${{ matrix.os == 'ubuntu-18.04' && matrix.dotnet == '3.1.x' }}
184+
if: ${{ matrix.os == 'ubuntu-18.04' && matrix.dotnet == '6.0.x' }}
186185
uses: actions/[email protected]
187186
with:
188187
name: dacpac-package
@@ -279,7 +278,7 @@ jobs:
279278
# Setup .NET SDK
280279
- uses: actions/setup-dotnet@v1
281280
with:
282-
dotnet-version: '5.0.x'
281+
dotnet-version: '6.0.x'
283282

284283
# Install Nerdbank.GitVersioning
285284
- name: install nbgv
@@ -296,11 +295,11 @@ jobs:
296295
with:
297296
files: 'test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj'
298297
env:
299-
DependencyVersion: '1.*-*'
298+
DependencyVersion: '2.*-*'
300299

301300
# Publish the project
302301
- name: publish project
303-
run: dotnet publish ./test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj /p:TargetUser=sa /p:TargetPassword=JdMsKZPBBA8kVFXVrj8d /bl /p:DependencyVersion="1.*-*" /warnaserror:SQL71502
302+
run: dotnet publish ./test/TestProjectWithSDKRef/TestProjectWithSDKRef.csproj /p:TargetUser=sa /p:TargetPassword=JdMsKZPBBA8kVFXVrj8d /bl /p:DependencyVersion="2.*-*" /warnaserror:SQL71502
304303

305304
# Upload binary log
306305
- name: upload
@@ -325,7 +324,7 @@ jobs:
325324
# Setup .NET SDK
326325
- uses: actions/setup-dotnet@v1
327326
with:
328-
dotnet-version: '5.0.x'
327+
dotnet-version: '6.0.x'
329328

330329
# Download artifacts
331330
- name: download-artifact

src/DacpacTool/DacpacTool.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;netcoreapp5.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
66
<LangVersion>9.0</LangVersion>
77
</PropertyGroup>
88

@@ -12,8 +12,8 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.SqlServer.DACFX" Version="150.5282.3" />
16-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21216.1" />
15+
<PackageReference Include="Microsoft.SqlServer.DACFX" Version="160.5323.3-preview" />
16+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21308.1" />
1717
</ItemGroup>
1818

1919
<!-- References to Microsoft.SqlTools.ManagedBatchParser -->

src/MSBuild.Sdk.SqlProj/MSBuild.Sdk.SqlProj.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<Target Name="IncludeDacpacTool" AfterTargets="Build">
3333
<PropertyGroup>
34-
<_DacpacToolSupportedTfms>netcoreapp2.1;netcoreapp3.1;netcoreapp5.0</_DacpacToolSupportedTfms>
34+
<_DacpacToolSupportedTfms>netcoreapp3.1;net5.0;net6.0</_DacpacToolSupportedTfms>
3535
</PropertyGroup>
3636
<ItemGroup>
3737
<DacpacToolSupportedTfms Include="$(_DacpacToolSupportedTfms)" />

src/MSBuild.Sdk.SqlProj/Sdk/Sdk.targets

+5-4
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,19 @@
8585
<Import Project="$(MSBuildToolsPath)\Microsoft.Managed.targets" Condition="'$(MSBuildAssemblyVersion)' >= '16.0' And '$(ManagedLanguageTargetsGotImported)' != 'true'" />
8686

8787
<!--
88-
Validates that the environment is setup correctly for the DacpacTool to run. Currently we target .NET Core 2.1 and 3.1 and we pick the highest version based on
88+
Validates that the environment is setup correctly for the DacpacTool to run. Currently we target .NET Core 3.1, 5.0 or 6.0 and we pick the version based on
8989
the BundledNETCoreAppTargetFrameworkVersion property. This property is set by the SDK, so we'll need to ensure that the SDK that is being used is compatible with one
9090
of the supported target frameworks.
9191
-->
9292
<Target Name="ValidateEnvironment">
9393
<PropertyGroup>
94-
<DacpacToolTfm>netcoreapp$(BundledNETCoreAppTargetFrameworkVersion)</DacpacToolTfm>
94+
<DacpacToolTfm Condition="'$(BundledNETCoreAppTargetFrameworkVersion)' == '3.1'">netcoreapp$(BundledNETCoreAppTargetFrameworkVersion)</DacpacToolTfm>
95+
<DacpacToolTfm Condition="'$(BundledNETCoreAppTargetFrameworkVersion)' != '3.1'">net$(BundledNETCoreAppTargetFrameworkVersion)</DacpacToolTfm>
9596
<DacpacToolExe>$(MSBuildThisFileDirectory)../tools/$(DacpacToolTfm)/DacpacTool.dll</DacpacToolExe>
9697
</PropertyGroup>
9798
<Error Condition="!Exists($(DacpacToolExe))"
98-
Text="The current SDK bundles target framework 'netcoreapp$(BundledNETCoreAppTargetFrameworkVersion)' which is not supported by MSBuild.Sdk.SqlProj. Either install a .NET Core SDK that supports 2.1, 3.1 or 5.0, or file an issue at https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/ to add support. If you have preview SDKs installed, you may have to use a global.json file: https://docs.microsoft.com/dotnet/core/tools/global-json" />
99-
<Message Importance="normal" Text="Using target framework $(DacpacToolTfm) to run DacpacTool" />
99+
Text="The current SDK bundles target framework '$(BundledNETCoreAppTargetFrameworkVersion)' which is not supported by MSBuild.Sdk.SqlProj. Either install a .NET Core SDK that supports 3.1, 5.0 or 6.0, or file an issue at https://github.com/rr-wfm/MSBuild.Sdk.SqlProj/ to add support. If you have preview SDKs installed, you may have to use a global.json file: https://docs.microsoft.com/dotnet/core/tools/global-json" />
100+
<Message Importance="High" Text="Using target framework $(DacpacToolTfm) to run DacpacTool" />
100101
</Target>
101102

102103
<!--

test/DacpacTool.Tests/DacpacTool.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<AssemblyName>MSBuild.Sdk.SqlProj.DacpacTool.Tests</AssemblyName>
77
<RootNamespace>MSBuild.Sdk.SqlProj.DacpacTool.Tests</RootNamespace>

test/TestProject/global.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "6.0.0",
4+
"rollForward": "latestMinor"
5+
}
6+
}

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.18.0-beta.{height}",
3+
"version": "2.0.0-beta.{height}",
44
"nuGetPackageVersion": {
55
"semVer": 2.0
66
},

0 commit comments

Comments
 (0)