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

Support launching published apps à la cs launch #2047

Open
armanbilge opened this issue Apr 20, 2023 · 3 comments
Open

Support launching published apps à la cs launch #2047

armanbilge opened this issue Apr 20, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@armanbilge
Copy link
Contributor

Is your feature request related to a problem? Please describe.

A way to run applications published to Maven Central.

Describe the solution you'd like

Essentially if scala-cli could subsume the launch command from coursier. Or something roughly similar.

https://get-coursier.io/docs/cli-launch

Describe alternatives you've considered

I could use coursier, but then I need to install two things :) scala-cli is becoming ubiquitous.

@armanbilge armanbilge added the enhancement New feature or request label Apr 20, 2023
@tgodzik
Copy link
Member

tgodzik commented Apr 20, 2023

Thanks for reporting! This would put ScalaCLI very close to being a package manager. It's something we've been talking and enabling some coursier commands via was an option.

However, currently I would be hesitant to add it as it would make ScalaCLI do a lot of things at the same time. We need to stabilize a bit the current features and maybe come back to this much later.

@armanbilge
Copy link
Contributor Author

armanbilge commented Apr 23, 2023

This would put ScalaCLI very close to being a package manager.

I have bad news then, I think this has already happened 😛 I realized that I can already accomplish what I want with this command.

scala-cli run . -S 2.13 --dep org.scala-steward::scala-steward-core::0.23.0 --main-class org.scalasteward.core.Main

It's just a bit cumbersome to have to supply the main class and the run . in an empty directory is a bit weird. But maybe this is a just fine workaround.

@Gedochao
Copy link
Contributor

This would put ScalaCLI very close to being a package manager.

I have bad news then, I think this has already happened 😛 I realized that I can already accomplish what I want with this command.

scala-cli run . -S 2.13 --dep org.scala-steward::scala-steward-core::0.23.0 --main-class org.scalasteward.core.Main

It's just a bit cumbersome to have to supply the main class and the run . in an empty directory is a bit weird. But maybe this is a just fine workaround.

This is an interesting hack to get the hidden feature 😅 kudos
I think you could get rid of the funny run . by using a snippet with -e.
Something like:

scala-cli -e 'println()' -S 2.13 --dep org.scala-steward::scala-steward-core::0.23.0 --main-class org.scalasteward.core.Main

Also, it seems the main class coming from a coursier dependency isn't properly detected, so we can't view it with --list-main-classes or default to it as is... but that should be fixable, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants