From 6eff41b13dc83586d3e6a26e1f59d8661a5974e5 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 1 Jan 2024 14:03:32 +0100 Subject: [PATCH] refactor: Make the `coordinates()` parameters nullable (#691) Allow to set only specific (non-null) arguments. --- .../vanniktech/maven/publish/MavenPublishBaseExtension.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBaseExtension.kt b/plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBaseExtension.kt index 0b3521b8..07cc3730 100644 --- a/plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBaseExtension.kt +++ b/plugin/src/main/kotlin/com/vanniktech/maven/publish/MavenPublishBaseExtension.kt @@ -166,10 +166,10 @@ abstract class MavenPublishBaseExtension( * artifactIds like `[artifactId]-jvm`. */ @Incubating - fun coordinates(groupId: String, artifactId: String, version: String) { - groupId(groupId) - artifactId(artifactId) - version(version) + fun coordinates(groupId: String? = null, artifactId: String? = null, version: String? = null) { + groupId?.also { groupId(it) } + artifactId?.also { artifactId(it) } + version?.also { version(it) } } private fun groupId(groupId: String) {