This option applies only to projects with multiple modules. Basically, it tells Gradle to configure modules that apply only to requested tasks, and not to configure them all by default.
To more accurately answer your questions:
- No, you do not need to run the setup manually.
- Yes, something may go wrong as stated in the documentation. The function should work very well for multi-project builds that are untied projects.
In the "On-demand configuration" mode, projects are configured as follows:
- The root project is always configured. Thus, a standard common configuration is supported (all projects or script subprojects).
- The project in the directory in which the assembly is performed is also configured, but only when Gradle is executed without any tasks. Thus, default tasks behave correctly when projects are configured on demand.
- Standard project dependencies are supported and related projects are configured. If project A has a dependency on compiling project B, then building A causes the configuration of both projects.
- It supports task dependencies declared through the path to the task and cause the configuration of the corresponding projects. Example: someTask.dependsOn (
:someOtherProject:someOtherTask ) - The task requested through the task path from the command line (or Tooling API) invokes the configuration of the corresponding project. For example, building
projectA:projectB:someTask calls the projectB configuration.
Here is the full documentation.
source share