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

Added support for .Net 9 #135

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .Net 8.0.*
- name: Setup .Net 8.0.403
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
dotnet-version: 8.0.403
- name: Setup .Net 9.0.100-rc.2.24474.11
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100-rc.2.24474.11
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .Net 8.0.*
- name: Setup .Net 8.0.403
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
dotnet-version: 8.0.403
- name: Setup .Net 9.0.100-rc.2.24474.11
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100-rc.2.24474.11
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .Net 8.0.*
- name: Setup .Net 8.0.403
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
dotnet-version: 8.0.403
- name: Setup .Net 9.0.100-rc.2.24474.11
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100-rc.2.24474.11
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .Net 8.0.*
- name: Setup .Net 8.0.403
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
dotnet-version: 8.0.403
- name: Setup .Net 9.0.100-rc.2.24474.11
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100-rc.2.24474.11
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.TAG_VERSION_TOKEN }}
- name: Setup .Net 8.0.*
- name: Setup .Net 8.0.403
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
dotnet-version: 8.0.403
- name: Setup .Net 9.0.100-rc.2.24474.11
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100-rc.2.24474.11
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
Expand Down
5 changes: 4 additions & 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>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>disable</Nullable>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
Expand All @@ -19,6 +19,9 @@
<!-- Fix for https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMFORMATSASN1-7443633 - begin -->
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
<!-- Fix for https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMFORMATSASN1-7443633 - end -->
<!-- Fix for "System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed" - begin -->
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.0-rc.2.24473.5" />
<!-- Fix for "System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed" - end -->
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/DryGen/GithubActions/BaseGitHubActionsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyC
{
var job = base.GetJobs(image, relevantTargets);
var newSteps = new List<GitHubActionsStep>(job.Steps);
foreach (var version in new[] { "8.0.*" })
foreach (var version in new[] {"9.0.100-rc.2.24474.11", "8.0.403" })
{
newSteps.Insert(1, new SetupDotNetStep(version));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Improvements in this version
## Prerelease 2
- Added support for .Net 9
- Added support for generating many to many associations in `mermaid-class-diagram-from-csharp`.
- Added support for generating many to many relations in `mermaid-er-diagram-from-csharp`.
- Added support for `include-exception-stacktrace` in `verbs-from-options-file`.
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.403",
"version": "9.0.100-rc.2.24474.11",
"rollForward": "feature"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 8 additions & 2 deletions src/DryGen.CodeCompiler/DryGen.CodeCompiler.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.final" />
<!-- Fix for "error NU1903: Warning As Error: Package 'System.Net.Http' 4.3.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-7jgj-8wvc-jh57 " begin -->
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<!-- Fix for "error NU1903: Warning As Error: Package 'System.Net.Http' 4.3.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-7jgj-8wvc-jh57 " end -->
<!-- Fix for "error NU1903: Warning As Error: Package 'System.Text.RegularExpressions' 4.3.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-cmhx-cq75-c4mj " begin -->
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<!-- Fix for "error NU1903: Warning As Error: Package 'System.Text.RegularExpressions' 4.3.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-cmhx-cq75-c4mj " end -->
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/DryGen.Core/DryGen.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/DryGen.Templates/DryGen.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageType>Template</PackageType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<PackageId>dry-gen.templates</PackageId>
<Title>DryGen Templates</Title>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down Expand Up @@ -30,16 +30,16 @@
-->
<Target Name="BuildTemplates" BeforeTargets="Build">
<Message Text="Building template DryGen.Templates.JsonSchema" Importance="High" />
<Exec Command="dotnet build ./templates/DryGen.Templates.JsonSchema/ --configuration $(Configuration)" />
<Exec Command="dotnet build ./templates/DryGen.Templates.JsonSchema/ --configuration $(Configuration) --framework net9.0" Condition="'$(TargetFramework)' == 'net9.0'"/>
<Message Text="Building template DryGen.Templates.Mermaid" Importance="High" />
<Exec Command="dotnet build ./templates/DryGen.Templates.Mermaid/ --configuration $(Configuration)" />
<Exec Command="dotnet build ./templates/DryGen.Templates.Mermaid/ --configuration $(Configuration) --framework net9.0" Condition="'$(TargetFramework)' == 'net9.0'"/>
</Target>

<Target Name="CleanTemplates" AfterTargets="Clean">
<Message Text="Cleaning template DryGen.Templates.JsonSchema" Importance="High" />
<Exec Command="dotnet clean ./templates/DryGen.Templates.JsonSchema/ --configuration $(Configuration)" />
<Exec Command="dotnet clean ./templates/DryGen.Templates.JsonSchema/ --configuration $(Configuration) --framework net9.0" Condition="'$(TargetFramework)' == 'net9.0'"/>
<Message Text="Cleaning template DryGen.Templates.Mermaid" Importance="High" />
<Exec Command="dotnet clean ./templates/DryGen.Templates.Mermaid/ --configuration $(Configuration)" />
<Exec Command="dotnet clean ./templates/DryGen.Templates.Mermaid/ --configuration $(Configuration) --framework net9.0" Condition="'$(TargetFramework)' == 'net9.0'"/>
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@
"name": "dry-gen: Generate C# code from json schema before build",
"shortName": "dry-gen.jsonschema",
"sourceName": "DryGen.Templates.JsonSchema",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
}
},
"symbols": {
"framework": {
"type": "parameter",
"datatype": "choice",
"defaultValue": "net9.0",
"choices": [
{
"choice": "net8.0",
"description": "Target .Net 8"
},
{
"choice": "net9.0",
"description": "Target .Net 9"
}
],
"replaces": "net8.0;net9.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Eirik Bjornset",
"classifications": [ "dry-gen", "mermaid" ],
"identity": "DryGen.Mermaid",
"name": "dry-gen: Generate Mermaid diagrams after build",
"shortName": "dry-gen.mermaid",
"sourceName": "DryGen.Templates.Mermaid",
"tags": {
"language": "C#",
"type": "project"
}
}
"$schema": "http://json.schemastore.org/template",
"author": "Eirik Bjornset",
"classifications": ["dry-gen", "mermaid"],
"identity": "DryGen.Mermaid",
"name": "dry-gen: Generate Mermaid diagrams after build",
"shortName": "dry-gen.mermaid",
"sourceName": "DryGen.Templates.Mermaid",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
},
"symbols": {
"framework": {
"type": "parameter",
"datatype": "choice",
"defaultValue": "net9.0",
"choices": [
{
"choice": "net8.0",
"description": "Target .Net 8"
},
{
"choice": "net9.0",
"description": "Target .Net 9"
}
],
"replaces": "net8.0;net9.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<!--
Expand All @@ -18,14 +18,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[8.*,9.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="[8.*,9.0)">
<!--
dry-gen needs the InMemory database to be able to introspect the datamodel in the DbContexts.
The InMemory database is normally not used at runtime, so it can be referenced as private assets.
-->
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[8.*,9.0)" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="[8.*,9.0)" Condition="'$(TargetFramework)' == 'net8.0'" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[9.0.0-rc.*,10.0)" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="[9.0.0-rc.*,10.0)" Condition="'$(TargetFramework)' == 'net9.0'" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<PackageReference Include="FluentAssertions" Version="6.12.1" />
</ItemGroup>

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

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>false</ImplicitUsings>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dry-gen</ToolCommandName>
Expand Down
5 changes: 3 additions & 2 deletions src/develop/DryGen.DevUtils/DryGen.DevUtils.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Packable>false</Packable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[8.*,9.0)" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="[8.*,9.0)" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="[9.0.0-rc.*,10.0)" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="[9.0.0-rc.*,10.0)" Condition="'$(TargetFramework)' == 'net9.0'" /> <PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Reqnroll.xUnit" Version="2.1.1" />
<!-- Fix for https://security.snyk.io/vuln/SNYK-DOTNET-SYSTEMTEXTJSON-8168848 - begin -->
Expand Down
2 changes: 1 addition & 1 deletion src/develop/DryGen.Docs/DryGen.Docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Nullable>disable</Nullable>
</PropertyGroup>

Expand Down
Loading