Justin Tullgren
04/24/2024, 6:52 PMconfiguration
into another project when that configuration is exposed? I have set up a producer configuration and I am consuming it in a project as shown in the docs but there are multiple producers to a single consumer and the copy task resolves thinks there are duplicates when i really want it to copy both into their respective name. I see two artifacts in the resolved configuration, both folders, but it appears that is not enough.tapchicoma
04/24/2024, 7:49 PMJustin Tullgren
04/24/2024, 7:55 PMimplementation
configuration. One consumer consuming multiple artifacts using the same configuration name but not the same artifact name.
// The consumer
dependencies {
customImplementation(projects.projectA)
customImplementation(projects.projectB)
}
Where projectA
and projectB
produce an artifact:
val producerConfiguration = configurations.create(moduleProducer) {
isCanBeResolved = true
isCanBeConsumed = true
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(moduleProducer))
}
}
val assemble = register<Copy>(customAssemble) {
dependsOn(assembleTasks)
from(buildAssembledDir)
into(buildOutputsDir)
}
artifacts {
add(moduleProducer, assemble)
}
Justin Tullgren
04/24/2024, 7:57 PMval implementationConfiguration = configurations.create(customImplementation) {
isCanBeResolved = true
isCanBeConsumed = false
attributes {
attribute(
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(
LibraryElements::class.java,
moduleProducer
)
)
}
}
Justin Tullgren
04/24/2024, 7:58 PMregister<Copy>(assembleCustom) {
from(implementationConfiguration)
into(depsFolder)
}
tapchicoma
04/24/2024, 8:03 PMdepsFolder
?Justin Tullgren
04/24/2024, 8:48 PMJustin Tullgren
04/24/2024, 8:49 PMJustin Tullgren
04/24/2024, 8:49 PMtapchicoma
04/24/2024, 8:53 PMAbstractCopyTask
Adam S
04/24/2024, 10:12 PMval assemble = register<Copy>(customAssemble) {
dependsOn(assembleTasks)
from(buildAssembledDir) {
into(project.name) // generate each project's output into a distinct dir
}
into(buildOutputsDir)
}
That way the output of each project will be in a distinct directory, so when you merge multiple directories together, the files won't clash?Justin Tullgren
04/25/2024, 1:54 PMJustin Tullgren
04/25/2024, 1:59 PM