-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add using directive for specifying a (default) main class #400
Add using directive for specifying a (default) main class #400
Conversation
3e3d941
to
05ef6ce
Compare
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.
@fourth44 Thank you for your contribution! I have just left one suggestion.
): Either[BuildException, BuildOptions] = { | ||
val mainClasses = DirectiveUtil.stringValues(values) | ||
val options = BuildOptions( | ||
mainClass = mainClasses.lastOption |
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 think, we should not allowed to passing main class few times.
You can use SeveralMainClassesFoundError
which is already defined here.
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'm happy to implement your suggestion, but I would like to point out that SeveralMainClassesFoundError
seems to be intended for the number of main classes found by analyzing the classpath, while this situation is about the number of main classes supplied by directives. That said, supplying multiple --main-class command line arguments also results in an error so this should definitely too, and it seems best to reuse this error rather than be pedantic that it's not about found but supplied 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.
I think too, that is better to reuse SeveralNoClassdefFoundError
in this case.
Anyway, we started working on an options validation mechanism, which should detect when a directive is specified multiple times, so for now your proposal I good to merge. Later, we will integrate a new mechanism with your directive.
8c59aaf
to
25f7e7c
Compare
25f7e7c
to
6c93650
Compare
is there a ticket about |
Hi @SethTisue, Here is opened the discussion to unify standard for naming convention in directives. |
resolves #370.
All the infrastructure for passing a main class in the build options already existed, so this only adds the directive to fill that option.