-
Notifications
You must be signed in to change notification settings - Fork 443
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 multiple main classes in a single module #80
Comments
Great idea and patches welcome :) So for the latter, the issue with the REPL is that you'd need the scala-compiler and dependencies to be in the lib/*.jar somewhere. By default, this doesn't happen unless you explicitly depend on the compiler in your project. Otherwise, neat idea. Repl is scala.tools.MainGenericRunner or some such. You know, great names lead to great things.... |
I am looking this feathure |
Great! Look forward to seeing what yu produce. Let me know if you need help. |
And don't forget about server applications where we need to specify exact Regards, Alexey
|
Hi, I have come across this issue searching for a way to package a project with two main classes. The OP states it is possible, but more recent StackOverflow discussion suggests the opposite. I am confused. |
The sbt-native-packager generated script allows you to pass in a Create a
Then I create a separate script for each main class I want to run. For example
and
|
that makes sense. Can I then package the two scripts into two upstart services, or one which would run both scripts? |
Not sure about upstart. I'm usually packaging up my stuff using docker (although I don't use the sbt-native-packager docker functionality for that). |
@tpunder thanks for sharing! saw your SO answer, too late before suggesting an edit. @divijan So your use-case is starting two different applications, right? The recommended way would be to package two applications by adding two submodules for each package. This way you have redudant code, but a clear separation. |
@muuki88 not sure I understand your suggestion. I have one sbt project with two main classes I would like to run. Should I package my project twice with different main class selected in build.sbt? |
While it is possible to get native packager to output start scripts for each of a multi-module project, it would be nice if there was an optional way to pass the main class to the bin script,
target/universal/stage/bin/<module> -m some.main.Clazz
this might also bring for free a repl without sbt needed? (not sure of the mechanics)
target/universal/stage/bin/<module> -m the.scala.repl.main.Clazz
The text was updated successfully, but these errors were encountered: