Skip to content

Commit 711356d

Browse files
committed
Tweak readme and packing options
1 parent dd678ba commit 711356d

File tree

8 files changed

+46
-38
lines changed

8 files changed

+46
-38
lines changed

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,12 @@ This is a DSL which simplifies the writing of ProtoBuf contracts for [Zebus](htt
1212
- [`Zebus.MessageDsl`](https://www.nuget.org/packages/Zebus.MessageDsl) provides the DSL parser, C# and proto generators
1313
- [`Zebus.MessageDsl.Build`](https://www.nuget.org/packages/Zebus.MessageDsl.Build) provides a MSBuild code generator which will translate `.msg` files in your project
1414
- [`Zebus.MessageDsl.Generator`](https://www.nuget.org/packages/Zebus.MessageDsl.Generator) provides a Roslyn source generator which will translate `.msg` files in your project
15-
16-
## .NET Tool
17-
18-
We offer a .NET CLI tool to generate code from `.msg` files. This tool can be installed either globally or locally within your project.
19-
20-
To install the tool globally:
21-
22-
```bash
23-
dotnet tool install -g Zebus.MessageDsl.Tool
24-
```
25-
26-
After installation, the tool will be accessible as messagedsl (on Linux, you may need to refresh your environment variables). It supports the following options:
27-
28-
--namespace: Sets the default namespace for the generated files (optional).
29-
--format: Specifies the output format (csharp or proto). Defaults to proto.
30-
31-
The tool accepts a path to a .msg file as an argument. If no argument is provided, it will read the .msg file from the standard input.
15+
- [`Zebus.MessageDsl.Tool`](https://www.nuget.org/packages/Zebus.MessageDsl.Tool) provides a CLI tool for processing `.msg` files
3216

3317
## Documentation
3418

3519
- [DSL Syntax](docs/Syntax.md)
20+
- [CLI Tool](docs/Tool.md)
3621
- [Build-Time Code Generator](docs/BuildTimeCodeGen.md) (`.msg` files)
3722

3823
## Example

docs/Tool.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
# .NET Tool
3+
4+
We offer a .NET CLI tool to generate code from `.msg` files. This tool can be installed either globally or locally within your project.
5+
6+
To install the tool globally:
7+
8+
```bash
9+
dotnet tool install -g Zebus.MessageDsl.Tool
10+
```
11+
12+
After installation, the tool will be accessible as `messagedsl` (on Linux, you may need to refresh your environment variables). It supports the following options:
13+
14+
- `--namespace`: Sets the default namespace for the generated files (optional).
15+
- `--format`: Specifies the output format (`csharp` or `proto`). Defaults to `proto`.
16+
17+
The tool accepts a path to a `.msg` file as an argument. If no argument is provided, it will read the `.msg` file from the standard input.
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
77

8-
<IsPackable>false</IsPackable>
9-
<IsTestProject>true</IsTestProject>
10-
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
10+
<PackageReference Include="NUnit" Version="3.13.3" />
11+
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
12+
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
13+
</ItemGroup>
1114

12-
<ItemGroup>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
14-
<PackageReference Include="NUnit" Version="3.13.3"/>
15-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
16-
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
17-
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
18-
</ItemGroup>
19-
20-
<ItemGroup>
21-
<ProjectReference Include="..\Abc.Zebus.MessageDsl.Tool\Abc.Zebus.MessageDsl.Tool.csproj" />
22-
</ItemGroup>
15+
<ItemGroup>
16+
<ProjectReference Include="..\Abc.Zebus.MessageDsl.Tool\Abc.Zebus.MessageDsl.Tool.csproj" />
17+
</ItemGroup>
2318

2419
</Project>

src/Abc.Zebus.MessageDsl.Tool.Tests/ToolTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
using System.IO;
13
using NUnit.Framework;
24

35
namespace Abc.Zebus.MessageDsl.Tool.Tests;

src/Abc.Zebus.MessageDsl.Tool/Abc.Zebus.MessageDsl.Tool.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net9.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
76
<Nullable>enable</Nullable>
7+
<SignAssembly>True</SignAssembly>
8+
<AssemblyOriginatorKeyFile>..\Abc.Zebus.MessageDsl\Abc.Zebus.MessageDsl.snk</AssemblyOriginatorKeyFile>
9+
<IsPackable>true</IsPackable>
10+
<PackageId>Zebus.MessageDsl.Tool</PackageId>
11+
<Version>$(ZebusDslToolVersion)</Version>
12+
<Description>A message DSL for Zebus (CLI tool for .msg files)</Description>
813
<PackAsTool>true</PackAsTool>
914
<ToolCommandName>messagedsl</ToolCommandName>
1015
<RollForward>major</RollForward>

src/Abc.Zebus.MessageDsl.Tool/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
using System.CommandLine;
1+
using System;
2+
using System.CommandLine;
3+
using System.IO;
24
using Abc.Zebus.MessageDsl.Ast;
35
using Abc.Zebus.MessageDsl.Generator;
46

57
namespace Abc.Zebus.MessageDsl.Tool;
68

7-
public class Program
9+
public static class Program
810
{
911
public static int Main(string[] args)
1012
{

src/Abc.Zebus.MessageDsl.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{A8144077-4
3030
..\docs\BuildTimeCodeGen.md = ..\docs\BuildTimeCodeGen.md
3131
..\README.md = ..\README.md
3232
NuGetReadme.md = NuGetReadme.md
33+
..\docs\Tool.md = ..\docs\Tool.md
3334
EndProjectSection
3435
EndProject
3536
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abc.Zebus.MessageDsl.Tool", "Abc.Zebus.MessageDsl.Tool\Abc.Zebus.MessageDsl.Tool.csproj", "{7CB3D85B-543E-4066-9689-29847BDBDFE0}"

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ZebusDslVersion>1.5.0</ZebusDslVersion>
1919
<ZebusDslBuildVersion>$(ZebusDslVersion)</ZebusDslBuildVersion>
2020
<ZebusDslGeneratorVersion>$(ZebusDslVersion)</ZebusDslGeneratorVersion>
21+
<ZebusDslToolVersion>$(ZebusDslVersion)</ZebusDslToolVersion>
2122
</PropertyGroup>
2223

2324
<PropertyGroup>

0 commit comments

Comments
 (0)