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

Call commands between classes #743

Open
dafeder opened this issue Jun 25, 2018 · 1 comment
Open

Call commands between classes #743

dafeder opened this issue Jun 25, 2018 · 1 comment

Comments

@dafeder
Copy link

dafeder commented Jun 25, 2018

I'm building a standalone app with multiple "RoboFiles" ie command classes. I've hit a point where some of these classes would like to be able to call a command from another one. If I'm writing a command inside CommandClassA how might I execute command CommandClassB::myCommand() (other than just running it as a CLI call in an exec task)? Or do I really just need to write custom tasks here?

@greg-1-anderson
Copy link
Member

Making custom tasks is the best way to share common code between multiple RoboFiles. The progress bar will work better if a command is a series of custom tasks compared to a series of taskExecs. This aspect does not necessarily improve if calling other commands directly rather than via taksExec.

Others have requested this feature, though, and there are use cases where this makes sense. I made this PR: #675. Should have merged it already, but I had intended to do some refactoring.

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

No branches or pull requests

2 participants