Allow publication artifacts to be defined as files through providers *Updated solution based on feedback to #11329*
This used to work in Gradle 5.5 (see #11054).
The combination of #9467 and #6775 broke this.
A builtBy dependency is added if the artifact is a TaskDependencyContainer, which all Providers are (#9467). This dependency was silently doing nothing in case of a plain File/String. This became an error (#6775) because a File/String is nothing that can be resolved to a task.
We now only add a builtBy dependency, if the provider value or content is actually produced by a task.