Hi everyone, has anyone added a custom gradle task...
# compose-desktop
r
Hi everyone, has anyone added a custom gradle task in the
packageReleaseDistributionForCurrentOs
graph before? I'm trying to bundle an
adb
executable with my compose application, but cannot seem to locate any of the tasks from the compose plugin using
tasks.named
,
tasks.findByPath
, or plainly
tasks[]
. I keep getting
"Task with name <name> not found in root project <project-name>"
The intent is to add a task to copy it in to
compose/tmp/main/runtime/bin
before the actual
packageReleaseMsi
task is run. I'm attempting to do
Copy code
tasks.named("packageReleaseMsi") {
    dependsOn(bundleAdb)
}
where
bundleAdb
is a
Copy
task created with the
tasks.registering
delegate.
Update: This seems to work
Copy code
tasks.withType<AbstractJPackageTask> {
    dependsOn(bundleAdb)
}
I suppose this is preferable, actually, since it should cover any of
packageRelease*
tasks
The error I would get when using
tasks.named
is still curious nonetheless.
s
Does it help to put that into an
Copy code
afterEvaluate {}
block?
r
I think I see what you mean, it could be useful improvement if I need to only add this task under certain conditions etc