-
Notifications
You must be signed in to change notification settings - Fork 420
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
Allow mixins to get a reference to the command they are mixed into #958
Labels
Milestone
Comments
remkop
changed the title
Allow mixins to get a reference to the command they are injected into
Allow mixins to get a reference to the command they are mixed into
Feb 17, 2020
remkop
added a commit
that referenced
this issue
Feb 17, 2020
remkop
added a commit
that referenced
this issue
Feb 18, 2020
* LoggingMixin is now a self-contained, reusable mixin that implements a cross-cutting "log level configuration" concern * Moved all Log4j2 configuration code into LoggingMixin * Removed hard-coded dependency on MyApp; instead top-level command must implement LoggingMixin.IOwner * Simplified bootstrap by setting LoggingMixin::executionStrategy as the execution strategy * All commands (including the top-level command) now simply use `@Mixin LoggingMixin x` as needed
remkop
added a commit
that referenced
this issue
Feb 19, 2020
remkop
added a commit
that referenced
this issue
Feb 20, 2020
remkop
added a commit
that referenced
this issue
Feb 21, 2020
remkop
added a commit
that referenced
this issue
Feb 22, 2020
remkop
added a commit
that referenced
this issue
Feb 23, 2020
remkop
added a commit
that referenced
this issue
Feb 23, 2020
remkop
added a commit
that referenced
this issue
Feb 23, 2020
remkop
added a commit
that referenced
this issue
Feb 24, 2020
remkop
added a commit
that referenced
this issue
Feb 24, 2020
remkop
added a commit
that referenced
this issue
Feb 24, 2020
This is now implemented and documented in master. |
remkop
added a commit
that referenced
this issue
Mar 20, 2020
remkop
added a commit
that referenced
this issue
Apr 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allow mixins to get a reference to the command they are injected into.
Currently, having a
@Spec
-annotated field in a Mixin will result in theCommandSpec
of the mixin being injected instead of theCommandSpec
of the target command (where the mixin is mixed into).This makes it impossible to climb the command hierarchy in a generic way in a mixin.
A possible solution is something like this:
This would allow for usage like this:
(I created a separate ticket, #960, for getting the root (top-level) command from a command spec.)
Update: a full-blown example is here.
The text was updated successfully, but these errors were encountered: