You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a way to express "dependency on Buildable" in user code (e.g. in domain objects).
For instance, something like providers.fromBuildable(buildable).map { ... }...
Sample use case is to consume org.gradle.api.publish.PublicationArtifact which implements Buildable and exposes getFile(): File method:
* @param tasks The tasks. These are evaluated as per {@link org.gradle.api.Task#dependsOn(Object...)}.
*/
voidbuiltBy(Object... tasks);
Well, of course, it would be nice if PublicationArtifact exposed something like getRegularFile(): Property<RegularFile> that included the dependency automatically, however being able to convert Buildable to Provider<Void> would probably be nice.
Current Behavior
Currently, Property<Buildable> is not compatible with the configuration cache.
// Configuration cache is not supported yet since
// Task `:sigstoreSignMavenPublication` of type `dev.sigstore.sign.tasks.SigstoreSignFilesTask`:
// cannot serialize object of type 'org.gradle.api.publish.maven.tasks.GenerateMavenPom',
// a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
Context
I'm trying to support the configuration cache for Sigstore Gradle plugin:
I've been able to workaround the case via using a "private" ConfigurableFileCollection.
I store no files in the collection, however, I use it's ConfigurableFileCollection#builtBy methods to add Buildable dependencies.
For instance, what if I want to create a property based on FileCollection (e.g. take "task dependencies" from there), and Provider.map it to some other type (e.g. number of files within the collection)?
Having something to embed "task dependency" into a provider would be helpful in my point of view.
Another possibility is to add builtBy(...) into the Property, however, that might be too much.
Expected Behavior
There should be a way to express "dependency on
Buildable
" in user code (e.g. in domain objects).For instance, something like
providers.fromBuildable(buildable).map { ... }...
Sample use case is to consume
org.gradle.api.publish.PublicationArtifact
whichimplements Buildable
and exposesgetFile(): File
method:gradle/subprojects/publish/src/main/java/org/gradle/api/publish/PublicationArtifact.java
Lines 28 to 39 in f632e1a
Well, of course, it would be nice if
PublicationArtifact
exposed something likegetRegularFile(): Property<RegularFile>
that included the dependency automatically, however being able to convertBuildable
toProvider<Void>
would probably be nice.Current Behavior
Currently,
Property<Buildable>
is not compatible with the configuration cache.Context
I'm trying to support the configuration cache for Sigstore Gradle plugin:
The text was updated successfully, but these errors were encountered: