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

tst/documentation generation upgrade #12

Merged
merged 8 commits into from
Nov 16, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
dotnet-version: |
3.1.x
6.0.x
8.0.x

- name: Cleaning
run: dotnet clean
Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
global-json-file: global.json

- name: Cleaning
run: dotnet clean
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
dotnet-version: |
3.1.x
6.0.x
8.0.x

- name: Cleaning
run: dotnet clean
Expand Down Expand Up @@ -49,7 +50,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
global-json-file: global.json

- name: Cleaning
run: dotnet clean
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.401"
"version": "8.0.100"
}
}
}
7 changes: 5 additions & 2 deletions sdk/EAVFW.Extensions.Manifest.SDK.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>

Expand All @@ -20,7 +20,6 @@


<ItemGroup>

<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="DotNETDevOps.JsonFunctions" Version="3.0.26" />
</ItemGroup>
Expand All @@ -32,4 +31,8 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>

</Project>
21 changes: 11 additions & 10 deletions sdk/ManifestEnricher.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using DotNETDevOps.JsonFunctions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -48,7 +45,7 @@
{
this.parameterGenerator = parameterGenerator ?? throw new ArgumentNullException(nameof(parameterGenerator));
}
public async Task<string> CreateInitializationScript(JToken model, string systemUserEntity)

Check warning on line 48 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 48 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 48 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{

var sb = new StringBuilder();
Expand Down Expand Up @@ -137,7 +134,7 @@
{
return args.Select((o, i) => new { label = o, value = i + 1 }).ToArray();
}
private JObject CreateAttribute(JObject attr, string displayName, object type, string? schemaName = null, object? additionalProps = null)

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 137 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
if (additionalProps != null)
return Merge(Merge(attr, new { displayName, type, schemaName }), additionalProps);
Expand Down Expand Up @@ -650,10 +647,9 @@

foreach (var attr in (entityValue.SelectToken("$.attributes") as JObject)?.Properties() ?? Enumerable.Empty<JProperty>())
{
var attrValue = attr.Value as JObject;
var attrType = attrValue.SelectToken("$.type");

if(!(attr.Value is JObject attrValue)) continue;

var attrType = attrValue.SelectToken("$.type");

if (!ConvertToSchemaType(attrType, out var type)) continue;

Expand Down Expand Up @@ -722,7 +718,12 @@
}
}

var queue = new Queue<JObject?>(attributes.Properties().Select(c => c.Value as JObject));
var queue =
new Queue<JObject?>(

Check warning on line 722 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 722 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 722 in sdk/ManifestEnricher.cs

View workflow job for this annotation

GitHub Actions / Building

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
attributes.Properties()
.Select(c => c.Value as JObject)
.Where(x => x != null)
);

foreach (var attribute in attributes.Properties())
{
Expand Down Expand Up @@ -851,7 +852,7 @@

}

foreach (var attr in attributes.Properties())
foreach (var attr in attributes.Properties().Where(x => x.Value.Type == JTokenType.Object))
{
var attributeLocaleEnglish = new JObject(new JProperty("displayName", attr.Value["displayName"]));
var attributeLocale = attr.Value.SelectToken("$.locale") as JObject ?? SetDefault(attr.Value, attributeLocaleEnglish);
Expand All @@ -876,4 +877,4 @@
entity["collectionSchemaName"] = schemaName.ToSchemaName(entity["pluralName"]?.ToString());
}
}
}
}
8 changes: 7 additions & 1 deletion src/EAVFramework.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<PackageId>EAVFramework</PackageId>
<Authors>Poul Kjeldager</Authors>
<Company>EAVFW</Company>
Expand Down Expand Up @@ -35,11 +35,17 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.17" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.24" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.24" />
</ItemGroup>

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

<ItemGroup>
<ProjectReference Include="..\sdk\EAVFW.Extensions.Manifest.SDK.csproj" />
</ItemGroup>
Expand Down
Loading