Skip to content

Commit

Permalink
Improve layer createdBy convention
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Dec 21, 2024
1 parent 38a7c72 commit 4bd6b5b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,26 @@ internal abstract class OciImageDefinitionImpl @Inject constructor(
private val imageDefName: String,
platform: Optional<Platform>,
objectFactory: ObjectFactory,
providerFactory: ProviderFactory,
private val taskContainer: TaskContainer,
private val projectLayout: ProjectLayout,
project: Project,
) : OciImageDefinition.Variant.Layer {

private val platform: Platform? = platform.orElse(null)
final override val metadata = objectFactory.newInstance<OciImageDefinition.Variant.Layer.Metadata>().apply {
createdBy.convention("gradle-oci: $name")
createdBy.convention(providerFactory.provider {
buildString {
append("${project.group}:${project.name}:${project.version}")
if (imageDefName != MAIN_NAME) {
append(" > $imageDefName image")
}
if (name != MAIN_NAME) {
append(" > $name")
}
append(" (gradle-oci)")
}
})
}

private var task: TaskProvider<DefaultOciLayerTask>? = null
Expand Down

0 comments on commit 4bd6b5b

Please sign in to comment.