Hi! Is the artifact transformer expected to run on...
# community-support
j
Hi! Is the artifact transformer expected to run once per project, even if it physically handles the same input artifact? I have
projectA
and
projectB
that have my plugin applied (published to
mavenLocal
to avoid questions), request the same dependency, which provides a ZIP archive. My
ExtractorTransformer
Copy code
@CacheableTransform
abstract class ExtractorTransformer @Inject constructor(
    private val archiveOperations: ArchiveOperations,
    private val fileSystemOperations: FileSystemOperations,
) : TransformAction<TransformParameters.None> {

    @get:PathSensitive(PathSensitivity.NAME_ONLY)
    @get:InputArtifact
    abstract val inputArtifact: Provider<FileSystemLocation>

    override fun transform(outputs: TransformOutputs) { ... }
}
extracts content to
outputs.dir("myDirectory")
Unfortunately, each project receives a different result: •
/Users/hsz/.gradle/caches/transforms-4/be0b936cf16986364a85a818a5917249/transformed/myDirectory/…
/Users/hsz/.gradle/caches/transforms-4/9dd0b15bb0cb7459c7b02005374440bb/transformed/myDirectory/…
Given the extracted content is pretty huge and we count it in GB, this may be a problem to end-users.