I don't want to make the whole project!
Is there any plans to allow the "make" to operate at the module level? Is there a way to do it now? Here's what I'm facing. Doing TDD I frequently hit CtrlShiftF10 to run the current test and by default it calls make. The make operates across the entire project! While I do want to make the current module running this over the entire project is painful. The alternative now is to configure MAven to call test-compile for the current module which works fine but has to be explicitly set each time. Could someone help me find a better way?
Please sign in to leave a comment.
I'd love this as well. Out build tool is written in Java, and we get all sorts of problems due to the fact that it rebuilds the whole project on a make. This seems like it should be easy to fix - in a run configuration when I've specified a module, just build that module and its dependencies. Am I missing a case where that wouldn't work?
Cheers,
Colin
There is the menu item:
Build | Make Module
It will make the module for which ever module the file you have active in the editor belongs to. There is not a keyboard shortcut mapped to it by default, but you could obviously map one if desired. Or just use the menu shortcuts: alt+B, M
To prevent 'make' from running prior to your tests when hitting ctrlshiftF10, you'll need to go into the Run/Debug Configuration dialog (select "Edit Configurations" in the drop down next to the run button on the toolbar) and uncheck the "make" box in the "Before Launch" section for all your saved tests. To have this as the default behavior, click the "Edit Defaults" button (bottom left), select JUnit, and uncheck the box there. Unfortunately there is not an option for "Make Module" in the Before Launch section. If you submit a feature request (http://www.jetbrains.net/jira/secure/CreateIssue!default.jspa) asking that "Make Module" be added to the "Before Launch" section and post the JIRA number here, I'll vote for it. Until that's implemented, you'd need to do a Make Module, then run your test.
To avoid having to set this each time, go into the Run/Debug Configuration dialog, click the Edit Defaults button, select JUnit, then on the Before Launch pane, select "Run Maven Target" and then use the button to set the target. This will become the default configuration for all JUnit tests in the project when you type ctrlshiftF10, even for test run definitions you do not save.
Hope that helps.
Done.
http://www.jetbrains.net/jira/browse/IDEA-17325
BTW according to the comments in the JIRA issue this should actually be how it works now (and has worked for ages). Any counter examples?
Cheers,
Colin