This message was deleted.
# community-support
s
This message was deleted.
n
you should apply the convention in the plugin that creates an instance of the extension
the extension itself should be as "dumb" as possible and not be aware of any defaults that might exist for the plugin
👍 2
g
so, like this
Copy code
val setting = project.extensions.create<MagikExtension>("magik").apply { 
    commitWithChanges.convention(false)
}
and this will be set before the user may set anything in its own? Also, shall I ditch
Properties
for plain primitive? I'm quite tempted to do so..
n
I'd just go with
setting.commitWithChanges.convention(false)
. Seems more straightforward to me. Properties give you the possibility for lazy evaluation. Wherever you use the extension properties, you should link them to a task property, so that they're only evaluated when they're actually being used. Aka during task execution and not earlier.
👍 2
note that I don't think you're supposed to add annotations like
@get:Input
on an extension, as extensions technically don't have any inputs or outputs, they're just a bucket of configuration values. It's the tasks that have inputs and outputs. I might be wrong on that point though.
g
uh, right, thanks
👌 1
v
Iirc you could use the extension as
@Nested
input on a task and then the annotations on the extension would be relevant. But you really shouldn't do that, but linke the individual properties together.
👍 2