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

Convert CLI tool to a dotnet tool #26

Closed
mariomastrodicasa opened this issue Feb 27, 2022 · 2 comments · Fixed by #27
Closed

Convert CLI tool to a dotnet tool #26

mariomastrodicasa opened this issue Feb 27, 2022 · 2 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@mariomastrodicasa
Copy link
Contributor

Describe the bug
The package KafkaBridgeCLI shall appears as a dotnet tool rather than a normal package.

Expected behavior
Convert the package to a dotnet tool package and give the users the ability to use the content as a console application.

Screenshots

image

Desktop (please complete the following information):

  • OS: Any
  • Version: All

Additional context
N/A

@mariomastrodicasa mariomastrodicasa added the bug Something isn't working label Feb 27, 2022
@masesdevelopers
Copy link
Contributor

To create a working dotnet tool package seems mandatory to add PackAsTool option within the project. Anyway testing the resulting package it does not contains all files necessary for the runtime: only the main assemblies of the referenced packages are available, the runtime libraries of JCOBridge are missing; we tested the solutions found in NuGet/Home#4360 without success because a NuGet package hosting tools expect the files are under a folder named any under each runtime (tools\net6.0\any, tools\net5.0\any); at the end we concluded that a feasible option is to create a specific nuspec file, avoids the creation of package from project (i.e. disable option GeneratePackageOnBuild): the project is used only to create the executables.

@mariomastrodicasa
Copy link
Contributor Author

Until now the tool needs to explicitly set the class to be used with ClassToRun command-line switch. A dotnet tool package can host more than one command: it is useful to create scripts (PowerShell, batch or sh) to execute the command directly:

KafkaBridgeCLI -ClassToRun ConsoleConsumer --bootstrap-server SERVER-ADDRESS:9093 --topic topic_name --from-beginning

becomes

ConsoleConsumer --bootstrap-server SERVER-ADDRESS:9093 --topic topic_name --from-beginning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants