2

Is there a way to have a run configuration in intellij depend on running a gradle task first? In the Before launch options, gradle is not an option. There is an option to run an external tool, and I can add gradle there, but I don't want to hard code the parameters in there. I want to be able to run gradle with different tasks before different run configurations.

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
  • Why again does running an external tool not satisfy this need? Can't you specify different external tool (parameters) per run configuration? – Peter Niederwieser Aug 05 '13 at 17:09
  • It doesn't look like you can set parameters per configuration, or at least I can't figure out how. I wanted to run one integration test (just like I could a unit test from intellij) but it requires some setup tasks to be run (via gradle). Though using your answer to http://stackoverflow.com/questions/18061774/run-single-integration-test-with-gradle/18062523?noredirect=1#18062523, I can just run all of my tasks purely through gradle and launch the gradle task through the IDE. I can create different gradle configurations that run the same gradle task, so this satisfies my need. – Jeff Storey Aug 05 '13 at 17:30

1 Answers1

4

You can create a new run configuration -say B -, which is based on Gradle with the IntelliJ Gradle Integration.

Then go to your actual run configuration - say A-. In the Before Launch Options for A you can choose: Another Run Configuration, which should be B

Jan Weitz
  • 444
  • 4
  • 11