How to Run/Debug project with two executables?
已回答
My project produces two executables, the main application and a matching updater. The two share some code.
However, the Module is “pointed” to the main application src/ directory, and the updater is in a separate directory in the same project. I use an ant script to build both for Linux, Windows and Mac.
Is it possible to Run/Debug the updater somehow without creating entirely separate projects for the two executables and a library of shared code? The class chooser for the main method only shows that of the main application.
It's at ELS on GitHub if anyone is interested.
Thank you for your time.
请先登录再写评论。
Hi, Todd!
Thank you for reaching out to us and my apologies for the delay in answering your question.
Yes, this should be possible by creating a second module. A module, generally speaking, consists of one or more content roots and a module file (but it is also possible to exist without any) and is automatically created with a new project. You can find more about the modules here.
To achieve what you're looking for, please follow these steps:
Create a new module:
Configure the module sources:
Set up module dependencies:
Create a run configuration for the updater:
In the Build and Run section, select your new updater module;
If this part is not showing, then just enable it by clicking Modify options and check the Use classpath of module option.
A bit of a long tutorial, but I hope this helps on the way. Pllease do let me know in case you have any questions.