This message was deleted.
# community-support
s
This message was deleted.
v
same?
c
Maybe, I guess I should have tried it. intelliJ says that map doesn't exist on subprojects though... I dislike groovy 🤣😉
v
Ah, wait, you asked the other way around 😄
Why should on want to switch to Groovy DSL :-D
💥 1
c
I don't but I'm not going to migrate this existing project to kotlin right now
I copied my own kotiln code to add functionality that I use on a regular basis. I just don't know the quick way to migrate this
v
map
in Kotlin is
collect
in Groovy
But well, of course the Kotlin version is doing task configuration avoidance while the Groovy version of it is not.
Groovy version with lazy would probably be something like
Copy code
tasks.named('dependencies') {
   dependsOn(subprojects*.tasks*.matching { it.name == 'dependencies' })
}
or something like that.
c
Thanks, I'll try it tomorrow.
v
Hm, no, that's not good either, it will also break task configuration avoidance and that for all tasks
Maybe
Copy code
tasks.named('dependencies') {
   dependsOn(subprojects.collect { "${it.path}:dependencies" })
}
👍 2
j
☝️ that's what I would also do (using a string to "lazily" access the tasks in the subprojects). You can drop the
.configure
if you like. It's also lazy without it:
tasks.named('dependencies') { ... }
👍 1
v
Ah, yeah, right. Was late, thanks. 😄
c
thanks guys, you're the best!
👌 1