Slackbot
09/07/2023, 6:07 PMVampire
09/07/2023, 6:35 PMVampire
09/07/2023, 6:36 PMCaleb Cushing
09/07/2023, 6:36 PMVampire
09/07/2023, 6:36 PMval available = tasks.register("tests available") {
val ss = sourceSets;Caleb Cushing
09/07/2023, 6:36 PMVampire
09/07/2023, 6:37 PMsourceSets and use it at runtime.
So it is tried to be serialized into configuration cache.
And that is not supportedCaleb Cushing
09/07/2023, 6:37 PMCaleb Cushing
09/07/2023, 6:38 PMCaleb Cushing
09/07/2023, 6:41 PMVampire
09/07/2023, 6:42 PMval available = tasks.register("tests available") {
val java: Provider<FileCollection> = sourceSets.test.map { it.java }
doLast {
if (java.get().isEmpty) throw RuntimeException("no tests found")
}
}Caleb Cushing
09/07/2023, 6:47 PM> Task :app:tests available FAILED
Caching disabled for task ':app:tests available' because:
Gradle would require more information to cache this task
Task ':app:tests available' is not up-to-date because:
Task has not declared any outputs despite executing actions.Caleb Cushing
09/07/2023, 6:49 PMVampire
09/07/2023, 6:50 PMCaleb Cushing
09/07/2023, 6:51 PMFAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:tests available'.
> class org.gradle.api.internal.file.collections.FileTreeAdapter cannot be cast to class org.gradle.api.file.SourceDirectorySet (org.gradle.api.internal.file.collections.FileTreeAdapter and org.gradle.api.file.SourceDirectorySet are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @1b701da1)Caleb Cushing
09/07/2023, 6:54 PMProvider< type...Caleb Cushing
09/07/2023, 6:54 PMCaleb Cushing
09/07/2023, 6:54 PMCaleb Cushing
09/07/2023, 6:55 PMCaleb Cushing
09/07/2023, 6:55 PM