What do you call a flock of baby sheep rolling down a hill? A lambslide (rimshot)
I also never understood the Groovy hate, for mostly the reasons you list there Ken.
I won't be able to get the Lion Sleeps Tonight out of my mind.
The Kotlin version of the unzip task can be simplified:
tasks.register<Copy>("unzip") {
from(zipTree(tasks.named<Zip>("zip").map { it.archiveFile }))
into(layout.buildDirectory.dir("expanded"))
}
```
You don't need to get the file out of the `archiveFile`, you didn't do that in Groovy, either. Note that the task dependency is inferred as well, since the `archiveFile` carries the task dependencies, as seen in this build scan: https://ge.gradle.org/s/7l2dupq4uvvss/timeline?details=dbh7ehvqq2xq2&show=predecessors
If you don't like the `map`, you can also force the realization of the zip task by using the first get:
from(zipTree(tasks.named<Zip>("zip").get().archiveFile))
That is much simpler. Thanks! Looks like I'll need to make another video :-)
I also never understood the Groovy hate, for mostly the reasons you list there Ken.
I won't be able to get the Lion Sleeps Tonight out of my mind.
The Kotlin version of the unzip task can be simplified:
tasks.register<Copy>("unzip") {
from(zipTree(tasks.named<Zip>("zip").map { it.archiveFile }))
into(layout.buildDirectory.dir("expanded"))
}
```
You don't need to get the file out of the `archiveFile`, you didn't do that in Groovy, either. Note that the task dependency is inferred as well, since the `archiveFile` carries the task dependencies, as seen in this build scan: https://ge.gradle.org/s/7l2dupq4uvvss/timeline?details=dbh7ehvqq2xq2&show=predecessors
If you don't like the `map`, you can also force the realization of the zip task by using the first get:
```
tasks.register<Copy>("unzip") {
from(zipTree(tasks.named<Zip>("zip").get().archiveFile))
into(layout.buildDirectory.dir("expanded"))
}
```
That is much simpler. Thanks! Looks like I'll need to make another video :-)