This message was deleted.
# community-support
s
This message was deleted.
v
Sure, you can just create a publication and configure your task as artifact for it. But iirc the cleaner way would be to define a custom component and publish that.
m
Sorry, I meant the other way around, I want to call
publications.create("")
based on the result of a task
v
How is that the other way around?
m
That sounds like it's modifying the task graph during execution, right?
my tasks returns a list of ids
For each id I want to create a publication
v
Oh, ok
That's probably pretty tricky, unless you can refactor it so that this list is generated by some included build or something like that maybe
๐Ÿ‘€ 1
m
The use case is I want to create plugin marker publications based on an Annotation processor:
Copy code
@GradlePlugin(
  id = "com.example",
  description = "cool stuff"
)
abstract class MyPlugin: Plugin<Project> {
  ...
}
Yea, maybe with included builds but then it's not simplifying so much ๐Ÿ˜„
(endgoal is removing the
gradlePlugins {}
block)
v
Well, the precompiled script plugin plugins do something like this. But I guess they just look at the filenames present maybe.
๐Ÿ’ก 1
But you could check there.
p
Regarding plugins, you could also write your plugin with the precompiled โ€žsyntaxโ€œ and as a side effect, your plugin is registered automatically.
v
But better for the Kotlin ones. Iirc the Gradle one does bad action in
afterEvaluate
or something like that, making it hard to configure those publications then.
p
Oh I was too slow ๐Ÿ˜
v
No you were not, I did not mean to write precompiled script plugins, which is an option too of course
I meant to check how the plugins that handle them do it
p
But even with precompiled script plugins the gradle plugin block is still needed to set the display name and a description. But yes, the plugin โ€žjustโ€œ iterates over the files.
m
I see. I think I'll keep the
gradlePlugins {}
for now. Sounds like it's not worth the extra hoops. Thanks anyways for the ideas!
๐Ÿ‘Œ 1