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

Fix finding main classes in external jars #1380

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

Gedochao
Copy link
Contributor

@Gedochao Gedochao commented Sep 20, 2022

This fixes finding main classes in external jars, enabling the following syntax:

$ scala-cli run -cp Main.jar --list-main-classes
Main
$ scala-cli run -cp Main.jar
Hello
$ scala-cli --main-class Main -cp Main.jar
Hello
$ ls jarDir
Main.jar
$ scala-cli run -cp jarDir
Hello
$ scala-cli --main-class Main -cp jarDir
Hello

BTW do note that this enables to pass .jar files in a directory, which formerly wasn't being handled.
Also, -cp was added as an alias to -classpath, as part of the SIP backwards compat.

@Gedochao Gedochao added bug Something isn't working SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command. labels Sep 20, 2022
@Gedochao Gedochao marked this pull request as ready for review September 20, 2022 13:56
@Gedochao Gedochao force-pushed the fix-finding-main-classes-in-jars-2 branch from f9e3c51 to 1884c18 Compare September 22, 2022 10:45
@Gedochao Gedochao enabled auto-merge September 22, 2022 11:02
@Gedochao Gedochao merged commit 1afb520 into VirtusLab:main Sep 23, 2022
@Gedochao Gedochao deleted the fix-finding-main-classes-in-jars-2 branch September 23, 2022 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SIP-46 All the issues related to SIP-46 to turn Scala CLI into the official scala runner command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants