Skip to content

Commit

Permalink
[net]build(nuget): add NuGet package readme and other info for Sails.…
Browse files Browse the repository at this point in the history
…ClientGenerator (#733)
  • Loading branch information
DennisInSky authored Dec 12, 2024
1 parent 737f3c8 commit 3bcf4f1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
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

0 comments on commit 3bcf4f1

Please sign in to comment.