Skip to content

Commit

Permalink
Bumped to .NET 7
Browse files Browse the repository at this point in the history
Removed .NET 3.1, .NET 5
Removed obsolete pragmas and dead code
Updated CI
  • Loading branch information
oskardudycz committed Nov 29, 2022
1 parent 5d32a4a commit a4b52b9
Show file tree
Hide file tree
Showing 70 changed files with 219 additions and 589 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 6.0.x
- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/on-manual-do-nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
config: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
dotnet_core_version: 6.0.100
dotnet_core_version: 7.0.x

jobs:
publish_job:
Expand All @@ -16,10 +16,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Install .NET 6
- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet_core_version }}
dotnet-version: 7.0.x

- name: Run Pack
run: ./build.sh --no-color pack
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/on-push-do-ci-build-pg10.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net3.1 pg10
name: build_net6.0 pg10

on:
push:
Expand Down Expand Up @@ -43,22 +43,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x

- name: Install .NET Core 5.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -81,5 +76,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run -p build/build.csproj -f netcoreapp3.1 -c Release -- ci
run: dotnet run -p build/build.csproj -f net6.0 -c Release -- ci
shell: bash
18 changes: 6 additions & 12 deletions .github/workflows/on-push-do-ci-build-pg11.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net3.1 pg11
name: build_net6.0 pg11

on:
push:
Expand Down Expand Up @@ -43,21 +43,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 3.1.x
- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x

- name: Install .NET Core 5.0.x
- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
Expand All @@ -81,5 +75,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run -p build/build.csproj -f netcoreapp3.1 -c Release -- ci
run: dotnet run -p build/build.csproj -f net6.0 -c Release -- ci
shell: bash
19 changes: 7 additions & 12 deletions .github/workflows/on-push-do-ci-build-pg12.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net3.1 pg12
name: build_net6.0 pg12

on:
push:
Expand Down Expand Up @@ -43,22 +43,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x

- name: Install .NET Core 5.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -81,5 +76,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run -p build/build.csproj -f netcoreapp3.1 -c Release -- ci
run: dotnet run -p build/build.csproj -f net6.0 -c Release -- ci
shell: bash
19 changes: 7 additions & 12 deletions .github/workflows/on-push-do-ci-build-pg9.6.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net3.1 pg9.6
name: build_net6.0 pg9.6

on:
push:
Expand Down Expand Up @@ -43,22 +43,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 3.1.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x

- name: Install .NET Core 5.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -81,5 +76,5 @@ jobs:
- name: Build
env:
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run -p build/build.csproj -f netcoreapp3.1 -c Release -- ci
run: dotnet run -p build/build.csproj -f net6.0 -c Release -- ci
shell: bash
17 changes: 6 additions & 11 deletions .github/workflows/on-push-do-ci-build-systemtextjson.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build_net3.1 pg12 System.Text.Json
name: build_net6.0 pg12 System.Text.Json

on:
push:
Expand Down Expand Up @@ -44,20 +44,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install .NET Core 3.1.x
- name: Install .NET Core 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

- name: Install .NET Core 6.0.x
- name: Install .NET Core 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Install Node.js
uses: actions/setup-node@v3
Expand All @@ -82,5 +77,5 @@ jobs:
env:
DEFAULT_SERIALIZER: "SystemTextJson"
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run -p build/build.csproj -f netcoreapp3.1 -c Release -- ci
run: dotnet run -p build/build.csproj -f net6.0 -c Release -- ci
shell: bash
6 changes: 1 addition & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
<Project>
<PropertyGroup>
<VersionPrefix>5.11.0</VersionPrefix>
<LangVersion>10.0</LangVersion>
<LangVersion>11.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko</Authors>
<PackageIconUrl>https://martendb.io/logo.png</PackageIconUrl>
<PackageProjectUrl>https://martendb.io/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<NoWarn>1570;1571;1572;1573;1574;1587;1591;1701;1702;1711;1735;0618</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="IsExternalInit" Version="1.0.2" PrivateAssets="All"/>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Access docs [here](https://martendb.io/) and v3.x docs [here](https://martendb.i

Before getting started you will need the following in your environment:

**1. .NET Core SDK 5.0+ and the .NET Core 3.1 Runtime**
**1. .NET Core SDK 6.0+**

Available [here](https://dotnet.microsoft.com/download)

Expand Down Expand Up @@ -59,7 +59,7 @@ See more in [Contribution Guidelines](CONTRIBUTING.md).
### Build Commands

| Description | Windows Commandline | PowerShell | Linux Shell | DotNet CLI |
| ----------------------------------- | ------------------------ | ------------------------ |-------------------------| -------------------------------------------------- |
| ----------------------------------- | ------------------------ | ------------------------ | ----------------------- | -------------------------------------------------- |
| Run restore, build and test | `build.cmd` | `build.ps1` | `build.sh` | `dotnet build src\Marten.sln` |
| Run all tests including mocha tests | `build.cmd test` | `build.ps1 test` | `build.sh test` | `dotnet run -p build/build.csproj -- test` |
| Run just mocha tests | `build.cmd mocha` | `build.ps1 mocha` | `build.sh mocha` | `dotnet run -p build/build.csproj -- mocha` |
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ variables:
config: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
dotnet_core_version: 6.0.x
dotnet_core_version: 7.0.x
node_version: 16.x
pg_db: marten_testing
marten_testing_database: "Host=localhost;Port=5432;Database=marten_testing;Username=postgres;Password=Password12!"
Expand Down
5 changes: 2 additions & 3 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@echo off
FOR /f %%v IN ('dotnet --version') DO set version=%%v
set target_framework=
IF "%version:~0,3%"=="3.1" (set target_framework=netcoreapp3.1)
IF "%version:~0,2%"=="5." (set target_framework=net5.0)
IF "%version:~0,2%"=="6." (set target_framework=net6.0)
IF "%version:~0,2%"=="7." (set target_framework=net7.0)

IF [%target_framework%]==[] (
echo "BUILD FAILURE: .NET Core 3.1, .NET 5, .NET 6 SDK required to run build"
echo "BUILD FAILURE: .NET 6, .NET 7 SDK required to run build"
exit /b 1
)

Expand Down
16 changes: 7 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
$ErrorActionPreference = "Stop";
$version = dotnet --version;
if ($version.StartsWith("3.1")) {
$target_framework="netcoreapp3.1"
}
elseif ($version.StartsWith("5.")) {
$target_framework="net5.0"
if ($version.StartsWith("6.")) {
$target_framework = "net6.0"
}
elseif ($version.StartsWith("6.")) {
$target_framework="net6.0"
} else {
Write-Output "BUILD FAILURE: .NET Core 3.1, .NET 5, .NET 6 SDK required to run build"
elseif ($version.StartsWith("7.")) {
$target_framework = "net7.0"
}
else {
Write-Output "BUILD FAILURE: .NET 6, .NET 7 SDK required to run build"
exit 1
}

Expand Down
10 changes: 4 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
set -euo pipefail

version="$(dotnet --version)"
if [[ $version = 3.1* ]]; then
target_framework="netcoreapp3.1"
elif [[ $version = 5.* ]]; then
target_framework="net5.0"
elif [[ $version = 6.* ]]; then
if [[ $version = 6.* ]]; then
target_framework="net6.0"
elif [[ $version = 7.* ]]; then
target_framework="net7.0"
else
echo "BUILD FAILURE: .NET Core 3.1, .NET 5, .NET 6 SDK required to run build"
echo "BUILD FAILURE: .NET 6, .NET 7 SDK required to run build"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/environment-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ public static async Task use_environment_check()
.StartAsync();
}
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/CoreTests/Examples/EnvironmentChecks.cs#L13-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_use_environment_check_in_hosted_service' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/CoreTests/Examples/EnvironmentChecks.cs#L10-L30' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_use_environment_check_in_hosted_service' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
4 changes: 2 additions & 2 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ release in 2021 marks a massive overhaul of Marten's internals, and introduces n

## .NET Version Compatibility

Marten aligns with the [.NET Core Support Lifecycle](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) to determine platform compatibility.
Marten aligns with the [.NET Core Support Lifecycle](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) to determine platform compatibility. Marten targets `net6.0`, `net7.0`.

Marten v4 targets `netstandard2.0` & `net5.0` & `net6.0` and is compatible with `.NET Core 3.1` & `.NET 5+`. `.NET Core 2.1` may work but is out of support and thus untested.
.NET Core 3.1 and .NET 5 was dropped as part of v6 release. If you require .NET Framework support, please use the latest Marten v5 release.

.NET Framework support was dropped as part of the v4 release. If you require .NET Framework support, please use the latest Marten v3 release.

Expand Down
3 changes: 2 additions & 1 deletion documentation/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ Marten uses the [Npgsql](http://www.npgsql.org) library to access PostgreSQL fro

Marten aligns with the [.NET Core Support Lifecycle](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) to determine platform compatibility.

4.xx targets `netstandard2.0` & `net5.0` & `net6.0` and is compatible with `.NET Core 2.x`, `.NET Core 3.x` and `.NET 5+`.
6.xx targets `net6.0` and `net7.0`.

<[info]>
.NET Core 3.1 and .NET 5 support was dropped as part of the v6 release, if you require support, please use the latest Marten 5.xx release.
.NET Framework support was dropped as part of the v4 release, if you require .NET Framework support, please use the latest Marten 3.xx release.
<[/info]>

Expand Down
Loading

0 comments on commit a4b52b9

Please sign in to comment.