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

Merged
merged 63 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0d72848
wip: dotnet client gen
vobradovich Oct 23, 2024
76aa5d7
wip: typpe generator
vobradovich Oct 23, 2024
e78dc02
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Oct 23, 2024
2a44898
wip: net client gen
vobradovich Oct 23, 2024
b6521d8
wip: type generator
vobradovich Oct 24, 2024
e8c1a90
wip: type generatore
vobradovich Oct 24, 2024
01a2a51
wip: dotnet generators
vobradovich Oct 25, 2024
c998fa6
wip: dotnet generator
vobradovich Oct 25, 2024
4889a21
wip: type generator
vobradovich Oct 25, 2024
50fac71
wip: event generator
vobradovich Oct 28, 2024
ece5890
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Oct 28, 2024
dab60df
fix new lines
vobradovich Oct 28, 2024
4e0a69c
generator build, csbindgen
vobradovich Oct 29, 2024
5a1bf00
dotnet SailsClientGenerator
vobradovich Oct 29, 2024
647a9e7
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 4, 2024
62acda4
wip: add BaseDictionary. map types
vobradovich Nov 5, 2024
0208b73
wip: fix types & dotnet generator
vobradovich Nov 5, 2024
8e76c24
remove nigtly build, add code format
vobradovich Nov 5, 2024
45f8d13
wip: ci
vobradovich Nov 6, 2024
9fe76e6
wip: ci2
vobradovich Nov 6, 2024
b0b675d
wip: ci3
vobradovich Nov 6, 2024
cf0064b
wip: ci4
vobradovich Nov 6, 2024
a5858cd
wip: ci
vobradovich Nov 6, 2024
2ea5702
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 6, 2024
42c033d
fix build
vobradovich Nov 6, 2024
aa1aa71
wip: ci
vobradovich Nov 6, 2024
bdf2ce0
try i8
vobradovich Nov 7, 2024
1588abe
try 2
vobradovich Nov 7, 2024
d377659
try 3
vobradovich Nov 7, 2024
e4fb5fa
try pack
vobradovich Nov 7, 2024
780c705
wip: ci
vobradovich Nov 7, 2024
06e7f0b
wip: native loader
vobradovich Nov 8, 2024
7788dfa
wip: resource library loader
vobradovich Nov 10, 2024
6729639
try fix csproj
vobradovich Nov 10, 2024
3e86467
try fix
vobradovich Nov 10, 2024
c43446e
fix csproj
vobradovich Nov 10, 2024
a03cece
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 10, 2024
7a46531
fix tests
vobradovich Nov 10, 2024
585ff20
fix ci
vobradovich Nov 10, 2024
dcb2f11
move client-gen-dotnet to new workspace
vobradovich Nov 10, 2024
0812aab
update ci
vobradovich Nov 10, 2024
199239a
improve SailsClientGenerator
vobradovich Nov 10, 2024
6e99033
rename to sails_net_client_gen
vobradovich Nov 12, 2024
c930cec
wip: add generator config, add namespace
vobradovich Nov 12, 2024
dc52499
wip: fix
vobradovich Nov 12, 2024
f2012cc
wip: generate sealed classes
vobradovich Nov 12, 2024
0c29bdb
remove csbindgen and native methods generation
vobradovich Nov 12, 2024
8a2492d
add Sails.Client.Tests
vobradovich Nov 13, 2024
ca06052
tyr fix
vobradovich Nov 13, 2024
7f251f7
try fix 2
vobradovich Nov 13, 2024
f077f5c
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 13, 2024
9d3f378
fix comments
vobradovich Nov 13, 2024
0aab4fe
resolve linux lib loading
vobradovich Nov 14, 2024
29490e7
fix comments
vobradovich Nov 14, 2024
439006c
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 15, 2024
1144f81
ref test analyzer
vobradovich Nov 15, 2024
2c39ec5
add Verify settings
vobradovich Nov 15, 2024
8da3f22
Merge branch 'master' into vo/client-gen-dotnet
vobradovich Nov 15, 2024
5c90b38
fix
vobradovich Nov 15, 2024
2055f71
Rename SailsClientGeneratorTests.Generate_DemoIdl#demo.g.verified.cs …
vobradovich Nov 15, 2024
6e2a8a6
save lib in folder with hash
vobradovich Nov 15, 2024
bc651a6
Merge branch 'vo/client-gen-dotnet' of github.com:gear-tech/sails int…
vobradovich Nov 15, 2024
2376211
set nullable disable for types
vobradovich Nov 15, 2024
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
99 changes: 99 additions & 0 deletions .github/workflows/net-build-client-gen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: '[net] Build client-gen-dotnet'

on:
push:
branches:
- master
paths:
- '.github/workflows/net-build-client-gen.yml'
- 'net/rs/**'
- 'rs/idl-parser/**'
DennisInSky marked this conversation as resolved.
Show resolved Hide resolved

pull_request:
paths:
- '.github/workflows/net-build-client-gen.yml'
- 'net/rs/**'
- 'rs/idl-parser/**'

jobs:
win-x64:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- run: cargo build --manifest-path net/rs/Cargo.toml --release
- uses: actions/upload-artifact@v4
with:
name: win-x64
path: ./net/rs/target/release/sails_net_client_gen.dll
retention-days: 1
overwrite: true

linux-x64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo build --manifest-path net/rs/Cargo.toml --release
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: ./net/rs/target/release/libsails_net_client_gen.so
retention-days: 1
overwrite: true

osx-x64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add x86_64-apple-darwin
- run: cargo build --manifest-path net/rs/Cargo.toml --release --target x86_64-apple-darwin
- uses: actions/upload-artifact@v4
with:
name: osx-x64
path: ./net/rs/target/x86_64-apple-darwin/release/libsails_net_client_gen.dylib
retention-days: 1
overwrite: true

osx-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add aarch64-apple-darwin
- run: cargo build --manifest-path net/rs/Cargo.toml --release --target aarch64-apple-darwin
- uses: actions/upload-artifact@v4
with:
name: osx-arm64
path: ./net/rs/target/aarch64-apple-darwin/release/libsails_net_client_gen.dylib
retention-days: 1
overwrite: true

build-nuget-package:
needs:
- win-x64
- linux-x64
- osx-x64
- osx-arm64
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download native libraries
uses: actions/download-artifact@v4
with:
path: native-libraries

- name: Build
run: dotnet build ./net/src/Sails.ClientGenerator/ -c Release -p:LibraryRoot=${{ github.workspace }}/native-libraries -p:Version=0.6.3-rc

- name: Pack
run: dotnet pack ./net/src/Sails.ClientGenerator/ -c Release --no-build -p:Version=0.6.3-rc -o ./publish

- name: Upload NuGet artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: ./publish/*.nupkg
retention-days: 1
overwrite: true

26 changes: 25 additions & 1 deletion Sails.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Substrate.Gear.Client", "net\src\Substrate.Gear.Client\Substrate.Gear.Client.csproj", "{1589D5A4-0CC4-4855-89E0-2E61BBC5E0B0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Substrate.Gear.Client.Tests", "net\tests\Substrate.Gear.Client.Tests\Substrate.Gear.Client.Tests.csproj", "{42B621CE-C2B4-4911-961C-5B087A514AF5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sails.ClientGenerator", "net\src\Sails.ClientGenerator\Sails.ClientGenerator.csproj", "{F93FFE42-71C1-44BD-9DBA-3559B307370C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sails.ClientGenerator.Tests", "net\tests\Sails.ClientGenerator.Tests\Sails.ClientGenerator.Tests.csproj", "{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{19594BCA-94DB-44AD-ACBC-2ACFED242E9F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Substrate.Gear.Client.Tests", "net\tests\Substrate.Gear.Client.Tests\Substrate.Gear.Client.Tests.csproj", "{42B621CE-C2B4-4911-961C-5B087A514AF5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sails.Client.Tests", "net\tests\Sails.Client.Tests\Sails.Client.Tests.csproj", "{BC248D44-14CD-4BB0-9AF9-4E0750574492}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -47,14 +55,30 @@ Global
{1589D5A4-0CC4-4855-89E0-2E61BBC5E0B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1589D5A4-0CC4-4855-89E0-2E61BBC5E0B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1589D5A4-0CC4-4855-89E0-2E61BBC5E0B0}.Release|Any CPU.Build.0 = Release|Any CPU
{F93FFE42-71C1-44BD-9DBA-3559B307370C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F93FFE42-71C1-44BD-9DBA-3559B307370C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F93FFE42-71C1-44BD-9DBA-3559B307370C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F93FFE42-71C1-44BD-9DBA-3559B307370C}.Release|Any CPU.Build.0 = Release|Any CPU
{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F}.Release|Any CPU.Build.0 = Release|Any CPU
{42B621CE-C2B4-4911-961C-5B087A514AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42B621CE-C2B4-4911-961C-5B087A514AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42B621CE-C2B4-4911-961C-5B087A514AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42B621CE-C2B4-4911-961C-5B087A514AF5}.Release|Any CPU.Build.0 = Release|Any CPU
{BC248D44-14CD-4BB0-9AF9-4E0750574492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC248D44-14CD-4BB0-9AF9-4E0750574492}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC248D44-14CD-4BB0-9AF9-4E0750574492}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC248D44-14CD-4BB0-9AF9-4E0750574492}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A6A2172B-8F8F-4BDC-B519-E7299FFCCA5F} = {19594BCA-94DB-44AD-ACBC-2ACFED242E9F}
{BC248D44-14CD-4BB0-9AF9-4E0750574492} = {19594BCA-94DB-44AD-ACBC-2ACFED242E9F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0894C08B-8BB9-401D-8471-26F5EB5A4EA2}
EndGlobalSection
Expand Down
3 changes: 3 additions & 0 deletions net/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" >
vobradovich marked this conversation as resolved.
Show resolved Hide resolved
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions net/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Ensure.That" Version="10.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.11.0" />
DennisInSky marked this conversation as resolved.
Show resolved Hide resolved
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="PolySharp" Version="1.14.1" />
<PackageVersion Include="Substrate.NET.API" Version="0.9.24-rc8" />
Expand All @@ -13,7 +14,11 @@
<!-- For Tests -->
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="Verify.Xunit" Version="27.1.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<!-- For Code Analysis -->
Expand Down
Loading