Skip to content

Commit

Permalink
upgraded dat target framework to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janzenisek committed Feb 1, 2024
1 parent 21ba80a commit 23a60ca
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 146 deletions.
4 changes: 2 additions & 2 deletions src/Communication/Communication.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
Expand All @@ -23,7 +23,7 @@

<ItemGroup>
<ProjectReference Include="..\Configuration\Configuration.csproj" PrivateAssets="All" />
<ProjectReference Include="..\Utils\Utils.csproj" PrivateAssets="All" />
<ProjectReference Include="..\Utils\Utils.csproj" PrivateAssets="All" />
</ItemGroup>

</Project>
12 changes: 0 additions & 12 deletions src/Communication/Properties/launchSettings.json

This file was deleted.

7 changes: 1 addition & 6 deletions src/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>0.3.4</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="YamlDotNet" Version="13.1.1" />
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Configurations/BrokerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BrokerConfiguration : IConfiguration {
public string BaseTopic { get; set; }
public string PayloadType { get; set; }

public RoutingTable Routing { get; set; }
//public RoutingTable Routing { get; set; }

public BrokerConfiguration() {

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable property 'Type' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable property 'Url' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable event 'ConfigurationChanged' must contain a non-null value when exiting constructor. Consider declaring the event as nullable.

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable property 'Name' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable property 'Id' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in src/Configuration/Configurations/BrokerConfiguration.cs

View workflow job for this annotation

GitHub Actions / Build, Test and (Publish if not pull request) 7.0.x

Non-nullable property 'Address' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Expand Down Expand Up @@ -53,7 +53,7 @@ public object Clone() {
c.BaseTopic = BaseTopic;
c.PayloadType = PayloadType;

c.Routing = (RoutingTable)Routing.Clone();
//c.Routing = (RoutingTable)Routing.Clone();

return c;
}
Expand Down
9 changes: 2 additions & 7 deletions src/Configuration/Configurations/SocketConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using Ai.Hgb.Dat.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ai.Hgb.Dat.Configuration {
public class SocketConfiguration : IConfiguration {
Expand Down Expand Up @@ -33,7 +28,7 @@ public class SocketConfiguration : IConfiguration {

public RequestOptions DefaultRequestOptions { get; set; }

public RoutingTable Routing { get; set; }
//public RoutingTable Routing { get; set; }

public SocketConfiguration() {
DefaultPublicationOptions = new PublicationOptions();
Expand All @@ -58,7 +53,7 @@ public object Clone() {
c.DefaultSubscriptionOptions = (SubscriptionOptions)DefaultSubscriptionOptions.Clone();
c.DefaultRequestOptions = (RequestOptions)DefaultRequestOptions.Clone();

c.Routing = (RoutingTable)Routing.Clone();
//c.Routing = (RoutingTable)Routing.Clone();

return c;
}
Expand Down
115 changes: 0 additions & 115 deletions src/Configuration/DataStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,119 +141,4 @@ public SubscriptionOptions GetResponseSubscriptionOptions() {
return new SubscriptionOptions(ResponseTopic, QualityOfServiceLevel.ExactlyOnce);
}
}

public class RoutingTable : ICloneable {

private List<Edge> edges;
private List<Node> nodes;

public List<Edge> Edges {
get { return edges; }
private set { edges = value; }
}
public List<Node> Nodes {
get { return nodes; }
private set { nodes = value; }
}

public RoutingTable() {
edges = new List<Edge>();
nodes = new List<Node>();
}

public object Clone() {
var t = new RoutingTable();
t.nodes.AddRange(nodes.Select(x => (Node)x.Clone()));
t.edges.AddRange(edges.Select(x => (Edge)x.Clone()));

return t;
}

public RoutingTable ExtractForNode(string id) {
var t = new RoutingTable();

t.edges.AddRange(edges.Where(x => x.Source.Id == id || x.Sink.Id == id));
nodes.AddRange(t.edges.Select(x => x.Source));
nodes.AddRange(t.edges.Select(x => x.Sink));

return t;
}

public void AddNode(Node n) {
nodes.Add(n);
}

public void AddEdge(Edge e) {
edges.Add(e);
}

public void RemoveNode(string id) {
edges.RemoveAll(x => x.Source.Id == id || x.Sink.Id == id);
nodes.RemoveAll(x => x.Id == id);
}

public void RemoveEdge(string id) {
edges.RemoveAll(x => x.Source.Id == id || x.Sink.Id == id);
}
}

public class Edge : ICloneable {

public string Id { get; set; }
public Node Source { get; set; }
public Node Sink { get; set; }
public string Query { get; set; }

public Edge() { }
public Edge(string id, Node source, Node sink, string query = null) {
Id = id;
Source = source;
Sink = sink;
Query = query;
}

// TODO: add ports

public object Clone() {
return new Edge(Id, Source, Sink, Query);
}

public string GetRoutingString(string delimiter) {
return $"{Source.Typename}{delimiter}{Source.Id}";
}
}

public class Node : ICloneable {
public string Id { get; set; }

public string Typename { get; set; }

public string FullyQualifiedTypename { get; set; }

public List<Port> Ports { get; set; }

public Node() { }

public Node(string id, string typename, string fullyQualifiedTypename, List<Port> ports) {
Id = id;
Typename = typename;
FullyQualifiedTypename = fullyQualifiedTypename;
Ports = ports;
}

public object Clone() {
return new Node(Id, Typename, FullyQualifiedTypename, Ports);
}

public string GetRoutingString(string delimiter) {
return $"{Typename}{delimiter}{Id}";
}
}

public struct Port {
public string Id { get; set; }
public string Type { get; set; } // in/out

public Port() { }
}
}
2 changes: 1 addition & 1 deletion src/DemoApp/DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Ai.Hgb.Dat.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Utils.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>Ai.Hgb.Dat.$(MSBuildProjectName)</AssemblyName>
Expand Down

0 comments on commit 23a60ca

Please sign in to comment.