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

Accept main methods with no arguments #42

Merged
merged 3 commits into from
Mar 23, 2022
Merged

Conversation

alexarchambault
Copy link
Contributor

@alexarchambault alexarchambault commented Mar 21, 2022

This PR allows users to specify a main method accepting no arguments, which is useful to use methods such as org.scalajs.testing.bridge.Bridge.start as an entrypoint, and tweaks minor other things (.bsp in .gitignore, default to Scala 2.13.x).

Right now, arg-less entrypoints can be specified like --mainMethod org.scalajs.testing.bridge.Bridge.start! (! at the end of the method name), but let me know if you'd prefer those to be specified another way.

These changes are motivated by VirtusLab/scala-cli#676, which runs the Scala.JS linker in an external process, rather than embedding it in the Scala CLI native image.

@alexarchambault alexarchambault changed the title Tweaking Accept main methods with no arguments Mar 21, 2022
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the syntax is going to be subject to some bikeshedding. Using a symbol is annoying if it's not self-explanatory/intuitive. I would opt for a separate option name.

@gzm0 Any opinion?

.gitignore Outdated Show resolved Hide resolved
@alexarchambault
Copy link
Contributor Author

Just changed the syntax to an option. That's --mainMethodWithNoArgs org.scalajs.testing.bridge.Bridge.start in the current state of the PR.

Useful to run tests for example
@sjrd sjrd merged commit ea52759 into scala-js:main Mar 23, 2022
@alexarchambault alexarchambault deleted the tweaking branch March 23, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants