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

[net]build(nuget): add NuGet package readme and other info for Sails.ClientGenerator #733

Merged
merged 1 commit into from
Dec 12, 2024
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
4 changes: 3 additions & 1 deletion net/examples/Sails.DemoClient/Sails.DemoClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
</ItemGroup>

<ItemGroup Condition="'$(UseSailsProjectRefences)' != 'true'">
<PackageReference Include="Sails.ClientGenerator" />
<PackageReference Include="Sails.ClientGenerator">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Sails.Net" />
<PackageReference Include="Substrate.NET.API" VersionOverride="$(SubstrateNetApiVersionOverride)" Condition="'$(SubstrateNetApiVersionOverride)' != ''" />
</ItemGroup>
Expand Down
28 changes: 28 additions & 0 deletions net/src/Sails.ClientGenerator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Sails.ClientGenerator
=====================

A library generating .NET code for communicating with programs written using
[Sails](https://github.com/gear-tech/sails?tab=readme-ov-file#sails-) framework
based on their IDL files. The generated code relies on abstractions provided by
[Sails.Net](https://www.nuget.org/packages/Sails.Net).

### Usage

In the `csproj` file of the project willing to use generated client code, add:
```xml
<ItemGroup>
<!-- IDL file obtained from Sails program -->
<AdditionalFile Include="demo.idl" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Sails.ClientGenerator">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Sails.Net" />
</ItemGroup>
```
This will generate .NET code for the client which will be found under
`Dependencies -> Analyzers -> Sails.ClientGenerator -> Sails.ClientGenerator.SailsClientGenerator`.
Discover how the generated code can be used via exploring
[tests](https://github.com/gear-tech/sails/tree/master/net/tests/Sails.DemoClient.Tests).
9 changes: 8 additions & 1 deletion net/src/Sails.ClientGenerator/Sails.ClientGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
<IsRoslynComponent>true</IsRoslynComponent>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<Description>Code generator for Sails.Net.</Description>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Description>Code generator for clients to communictae with Sails programs</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
<PackageTags>Sails, Vara, Gear, Substrate</PackageTags>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" />
<PackageReference Include="PolySharp" />
Expand Down
Loading