What Gradle task is used to build when "Delegate IDE build/run actions to Gradle" is enabled?
Answered
What Gradle task is used to build when "Delegate IDE build/run actions to Gradle" is enabled? Is it `build`? `assemble`? Something else?
If I have a composite build, does IntelliJ only directly run tasks on the composite? Or does IntelliJ ever directly run tasks from included builds?
Please sign in to leave a comment.
It depends on the module (in particular depends on the available tasks of the related gradle project).
The general rules are as following:
E.g. for the main source set => `classes`
for test sources set => `testClasses`
for other custom source sets => `sourceSetName + "Classes"` // this is supported if the `Create separate IDE module per source set` option is enabled
For composite builds, there is no possibility to run tasks of the included build using the `main` composite root build in Gradle.
However IDEA knows the available tasks and root path of the included builds and uses them directly.This should work for running Gradle task using the IDEA Gradle tool window and automatically when the build is delegated.
To repeat similar in terminal you have to `cd` into the folders of the included builds or use `--build-file`, `--project-dir` Gradle command line options.