Skip to content

Commit

Permalink
feat: support net8.0 (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 authored Sep 21, 2023
1 parent 20527c5 commit e1ef02d
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Suppress: EC112

[*.{vue,ts,js,scss,html,csproj,md}]
[*.{vue,ts,js,scss,html,csproj,md,props}]
indent_style = space
indent_size = 2

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/part-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
2.2.x
6.0.x
7.0.x
8.0.x
include-prerelease: true

- run: npm ci
working-directory: src/coalesce-vue
Expand Down Expand Up @@ -133,6 +135,8 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
include-prerelease: true

- run: npm ci
- run: npx gulp coalesce
Expand All @@ -156,6 +160,8 @@ jobs:
dotnet-version: |
6.0.x
7.0.x
8.0.x
include-prerelease: true

- run: npm ci
working-directory: src/coalesce-vue
Expand All @@ -180,7 +186,9 @@ jobs:
- run: npm i -g npm@9.5.0 # Pin NPM to avoid breaking changes like https://github.com/nodejs/node/issues/46542
- uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
dotnet-version: |
8.0.x
include-prerelease: true

- run: npm ci
working-directory: src/coalesce-vue
Expand Down
4 changes: 2 additions & 2 deletions coalesce-vue3.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"webProject": {
"projectFile": "./playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj",
"framework": "net7.0"
"framework": "net8.0"
},
"dataProject": {
"projectFile": "./playground/Coalesce.Domain/Coalesce.Domain.csproj",
"framework": "net7.0"
"framework": "net8.0"
},
//"rootTypesWhitelist": [
// "CaseDto"
Expand Down
2 changes: 2 additions & 0 deletions playground/Coalesce.Domain/Case.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ public override IQueryable<Case> GetQuery(IDataSourceParameters parameters) => D
[Coalesce]
public static CaseSummary GetCaseSummary(AppDbContext db)
{
int[] a = [1, 2, 3, 4, 5, 6, 7, 8];

return CaseSummary.GetCaseSummary(db);
}
}
Expand Down
8 changes: 7 additions & 1 deletion playground/Coalesce.Domain/Coalesce.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
dotnet ef database update - -framework netcoreapp2.1
(no space between the dashes; space is there because double dash is illegal in XML comments).
-->
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -32,6 +32,12 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.*-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.*-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.*-*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GenFu" Version="1.4.22" />
<PackageReference Include="Bogus" Version="34.0.2" />
Expand Down
1 change: 0 additions & 1 deletion playground/Coalesce.Domain/MyDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Linq.Dynamic.Core;
using IntelliTect.Coalesce.Models;
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
Expand Down
3 changes: 1 addition & 2 deletions playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

<Nullable>enable</Nullable>
<LangVersion>11.0</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion playground/Coalesce.Web.Vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dev": "vite",
"lint:fix": "eslint src --fix",
"test": "vitest",
"coalesce": "dotnet run --project ../../src/IntelliTect.Coalesce.DotnetTool --framework net7.0 -- ../../coalesce-vue3.json"
"coalesce": "dotnet run --project ../../src/IntelliTect.Coalesce.DotnetTool --framework net8.0 -- ../../coalesce-vue3.json"
},
"dependencies": {
"@fortawesome/fontawesome-free": "5.15.4",
Expand Down
2 changes: 1 addition & 1 deletion playground/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
</PropertyGroup>
Expand Down
17 changes: 14 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Product>Coalesce Web Framework</Product>
<Copyright>Copyright IntelliTect © 2020, All Rights Reserved.</Copyright>
<DefaultLanguage>en-US</DefaultLanguage>

<!-- CS1591: Missing XML comment for publicly visible type or member -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -21,7 +21,7 @@
<RepositoryUrl>https://github.com/IntelliTect/Coalesce</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>

Expand All @@ -34,10 +34,20 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<DotNetPackageVersionSpec>6.0.*</DotNetPackageVersionSpec>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<DotNetPackageVersionSpec>7.0.*</DotNetPackageVersionSpec>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<DotNetPackageVersionSpec>8.0.*-*</DotNetPackageVersionSpec>
</PropertyGroup>

<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/../"/>
</ItemGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
Expand All @@ -64,4 +74,5 @@
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

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

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public async Task VueOutputCompiles()
await Task.WhenAll(
Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "4.9")),
Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "5")),
Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "5.2")),
Task.Run(() => AssertSuiteCSharpOutputCompiles(suite))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,28 @@
-->

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net6.0;net7.0;net8.0</TargetFrameworks>

<!--
Suppress warnings about 2.1 being abandoned.
This was the last version to officially support DotNetCliToolReference,
so we keep building for this target framework because it doesn't require
hacky workarounds (<DotnetCliToolTargetFramework>) in the consuming project.
-->
<CheckEolTargetFramework Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">false</CheckEolTargetFramework>
so we keep building for this target framework because it doesn't require
hacky workarounds (<DotnetCliToolTargetFramework>) in the consuming project.
-->
<CheckEolTargetFramework Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">false</CheckEolTargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>

<AssemblyName>dotnet-coalesce</AssemblyName>
<PackageId>IntelliTect.Coalesce.Tools</PackageId>
<PackageType>DotnetCliTool</PackageType>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<!-- Supress vulnerability warnings about .NET Core 2.1 -->
<PackageReference Update="Microsoft.NETCore.App" NoWarn="NU1902;NU1903" />
</ItemGroup>

<ItemGroup>
<Compile Include="../IntelliTect.Coalesce.DotnetTool/*.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create
-->
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>

<PackAsTool>true</PackAsTool>
<ToolCommandName>coalesce</ToolCommandName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>

Expand All @@ -12,13 +12,6 @@
<ProjectReference Include="..\IntelliTect.Coalesce.Swashbuckle\IntelliTect.Coalesce.Swashbuckle.csproj" />
<ProjectReference Include="..\IntelliTect.Coalesce.CodeGeneration.Tests\IntelliTect.Coalesce.CodeGeneration.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.4.0" />
Expand All @@ -30,6 +23,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(DotNetPackageVersionSpec)" />
</ItemGroup>

</Project>
14 changes: 4 additions & 10 deletions src/IntelliTect.Coalesce.Tests/IntelliTect.Coalesce.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -10,16 +10,10 @@
<ProjectReference Include="..\IntelliTect.Coalesce\IntelliTect.Coalesce.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(DotNetPackageVersionSpec)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(DotNetPackageVersionSpec)" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Text;
using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
11 changes: 1 addition & 10 deletions src/IntelliTect.Coalesce.Vue/DevMiddleware/NodeScriptRunner.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.NodeServices.Npm;
using Microsoft.AspNetCore.NodeServices.Util;
using Microsoft.AspNetCore.SpaServices.Extensions.Util;
using Microsoft.AspNetCore.SpaServices.Util;
using Microsoft.Extensions.Logging;


namespace IntelliTect.Coalesce.Vue.DevMiddleware
{
Expand Down
11 changes: 3 additions & 8 deletions src/IntelliTect.Coalesce.Vue/IntelliTect.Coalesce.Vue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

<PropertyGroup>
<Description>Vue.js shared code for server projects for IntelliTect.Coalesce</Description>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>10.0</LangVersion>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IntelliTect.Coalesce\IntelliTect.Coalesce.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.*" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="7.0.*" />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="$(DotNetPackageVersionSpec)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Linq;
using System.Linq.Dynamic.Core;
using IntelliTect.Coalesce.Models;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down
2 changes: 0 additions & 2 deletions src/IntelliTect.Coalesce/Api/Controllers/BaseApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Net;
using System.Threading.Tasks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using IntelliTect.Coalesce.TypeDefinition;
using Microsoft.EntityFrameworkCore.Query.Internal;
using IntelliTect.Coalesce.Mapping.IncludeTrees;
using IntelliTect.Coalesce.Mapping;
using IntelliTect.Coalesce.Api;
using IntelliTect.Coalesce.Utilities;
using System.Collections.ObjectModel;
using IntelliTect.Coalesce.Api.DataSources;
using System.Threading;
using System.Threading.Tasks;

namespace IntelliTect.Coalesce
{
Expand Down
Loading

0 comments on commit e1ef02d

Please sign in to comment.