-
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
WIP 633 Add prototype for multiple apps in single project #839
Conversation
comments welcome: @metasim , @wookietreiber , @kardapoltsev |
First of all thank you for considering this use case and providing an implementation for it. I have a few questions regarding your code samples:
|
This is generated by the
I though of two options.
I went for the second option, which I thought reduces duplicated bash scripts. On the other hand this generates the confusing default script. Hm. |
I would generally prefer the first option. I can think of two use cases for multiple apps within one project:
In this case I would definitely want to not have the default start script. This, of course, requires that the scripts are all self-contained and not rely on calling the default script. In this case, I would want to have the default start script, possibly named after the project instead of its respective main class. Here it would be ok if the supplementary are small scripts that call the default one. To support both use cases, I do not know if it is better to either have different plugins, i.e. |
@muuki88 No particular thoughts. I'm glad it's implemented via a plugin, and that separate launch scripts are created. One question: how do you control the number of launcher scripts that are generated? Is there a task you can override to filter the found |
Thanks a lot for the input. @wookietreiber you are right. These are both valid use cases. I think I would implement them both in one plugin and switch between them via a setting.
@metasim not yet. I was not sure if this should be added in the first version as "too many" start scripts won't hurt and you can always filter them via the |
WDYT of the following idea.
Customization can be done by
|
I like that, because it allows a) name transformation, and b) filtering. Are |
@metasim . Yes, |
bf78ae0
to
82c7390
Compare
cc6ddd7
to
b597470
Compare
@kardapoltsev / @metasim could you take a look? If you think the behaviour is okay, I'll merge this and release. You can use the github review feature to do so :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest clarifying the semantics of "forwarder scripts" in the docs, and how to disable their generation.
|
||
1. A start script for each entry point. This is the default behaviour, when no ``mainClass in Compile`` is set | ||
2. One start script for the defined ``mainClass in Compile`` and forwarding scripts for all other main classes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is meant by "forwarding scripts"? Maybe flesh out the semantic difference, and/or indicate details follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I'm still not happy with the naming anyway. Forwarder, Delegate,..
However I will define the semantics more clearly.
|
||
|
||
Now you can package your application as usual, but with multiple start scripts. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I might go into a bit more detail on the differences between the main start script and what it means to have a "forwarder". Also, how do you disable the generation of forwarders?
- Extracted plugins for bash and bat scripts - Added bash and bat forwader scripts
fbe1cd2
to
e410fd0
Compare
Prototype
This is the first attempt to provide multiple start scripts within a single project. The main idea is to leverage the already provided script by
JavaAppPackaging
and just forward calls to it. This results inmainClass in Compile
defined class`=Usage
Assuming two main classes
com.example.DefaultMain
andcom.example.AnotherMain
.sbt stage
will create the following outputTODOs