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

[AOT] Trim compatibility for project WorkflowCore #1233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
120 changes: 120 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<!-- variables for managing package versions -->
<PropertyGroup>
<!-- Microsoft.EntityFrameworkCore.* -->
<EFCoreVersion Condition=" '$(TargetFramework)' == 'netstandard2.0' ">3.1.2</EFCoreVersion>
<EFCoreVersion Condition=" '$(TargetFramework)' == 'netstandard2.1' ">5.0.1</EFCoreVersion>
<EFCoreVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">3.1.2</EFCoreVersion>
<EFCoreVersion Condition=" '$(TargetFramework)' == 'net6.0' ">6.0.0</EFCoreVersion>
<EFCoreVersion Condition=" '$(TargetFramework)' == 'net8.0' ">8.0.0</EFCoreVersion>

<!-- Microsoft.Extensions.* -->
<MsExtsVersion Condition=" '$(TargetFramework)' == 'netstandard2.0' ">3.1.2</MsExtsVersion>
<MsExtsVersion Condition=" '$(TargetFramework)' == 'netstandard2.1' ">3.1.2</MsExtsVersion>
<MsExtsVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">3.1.2</MsExtsVersion>
<MsExtsVersion Condition=" '$(TargetFramework)' == 'net6.0' ">6.0.0</MsExtsVersion>
<MsExtsVersion Condition=" '$(TargetFramework)' == 'net8.0' ">8.0.0</MsExtsVersion>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="4.3.1" />
<PackageVersion Include="AWSSDK.DynamoDBv2" Version="3.7.3.11" />
<PackageVersion Include="AWSSDK.Kinesis" Version="3.7.1.32" />
<PackageVersion Include="AWSSDK.SQS" Version="3.7.2.33" />
<PackageVersion Include="coverlet.collector" Version="1.2.0" />
<PackageVersion Include="Docker.DotNet" Version="3.125.2" />
<PackageVersion Include="FakeItEasy" Version="8.1.0" />
<PackageVersion Include="FluentAssertions" Version="4.19.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="1.1.3" />
<PackageVersion Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.1" />
<PackageVersion Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.19.0" />
<PackageVersion Include="Microsoft.Azure.DocumentDB" Version="2.11.6" />
<PackageVersion Include="Microsoft.Azure.ServiceBus" Version="5.0.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(EFCoreVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="$(MsExtsVersion)" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.19.0" />
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="MySqlConnector" Version="2.3.5" />
<PackageVersion Include="NEST" Version="7.14.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="NUnit" Version="3.9.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageVersion Include="Polly" Version="7.2.1" />
<PackageVersion Include="RabbitMQ.Client" Version="4.1.3" />
<PackageVersion Include="RavenDB.Client" Version="5.1.2" />
<PackageVersion Include="RedLock.net" Version="2.2.0" />
<PackageVersion Include="SharpYaml" Version="1.6.5" />
<PackageVersion Include="StackExchange.Redis" Version="2.0.601" />
<PackageVersion Include="Squadron.Elasticsearch" Version="0.18.0" />
<PackageVersion Include="Squadron.Mongo" Version="0.18.0" />
<PackageVersion Include="Squadron.MySql" Version="0.18.0" />
<PackageVersion Include="Squadron.PostgreSql" Version="0.18.0" />
<PackageVersion Include="Squadron.Redis" Version="0.18.0" />
<PackageVersion Include="Squadron.SqlServer" Version="0.18.0" />
<PackageVersion Include="System.Data.Common" Version="4.3.0" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.5" />
<PackageVersion Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageVersion Include="System.Linq.Dynamic.Core" Version="1.3.0" />
<PackageVersion Include="System.Net.NetworkInformation" Version="4.3.0" />
<PackageVersion Include="WindowsAzure.Storage" Version="9.3.3" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.core" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
<PackageVersion Include="System.Text.Json" Version="6.0.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.7.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
<PackageVersion Include="System.Text.Json" Version="6.0.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.3.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.1" />
<PackageVersion Include="System.Text.Json" Version="6.0.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.7.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageVersion Include="System.Text.Json" Version="6.0.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.7.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
<PackageVersion Include="OpenTelemetry.Api" Version="1.7.0" />
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions WorkflowCore.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29509.3
# Visual Studio Version 17
VisualStudioVersion = 17.9.34518.117
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{EF47161E-E399-451C-BDE8-E92AAD3BD761}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F6AC9AEB-24EF-475A-B190-AA4D9E01270A}"
ProjectSection(SolutionItems) = preProject
Directory.Packages.props = Directory.Packages.props
README.md = README.md
EndProjectSection
EndProject
Expand Down
10 changes: 5 additions & 5 deletions src/WorkflowCore.DSL/WorkflowCore.DSL.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<Description>DSL extenstion for Workflow Core provding support for JSON and YAML workflow definitions.</Description>
<Authors>Daniel Gerlag</Authors>
<Company />
<Product>WorkflowCore</Product>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SharpYaml" Version="1.6.5" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.0" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="SharpYaml" />
<PackageReference Include="System.Linq.Dynamic.Core" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions src/WorkflowCore.Testing/WorkflowCore.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<Version>3.5.2</Version>
<AssemblyVersion>3.5.2.0</AssemblyVersion>
<FileVersion>3.5.2.0</FileVersion>
<Description>Facilitates testing of workflows built on Workflow-Core</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 12 additions & 1 deletion src/WorkflowCore/Interface/IContainerStepBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
using System;
#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif

namespace WorkflowCore.Interface
{
public interface IContainerStepBuilder<TData, TStepBody, TReturnStep>
public interface IContainerStepBuilder<TData,
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStepBody,
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TReturnStep>
where TStepBody : IStepBody
where TReturnStep : IStepBody
{
Expand Down
9 changes: 8 additions & 1 deletion src/WorkflowCore/Interface/IParallelStepBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
using System;
#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using WorkflowCore.Primitives;

namespace WorkflowCore.Interface
{
public interface IParallelStepBuilder<TData, TStepBody>
public interface IParallelStepBuilder<TData,
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStepBody>
where TStepBody : IStepBody
{
IParallelStepBuilder<TData, TStepBody> Do(Action<IWorkflowBuilder<TData>> builder);
Expand Down
4 changes: 2 additions & 2 deletions src/WorkflowCore/Interface/IStepBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace WorkflowCore.Interface
{
public interface IStepBody
{
Task<ExecutionResult> RunAsync(IStepExecutionContext context);
{
Task<ExecutionResult> RunAsync(IStepExecutionContext context);
}
}
36 changes: 29 additions & 7 deletions src/WorkflowCore/Interface/IStepBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
using System;
#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using System.Linq.Expressions;
using WorkflowCore.Models;

namespace WorkflowCore.Interface
{
public interface IStepBuilder<TData, TStepBody> : IWorkflowModifier<TData, TStepBody>
public interface IStepBuilder<TData,
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStepBody> : IWorkflowModifier<TData, TStepBody>
where TStepBody : IStepBody
{

IWorkflowBuilder<TData> WorkflowBuilder { get; }
IWorkflowBuilder<TData> WorkflowBuilder { get; }

WorkflowStep<TStepBody> Step { get; set; }

Expand Down Expand Up @@ -46,14 +52,22 @@ public interface IStepBuilder<TData, TStepBody> : IWorkflowModifier<TData, TStep
/// </summary>
/// <param name="outcomeValue"></param>
/// <returns></returns>
IStepBuilder<TData, TStepBody> Branch<TStep>(object outcomeValue, IStepBuilder<TData, TStep> branch) where TStep : IStepBody;
IStepBuilder<TData, TStepBody> Branch<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(object outcomeValue, IStepBuilder<TData, TStep> branch) where TStep : IStepBody;

/// <summary>
/// Configure an outcome branch for this step, then wire it to another step
/// </summary>
/// <param name="outcomeExpression"></param>
/// <returns></returns>
IStepBuilder<TData, TStepBody> Branch<TStep>(Expression<Func<TData, object, bool>> outcomeExpression, IStepBuilder<TData, TStep> branch) where TStep : IStepBody;
IStepBuilder<TData, TStepBody> Branch<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(Expression<Func<TData, object, bool>> outcomeExpression, IStepBuilder<TData, TStep> branch) where TStep : IStepBody;

/// <summary>
/// Map properties on the step to properties on the workflow data object before the step executes
Expand Down Expand Up @@ -97,7 +111,11 @@ public interface IStepBuilder<TData, TStepBody> : IWorkflowModifier<TData, TStep
/// <returns></returns>
IStepBuilder<TData, TStepBody> Output(Action<TStepBody, TData> action);

IStepBuilder<TData, TStep> End<TStep>(string name) where TStep : IStepBody;
IStepBuilder<TData, TStep> End<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(string name) where TStep : IStepBody;

/// <summary>
/// Configure the behavior when this step throws an unhandled exception
Expand All @@ -119,7 +137,11 @@ public interface IStepBuilder<TData, TStepBody> : IWorkflowModifier<TData, TStep
/// <typeparam name="TStep">The type of the step to execute</typeparam>
/// <param name="stepSetup">Configure additional parameters for this step</param>
/// <returns></returns>
IStepBuilder<TData, TStepBody> CompensateWith<TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;
IStepBuilder<TData, TStepBody> CompensateWith<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;

/// <summary>
/// Undo step if unhandled exception is thrown by this step
Expand Down
17 changes: 14 additions & 3 deletions src/WorkflowCore/Interface/IStepOutcomeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
using System;
#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using WorkflowCore.Models;
using WorkflowCore.Primitives;

namespace WorkflowCore.Interface
{
{
public interface IStepOutcomeBuilder<TData>
{
IWorkflowBuilder<TData> WorkflowBuilder { get; }

ValueOutcome Outcome { get; }

IStepBuilder<TData, TStep> Then<TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;
IStepBuilder<TData, TStep> Then<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;

IStepBuilder<TData, TStep> Then<TStep>(IStepBuilder<TData, TStep> step) where TStep : IStepBody;
IStepBuilder<TData, TStep> Then<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(IStepBuilder<TData, TStep> step) where TStep : IStepBody;

IStepBuilder<TData, InlineStepBody> Then(Func<IStepExecutionContext, ExecutionResult> body);

Expand Down
15 changes: 13 additions & 2 deletions src/WorkflowCore/Interface/IWorkflowBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
#if NET8_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using System.Collections.Generic;
using WorkflowCore.Models;
using WorkflowCore.Primitives;
Expand All @@ -11,7 +14,11 @@ public interface IWorkflowBuilder

int LastStep { get; }

IWorkflowBuilder<T> UseData<T>();
IWorkflowBuilder<T> UseData<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
T>();

WorkflowDefinition Build(string id, int version);

Expand All @@ -22,7 +29,11 @@ public interface IWorkflowBuilder

public interface IWorkflowBuilder<TData> : IWorkflowBuilder, IWorkflowModifier<TData, InlineStepBody>
{
IStepBuilder<TData, TStep> StartWith<TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;
IStepBuilder<TData, TStep> StartWith<
#if NET8_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
#endif
TStep>(Action<IStepBuilder<TData, TStep>> stepSetup = null) where TStep : IStepBody;

IStepBuilder<TData, InlineStepBody> StartWith(Func<IStepExecutionContext, ExecutionResult> body);

Expand Down
Loading