This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 434
Gradle should accept Kotlin lambdas as a lazy construct for e.g. files #1077
Comments
The file notation conversion also unpacks val srcDir = file("src")
val collection = layout.files(provider { srcDir.listFiles() })
println(collection.files) |
4 tasks
What makes this confusing is that the complete error message:
doesn't mention |
bamboo
added a commit
to gradle/gradle
that referenced
this issue
Sep 14, 2018
bamboo
added a commit
to gradle/gradle
that referenced
this issue
Sep 28, 2018
eskatos
changed the title
FileCollections cannot be created from Kotlin lambda
Gradle should accept Kotlin lambdas as a lazy construct for e.g. files
Nov 6, 2018
@eskatos The error message also doesn't mention that it can accept collections of any of those items as well. |
bamboo
added a commit
to gradle/gradle
that referenced
this issue
Nov 13, 2018
- Let `PathNotationConverter` handle result of `Callable`/`Closure` uniformly - Allow Kotlin lambda as deferred path/file notation Resolves gradle/kotlin-dsl-samples#1077
bamboo
added a commit
to gradle/gradle
that referenced
this issue
Dec 6, 2018
Done in gradle/gradle#7739 and gradle/gradle#7966 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
Current Behavior
Context
See https://docs.gradle.org/current/userguide/working_with_files.html#example_implementing_a_file_collection
The file notation conversion unpacks Groovy Closures, one can expect it to also unpack Kotlin lambdas. This applies to many other APIs, see e.g. https://docs.gradle.org/current/userguide/working_with_files.html#sec:specifying_multiple_files
Your Environment
Gradle 4.10
The text was updated successfully, but these errors were encountered: