DaemonParameters (BuildLayoutParameters layout) { // Constructors have changed for different versions of Gradle, need to use the correct version by reflection GradleVersion gradleBaseVersion = GradleVersion.current().getBaseVersion(); if (gradleBaseVersion.compareTo(GradleVersion.version("6.6")) >= 0) { // DaemonParameters(BuildLayoutResult, FileCollectionFactory) with DefaultFileCollectionFactory using // DefaultFileCollectionFactory(PathToFileResolver, TaskDependencyFactory, DirectoryFileTreeFactory, Factory<PatternSet>, // PropertyHost, FileSystem) using IdentityFileResolver() return daemonParameters6Dot6(layout); } else if (gradleBaseVersion.compareTo(GradleVersion.version("6.4")) >= 0) { // DaemonParameters(BuildLayoutParameters, FileCollectionFactory) with DefaultFileCollectionFactory using // DefaultFileCollectionFactory(PathToFileResolver, TaskDependencyFactory, DirectoryFileTreeFactory, Factory<PatternSet>, // PropertyHost, FileSystem) using IdentityFileResolver() return daemonParameters6Dot4(layout); } else if (gradleBaseVersion.compareTo(GradleVersion.version("6.3")) >= 0) { // DaemonParameters(BuildLayoutParameters, FileCollectionFactory) with DefaultFileCollectionFactory using // DefaultFileCollectionFactory(PathToFileResolver, TaskDependencyFactory, DirectoryFileTreeFactory, Factory<PatternSet>, // PropertyHost, FileSystem) return daemonParameters6Dot3(layout); } else if (gradleBaseVersion.compareTo(GradleVersion.version("6.0")) >= 0) { // DaemonParameters(BuildLayoutParameters, FileCollectionFactory) with DefaultFileCollectionFactory using // DefaultFileCollectionFactory(PathToFileResolver, TaskDependencyFactory, DirectoryFileTreeFactory, Factory<PatternSet>) return daemonParameters6Dot0(layout); } else if (gradleBaseVersion.compareTo(GradleVersion.version("5.3")) >= 0) { // DaemonParameters(BuildLayoutParameters, FileCollectionFactory) with DefaultFileCollectionFactory constructor with no parameters return daemonParameters5Dot3(layout); } else { // DaemonParameters(BuildLayoutParameters) return daemonParametersPre5Dot3(layout); } }