Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #79 and #82 #81

Merged
merged 12 commits into from
Feb 1, 2024
Prev Previous commit
Next Next commit
Target .NET 6 & 8; Test net48, 6, and 8. Test ubuntu
  • Loading branch information
lilith committed Feb 1, 2024
commit 012208e4725a62b955fe9e1cbd69b232366decb9
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: [windows-latest, ubuntu-latest]

steps:
- name: Checkout
Expand All @@ -20,10 +20,12 @@ jobs:
submodules: true
fetch-depth: 0

- name: Install .NET 7.0
uses: actions/setup-dotnet@v3
- name: Install .NET 6 & 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: |
6
8.

- name: Build, Test, Pack, Publish
shell: bash
Expand Down
11 changes: 10 additions & 1 deletion src/Tomlyn.Tests/AssertHelper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Alexandre Mutel. All rights reserved.
// Licensed under the BSD-Clause 2 license.
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.

using System;
Expand Down Expand Up @@ -27,5 +27,14 @@ public static string NormalizeEndOfLine(string text)
{
return text.Replace("\r\n", "\n");
}

#if NET5_0_OR_GREATER
#else
xoofx marked this conversation as resolved.
Show resolved Hide resolved
public static string ReplaceLineEndings(this string text, string? newLine = null)
{
newLine ??= Environment.NewLine;
return text.Replace("\r\n", "\n").Replace("\n", newLine);
}
#endif
}
}
14 changes: 13 additions & 1 deletion src/Tomlyn.Tests/Tomlyn.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net6.0;net8.0;net48</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
<PackageReference Include="Portable.System.DateTimeOnly" Version="8.0.0" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" Condition="'$(TargetFramework)' == 'net48'" />
<PackageReference Include="PolySharp" Version="1.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Tomlyn/Tomlyn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Import Project="Tomlyn.props" />
<PropertyGroup>
<PackageId>Tomlyn</PackageId>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Folder Include="Compatibility\" />
Expand Down
2 changes: 1 addition & 1 deletion src/Tomlyn/Tomlyn.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>

<LangVersion>latest</LangVersion>
<Description>Tomlyn is a TOML parser, validator and authoring library for .NET.</Description>
<Copyright>Alexandre Mutel</Copyright>
Expand Down
10 changes: 5 additions & 5 deletions src/global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "7.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
}
"sdk": {
"version": "8.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}
Loading