This message was deleted.
# community-support
s
This message was deleted.
t
Hello 👋 Can you try to configure task relying on task container instead. Below comes the pseudo code.
Copy code
def compileShmStaticLibraryShmCpp = tasks.named(":qgi:compileShmStaticLibraryShmCpp")
def compileUdsStaticLibraryUdsCpp = tasks.named(":qgi:compileUdsStaticLibraryUdsCpp")

platforms.each { platform ->
  tasks.register(name: "copyDependentDebugObjects${platform.capitalize()}", type: Copy) {
  // you need to sneak peek into the implementation of task to figure its output file
from(compileShmStaticLibraryShmCpp.map { it.output })
from(compileUdsStaticLibraryUdsCpp.map { it.output })
  into(project.layout.buildDirectory.dir("/objs/main/shared/mainCpp/${platform}"))
}
When you
named
and
register
will give you
Provider<Task>
types. Then with
map
or
flatMap
you can access outputs of the task and wire them inputs to the task you register. This allows you avoid explicitely setting using
dependsOn
as well as this would follow the task configuration avoidance mantra.
d
@Tom Koptel thanks for the insight. Will give it a try now.
🤞 1