Skip to content

Commit

Permalink
Merge pull request #898 from EdwardCooke/ec-removeoldframeworks
Browse files Browse the repository at this point in the history
Breaking: Removes old frameworks, .net35, .net45

+semver:breaking
  • Loading branch information
EdwardCooke committed Jan 22, 2024
2 parents 88a9189 + 8e75e9e commit 04a9dbb
Show file tree
Hide file tree
Showing 44 changed files with 76 additions and 1,174 deletions.
1 change: 0 additions & 1 deletion BuildUtils.UnityPrerequisites
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ on the build variables.

Some platforms - such as IOS - forbid dynamic code generation. This prevents Just-in-Time compilation (JIT) from being used. In those cases, one can use Mono's Ahead-of-Time compilation (AOT). This results on a precompiled assembly that does not rely on JIT. There are [some limitations](http://www.mono-project.com/docs/advanced/aot/#limitation-generic-interface-instantiation) however, most of them are related to usage of generics.

In order to ensure that YamlDotNet is compatible with AOT compilation, an automatic test has been created that runs on every commit. That test exercises the serializer and deserializer to help identify AOT-related problems.
You can use the StaticSerializerBuilder and StaticDeserializerBuilder to accomplish this.

## Coding style

Expand Down
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod
RUN dpkg -i packages-microsoft-prod.deb
RUN apt update
RUN apt install -y dotnet-sdk-6.0
RUN apt install -y dotnet-sdk-7.0

FROM builder AS build
WORKDIR /src
ARG PACKAGE_VERSION=1.0.0

COPY YamlDotNet.sln YamlDotNet.sln
COPY YamlDotNet/YamlDotNet.csproj YamlDotNet/YamlDotNet.csproj
COPY YamlDotNet.AotTest/YamlDotNet.AotTest.csproj YamlDotNet.AotTest/YamlDotNet.AotTest.csproj
COPY YamlDotNet.Benchmark/YamlDotNet.Benchmark.csproj YamlDotNet.Benchmark/YamlDotNet.Benchmark.csproj
COPY YamlDotNet.Samples/YamlDotNet.Samples.csproj YamlDotNet.Samples/YamlDotNet.Samples.csproj
COPY YamlDotNet.Test/YamlDotNet.Test.csproj YamlDotNet.Test/YamlDotNet.Test.csproj
Expand All @@ -37,9 +37,6 @@ RUN dotnet restore YamlDotNet.sln

COPY . .

RUN dotnet build -c Release --framework net35 YamlDotNet/YamlDotNet.csproj -o /output/net35
RUN dotnet build -c Release --framework net40 YamlDotNet/YamlDotNet.csproj -o /output/net40
RUN dotnet build -c Release --framework net45 YamlDotNet/YamlDotNet.csproj -o /output/net45
RUN dotnet build -c Release --framework net47 YamlDotNet/YamlDotNet.csproj -o /output/net47
RUN dotnet build -c Release --framework netstandard2.0 YamlDotNet/YamlDotNet.csproj -o /output/netstandard2.0
RUN dotnet build -c Release --framework netstandard2.1 YamlDotNet/YamlDotNet.csproj -o /output/netstandard2.1
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile.NonEnglish
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod
RUN dpkg -i packages-microsoft-prod.deb
RUN apt update
RUN apt install -y dotnet-sdk-6.0
RUN apt install -y dotnet-sdk-7.0


FROM builder AS build
Expand All @@ -26,22 +27,18 @@ ARG PACKAGE_VERSION=1.0.0

COPY YamlDotNet.sln YamlDotNet.sln
COPY YamlDotNet/YamlDotNet.csproj YamlDotNet/YamlDotNet.csproj
COPY YamlDotNet.AotTest/YamlDotNet.AotTest.csproj YamlDotNet.AotTest/YamlDotNet.AotTest.csproj
COPY YamlDotNet.Benchmark/YamlDotNet.Benchmark.csproj YamlDotNet.Benchmark/YamlDotNet.Benchmark.csproj
COPY YamlDotNet.Samples/YamlDotNet.Samples.csproj YamlDotNet.Samples/YamlDotNet.Samples.csproj
COPY YamlDotNet.Test/YamlDotNet.Test.csproj YamlDotNet.Test/YamlDotNet.Test.csproj
COPY YamlDotNet.Analyzers.StaticGenerator/YamlDotNet.Analyzers.StaticGenerator.csproj YamlDotNet.Analyzers.StaticGenerator/YamlDotNet.Analyzers.StaticGenerator.csproj
COPY YamlDotNet.Core7AoTCompileTest/YamlDotNet.Core7AoTCompileTest.csproj YamlDotNet.Core7AoTCompileTest/YamlDotNet.Core7AoTCompileTest.csproj
COPY YamlDotNet.Core7AoTCompileTest.Model/YamlDotNet.Core7AoTCompileTest.Model.csproj YamlDotNet.Core7AoTCompileTest.Model/YamlDotNet.Core7AoTCompileTest.Model.csproj
COPY YamlDotNet.Samples.Fsharp/YamlDotNet.Samples.Fsharp.csproj YamlDotNet.Samples.Fsharp/YamlDotNet.Samples.Fsharp.csproj
COPY YamlDotNet.Samples.Fsharp/YamlDotNet.Samples.Fsharp.fsproj YamlDotNet.Samples.Fsharp/YamlDotNet.Samples.Fsharp.fsproj

RUN dotnet restore YamlDotNet.sln

COPY . .

RUN dotnet build -c Release --framework net35 YamlDotNet/YamlDotNet.csproj -o /output/net35
RUN dotnet build -c Release --framework net40 YamlDotNet/YamlDotNet.csproj -o /output/net40
RUN dotnet build -c Release --framework net45 YamlDotNet/YamlDotNet.csproj -o /output/net45
RUN dotnet build -c Release --framework net47 YamlDotNet/YamlDotNet.csproj -o /output/net47
RUN dotnet build -c Release --framework netstandard2.0 YamlDotNet/YamlDotNet.csproj -o /output/netstandard2.0
RUN dotnet build -c Release --framework netstandard2.1 YamlDotNet/YamlDotNet.csproj -o /output/netstandard2.1
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ The library has now been successfully used in multiple projects and is considere
* .NET 6.0
* .NET 7.0
* .NET Framework 4.7
* .NET Framework 4.5
* Unity Subset v3.5

The following runtimes are also supported, with a few features missing:

* .NET Framework 3.5

The library is compatible with mono's [Ahead-of-Time compilation](https://www.mono-project.com/docs/advanced/aot/) (AOT), and should work correctly on platforms that depend on it, such as Unity.

## Quick start

Expand Down
6 changes: 0 additions & 6 deletions YamlDotNet.AotTest/App.config

This file was deleted.

130 changes: 0 additions & 130 deletions YamlDotNet.AotTest/Program.cs

This file was deleted.

34 changes: 0 additions & 34 deletions YamlDotNet.AotTest/YamlDotNet.AotTest.csproj

This file was deleted.

7 changes: 0 additions & 7 deletions YamlDotNet.AotTest/run.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<Import Project="../build/common.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<Import Project="../build/common.props" />

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-AOT|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 0 additions & 2 deletions YamlDotNet.Test/YamlDotNet.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>

<Import Project="../build/common.props" />

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
Expand Down
12 changes: 3 additions & 9 deletions YamlDotNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Samples", "YamlD
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Test", "YamlDotNet.Test\YamlDotNet.Test.csproj", "{A9F67018-0240-4D16-A4EA-BCB780D0AF05}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.AotTest", "YamlDotNet.AotTest\YamlDotNet.AotTest.csproj", "{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EB11D2D9-6E3D-45BF-8BCD-A04BCB1F8020}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Expand All @@ -27,11 +25,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Benchmark", "Yam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Analyzers.StaticGenerator", "YamlDotNet.Analyzers.StaticGenerator\YamlDotNet.Analyzers.StaticGenerator.csproj", "{42DE4D20-AEF7-4235-9CB2-1ED0150B3D1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.Core7AoTCompileTest", "YamlDotNet.Core7AoTCompileTest\YamlDotNet.Core7AoTCompileTest.csproj", "{DEB5099E-D216-438B-86A7-03674F9185EF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Core7AoTCompileTest", "YamlDotNet.Core7AoTCompileTest\YamlDotNet.Core7AoTCompileTest.csproj", "{DEB5099E-D216-438B-86A7-03674F9185EF}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "YamlDotNet.Samples.Fsharp", "YamlDotNet.Samples.Fsharp\YamlDotNet.Samples.Fsharp.fsproj", "{C047392D-6B20-47CD-9FE6-D0FA326FD262}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "YamlDotNet.Samples.Fsharp", "YamlDotNet.Samples.Fsharp\YamlDotNet.Samples.Fsharp.fsproj", "{C047392D-6B20-47CD-9FE6-D0FA326FD262}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet.Core7AoTCompileTest.Model", "YamlDotNet.Core7AoTCompileTest.Model\YamlDotNet.Core7AoTCompileTest.Model.csproj", "{BFE15564-7C2C-47DA-8302-9BCB39B6864B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YamlDotNet.Core7AoTCompileTest.Model", "YamlDotNet.Core7AoTCompileTest.Model\YamlDotNet.Core7AoTCompileTest.Model.csproj", "{BFE15564-7C2C-47DA-8302-9BCB39B6864B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -51,10 +49,6 @@ Global
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release|Any CPU.Build.0 = Release|Any CPU
{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF989FD9-3A2C-4807-A5D3-A8E755CA6648}.Release|Any CPU.Build.0 = Release|Any CPU
{52D1E5F3-8337-48FC-AED5-968B51C7DAEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{52D1E5F3-8337-48FC-AED5-968B51C7DAEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{52D1E5F3-8337-48FC-AED5-968B51C7DAEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ public CultureInfoAdapter(CultureInfo baseCulture, IFormatProvider provider)
this.provider = provider;
}

public override object GetFormat(Type formatType)
#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER
public override object GetFormat(Type? formatType)
#else
public override object? GetFormat(Type formatType)
#endif
{
return provider.GetFormat(formatType);
return provider.GetFormat(formatType)!;
}
}
}

This file was deleted.

Loading

0 comments on commit 04a9dbb

Please sign in to comment.