Can I prevent the creation of test configuration tasks?

I have a multi-project build system and I am wondering if it is possible to prevent the creation of test tasks during the configuration phase? Not using/running any tests - would preventing the creation of test tasks in configuration phase speedup the build in any way?

Creating configuration testFlavor1Flavor2Flavor3Flavor4Compile.
Creating configuration testFlavor1Flavor2Flavor3Flavor4ReleaseApk.
Creating configuration testFlavor1Flavor2Flavor3Flavor4Provided.
Creating configuration testFlavor1Flavor2Flavor3Flavor4App.

You could make the application of the plugin that creates the tasks conditional but task creation is a very efficient operation and got much better in later versions of Gradle so that is not a valid reason to go there.

Having tasks that perform expensive operations in configuration phase is bad task design and can be addressed on a case by case. That typically causes slow configuration which is bad if that configuration never results in a task execution that uses the configuration.

1 Like

@noway From the configuration names I see you are using the Android plugin. This plugin will get much more efficient in version 2.3. The Android team is already releasing 2.3-alpha versions.

1 Like

Thanks for information @st_oehme and @Alex_Vol. Judging from the comments I guess it is a bad idea. Will wait for newer version of gradle plugin.