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

feat(client-gen): .NET client code generator #611

Open
wants to merge 52 commits into
base: master
Choose a base branch
from

Conversation

vobradovich
Copy link
Member

No description provided.

@vobradovich vobradovich self-assigned this Oct 28, 2024
@DennisInSky DennisInSky self-requested a review November 4, 2024 08:43
@vobradovich vobradovich marked this pull request as ready for review November 10, 2024 21:18
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
rs/client-gen-dotnet/src/lib.rs Outdated Show resolved Hide resolved
rs/client-gen-dotnet/Cargo.toml Outdated Show resolved Hide resolved
try
{
Libdl1.dlerror();
UseLibdl1 = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any special reason for not using libdl.so.2 all the time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supposing libdl[.dylib] is used in mac.

net/rs/client-gen-dotnet/Cargo.toml Outdated Show resolved Hide resolved
net/rs/client-gen-dotnet/Cargo.toml Outdated Show resolved Hide resolved
crate-type = ["cdylib", "lib"]

[build-dependencies]
csbindgen.workspace = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really don't like as it introduces sort of circulr dependencies

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, but think it's better to generate code with csbindgen

using global::System;
using global::System.Collections.Generic;

#pragma warning disable RCS0056 // A line is too long
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? Ananlyzers shouldn't check generated code

ICall<global::Substrate.NetApi.Model.Types.Primitive.U8> DoThat(global::Substrate.NetApi.Model.Types.Base.BaseTuple<global::Substrate.NetApi.Model.Types.Primitive.U8, global::Substrate.NetApi.Model.Types.Primitive.U32> p1);
}

public partial class Basic : IBasic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is partial? Shouldn't it be sealed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's good practice to make generated classes partial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants