This message was deleted.
# community-support
s
This message was deleted.
c
Like this:
public abstract class ReleasePlugin @Inject constructor(private val layout : ProjectLayout) : Plugin<Project> {
that’s for a plugin but available wherever you create managed objects via extensions.create or objects.newInstance.
z
ProjectLayout
does not contain the
project.path
though
c
is projectDir not sufficient?
z
Of the unique ID for the task name, given
":my-project:abc:taskName"
I want
":my-project:abc"
c
ah i see. that can’t be injected, to my knowledge. but you can set it as a convention on an extension property in a plugin (or likewise on a task property). e.g.
ext.myProp.convention(project.path)
It’s all possible to inject other constructor parameters via extensions.create, which could be used to provide project.path in the extensions constructor. More info: https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtensionAware.html