can you create a task, that configures another at ...
# community-support
c
can you create a task, that configures another at runtime? if I wanted to change publishing settings later...
t
you would have to write the config to a file and have the task that needs it read it from said file
c
eww
t
guess it also depends on if that config needs to be considered as a task input for caching. something else I've done is put things is a build service map that tasks can read from later. roughly: launchWebSocketConnectionTask -> doExpensiveRemoteThingWithWebSocketTask -> closeWebsocketTask the build service just holds the websocket connection object through them all.
in that flow the only cachable task is the doExpensive task. all the critical inputs are on the task as regular input annotated properties
c
yeah... I mean, the desire was to have a task that doesn't configure the publish plugin until right before publish (or whatever step) is called
so that it's not run during
build
v
If you do not intend to use configuration cache, one task can configure another task that is going to run after that. But it is bad practice and discouraged, especially because of incompatibility with configuration cache.
m
so that it's not run during
build
publish${Publication}To${Repository}
shouldn't be a dependency of
build
.
At least not by default
c
it's not but the whole F-ing configuration is always done, and I was trying to think of a way to make it lazier so pom's aren't generated and configuration of pom isn't done
etc
m
Yea, lazy configuration for publishing is still on the todo list IIRC
v
Hopefully we get it with the great
Property
-ization with Gradle 9
🤞 1
m
Was going to link an issue but looks like you're aware of it 😄 https://github.com/gradle/gradle/issues/29342
👍 1
c
yeah, I was retooling my convention plugin, tried to make an extension and it blew up
so I had to go back to the drawing board