Slackbot
02/17/2022, 11:59 PMZak Taccardi
02/18/2022, 12:00 AMProvider<Task> is the dependsOn(..) type, the task dependency ends up being ignoreddaniel
02/18/2022, 2:02 AMProvider<Task> you should be fine. Basically, the flatMap will use the task dependencies of the returned provider from the transform. At the dependsOn level, you can also use a Callable which can return anything Gradle understand as a dependency, i.e. task path as String, task instance or Provider. Not that every time Gradle is face with a Provider it would unpack the value for the implicit task dependencies but instead use whatever the provider returns (which is an internal feature hence “implicit”). It all boils down to map (use this provider dependencies) vs flatMap (use returned provider dependencies).Zak Taccardi
02/22/2022, 2:07 AMmap and flatMap suffer this problemZak Taccardi
02/22/2022, 2:10 AMval deviceTestRunner: Provider<String> = // gradle property..
dependsOn(
when (deviceTestRunner.get()) {
MARATHON -> marathonTask
SPOON -> spoonTask
AGP_CONNECTED -> agpConnectedTask
null -> error("was null")
}
)Zak Taccardi
02/22/2022, 2:10 AM