Skip to content

Allow run with no sources / replacing cs launch #2840

Closed
@kubukoz

Description

@kubukoz

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

scala-cli is almost capable of replacing cs launch from Coursier: the only thing that appears to be missing, in order to be able to run an arbitrary application from dependencies, is that scala-cli run requires at least one source file / directory.

For example:

scala-cli run --dep software.amazon.smithy:smithy-cli:1.45.0 . --main-class software.amazon.smithy.cli.SmithyCli

Describe the solution you'd like

If dependencies are provided, relax the requirement of having to pass a file/directory.

In addition, there are a couple nice-to-haves:

  • discover main classes from dependencies, maybe with a flag?
  • if no sources are passed, don't start a compilation server (assume --server=false?)

Describe alternatives you've considered

  • Using cs launch as usual
  • Using a dummy empty directory as the sources

Additional context

This would be nice to enable the usage of code generators, such as smithy4s, without waiting for #610. For example, at the moment:

scala-cli run --scala 2.13 --dep com.disneystreaming.smithy4s::smithy4s-codegen-cli:0.18.15 . --main-class smithy4s.codegen.cli.Main --server=false -- version

which isn't terrible, but still requires that dummy directory (.).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions