Zak Taccardi
03/14/2024, 12:05 AMinterface ArtifactoryPublisherPublishDetails : Named {
val group: Property<String>
val version: Property<String>
// Should be in a folder `artifactId`/`filename`
// this is just the file name
val files: ListProperty<String>
}
However, when I access anything in this interface, I get the following exception:
Receiver class Build_gradle$ArtifactoryPublisherExtension$ArtifactoryPublisherPublishDetails$Impl does not define or inherit an implementation of the resolved method 'abstract org.gradle.api.provider.Property getGroup()' of interface Build_gradle$ArtifactoryPublisherExtension$ArtifactoryPublisherPublishDetails.
usage:
val artifactId: String = // ..
val publishDetails: ArtifactoryPublisherPublishDetails = objects.named<ArtifactoryPublisherPublishDetails>(
"${artifactId}ArtifactoryPublisherPublishDetails"
)
publishDetails.group // this line throws
Should what I’m trying to do work?Zak Taccardi
03/14/2024, 12:16 AMval publishDetails: ArtifactoryPublisherPublishDetails = objects.newInstance<ArtifactoryPublisherPublishDetails>()
and drop the Named
inheritanceThomas Broyer
03/14/2024, 8:41 AMNamed
(could be useful for debugging) then you have to explicitly implement the interface and pass the value generally to the constructor (through an argument to newInstance
), unless the name is a constant of course.