Skip to content

Commit

Permalink
refactor: Make the coordinates() parameters nullable (#691)
Browse files Browse the repository at this point in the history
Allow to set only specific (non-null) arguments.
  • Loading branch information
sschuberth authored Jan 1, 2024
1 parent 0d38945 commit 6eff41b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6eff41b

Please sign in to comment.