picocli icon indicating copy to clipboard operation
picocli copied to clipboard

Feature Suggestion: Homebrew support

Open yschimke opened this issue 5 years ago • 9 comments

It's fairly trivial to expose and bundled java app with launcher scripts via homebrew without any permission from upstream brew maintainers

e.g. https://github.com/yschimke/homebrew-tap/blob/master/rsocket-cli.rb#L18

This script makes the following brew command possible

brew install yschimke/tap/rsocket-cli

Since you are generating bash completion scripts, it seems like a logical step to generate a homebrew file.

yschimke avatar Jun 16 '19 07:06 yschimke

Feel free to close, this is a suggestion, I don't have plans to actively work on this.

yschimke avatar Jun 16 '19 07:06 yschimke

Another cool idea, thank you! So basically we want to generate a script very similar to the linked script from a picocli model.

Looking at the linked rsocket-cli.rb script, missing items not in the picocli model (so user must provide):

  • homepage
  • URL (we can generate the sha checksum from the artifact downloaded from this URL)

Anything else?

remkop avatar Jun 16 '19 08:06 remkop

That seems about right. BTW I converted a project from airline to picocli and the experience was great. Particularly because I want it to work well with graal etc and it seems to rely a lot less on reflection.

https://github.com/rsocket/rsocket-cli/commit/099792ffcca62383e9840b913d3d307709d394af

I've implemented a few CLIs now, so really appreciate the functionality this library provides. Some of these suggestions are towards allowing a developer to just write the Main class, and have shell integration, installation, user help for free. I guess I'm wondering how you could tie the experience together, or whether that is something a framework like micronauts would provide?

yschimke avatar Jun 16 '19 08:06 yschimke

I've been working on a tool to make this possible: https://jreleaser.org

Bonus: it's CLI option uses picocli (thanks @remkop!)

aalmiray avatar Apr 09 '21 20:04 aalmiray

@aalmiray Very nice! I am happy to include a link to jreleaser from the picocli docs, maybe the Packaging section. Do you feel like providing a PR?

remkop avatar Apr 09 '21 23:04 remkop

Love to! Where can I find the doc sources? i cloned this repo and found HTML files under docs but it looks to me the site is built with Asciidoc, isn't it? Another weird thing is that Ii get the following files already modified upon checking out my fork

	modified:   docs/A-Whirlwind-Tour-of-Picocli.html
	modified:   docs/announcing-picocli-1.0.html
	modified:   docs/autocomplete.html
	modified:   docs/build-great-native-cli-apps-in-java-with-graalvm-and-picocli.html
	modified:   docs/feedback.html
	modified:   docs/groovy-2.5-clibuilder-renewal-part1.html
	modified:   docs/groovy-2.5-clibuilder-renewal-part2.html
	modified:   docs/groovy-2.5-clibuilder-renewal.html
	modified:   docs/man/index.html
	modified:   docs/migrating-from-commons-cli.html
	modified:   docs/picocli-2.0-do-more-with-less.html
	modified:   docs/picocli-2.0-groovy-scripts-on-steroids.html
	modified:   docs/picocli-on-graalvm.html
	modified:   docs/picocli-programmatic-api.html
	modified:   docs/quick-guide.html
	modified:   docs/zh/picocli-2.0-do-more-with-less.html
	modified:   docs/zh/picocli-2.0-groovy-scripts-on-steroids.html

Is there some sort of trigger that modifies these files?

aalmiray avatar Apr 10 '21 14:04 aalmiray

Hi @aalmiray! The modified files are generated HTML files, you can ignore them. I thought I had fixed things so that when I commit files, line endings are converted from CRLF to LF, but perhaps something went wrong there... I hope it is not too inconvenient.

The source for the manual is here: https://github.com/remkop/picocli/blob/master/docs/index.adoc

When you run gradlew asci, the generated index.html will appear in build/docs/index.html.

remkop avatar Apr 10 '21 22:04 remkop

I'd also like a brew package ideally. It's a very popular package management framework!

mayurankv avatar Feb 10 '24 17:02 mayurankv

I'd also like a brew package ideally. It's a very popular package management framework!

@mayurankv This is supported via JReleaser: https://picocli.info/#_jreleaser

remkop avatar Feb 10 '24 20:02 remkop