This message was deleted.
# plugin-development
s
This message was deleted.
v
The "bar" in what you showed it just used for logging afair, to for example say "output file X for property bar changed", but you cannot use it for the wiring.
You do not have a property "bar" in your task, you just have a "property name"
Either make it a full class, which can also be done within the build script, to have it as full property, or do it differently like
Copy code
val bar: RegularFileProperty = ...
val sourceTask = tasks.register("sourceTask") {
  outputs.dir(...).withPropertyName("foo")
  outputs.file(bar).withPropertyName("bar")
}
val other by tasks.existing {
  theInput = bar
}
I'm not sure whether the implicit task dependency is forwarded though in this case like it is for a proper property of a full class, so it might be necessary to instead do
Copy code
theInput = sourceTask.map { bar }
or something like that.
And at some point you should think about moving all this logic better into a proper custom task and / or plugin. 🙂
k
It's kludgey either way, true. It's one of those things where in order to replace this terrible Gradle code with better Gradle code, you need to add kludges to the terrible Gradle code first.
👌 1