diff --git a/README.md b/README.md index 87f42ea..aeaa233 100644 --- a/README.md +++ b/README.md @@ -181,8 +181,8 @@ All of the block's fields are optional: ```groovy snapshotPublisher { fabric { - distributionEmails = [] - distributionGroupAliases = [] + distributionEmails = "" + distributionGroupAliases = "" distributionNotifications = true } // ... @@ -190,7 +190,10 @@ snapshotPublisher { ``` - `distributionEmails`: The list of email addresses of those who'll get the release. +This value is built by joining all emails with commas. +For example if you want to distribute the build to `email1@mail.com` and `email2@mail.com`, `distributionEmails` value should be `"email1@mail.com,email2@mail.com"`. - `distributionGroupAliases`: The list of names (aliases) of the groups defined inside Fabric's Beta that will get the release. +As well as `distributionEmails`, all aliases must be joined by commas. - `distributionNotifications`: If set to `true`, all build's recipients will get an email notification about the release. > Note: Fabric's Beta limits your release notes to a maximum of 16384 characters. diff --git a/src/main/kotlin/com/xmartlabs/snapshotpublisher/Constants.kt b/src/main/kotlin/com/xmartlabs/snapshotpublisher/Constants.kt index 2d9df69..6384929 100644 --- a/src/main/kotlin/com/xmartlabs/snapshotpublisher/Constants.kt +++ b/src/main/kotlin/com/xmartlabs/snapshotpublisher/Constants.kt @@ -47,7 +47,7 @@ Last Changes: $RELEASE_NOTES_COMMIT_HISTORY_KEY """ - val FABRIC_DEPLOY_DISTRIBUTION_EMAILS_DEFAULT_VALUE = listOf() - val FABRIC_DEPLOY_DISTRIBUTION_GROUP_ALIASES_DEFAULT_VALUE = listOf() + const val FABRIC_DEPLOY_DISTRIBUTION_EMAILS_DEFAULT_VALUE = "" + const val FABRIC_DEPLOY_DISTRIBUTION_GROUP_ALIASES_DEFAULT_VALUE = "" const val FABRIC_DEPLOY_DISTRIBUTION_NOTIFICATIONS_DEFAULT_VALUE = true } diff --git a/src/main/kotlin/com/xmartlabs/snapshotpublisher/model/FabricReleaseConfig.kt b/src/main/kotlin/com/xmartlabs/snapshotpublisher/model/FabricReleaseConfig.kt index 785c8db..d3969b7 100644 --- a/src/main/kotlin/com/xmartlabs/snapshotpublisher/model/FabricReleaseConfig.kt +++ b/src/main/kotlin/com/xmartlabs/snapshotpublisher/model/FabricReleaseConfig.kt @@ -3,7 +3,7 @@ package com.xmartlabs.snapshotpublisher.model import com.xmartlabs.snapshotpublisher.Constants open class FabricReleaseConfig { - var distributionEmails: List? = Constants.FABRIC_DEPLOY_DISTRIBUTION_EMAILS_DEFAULT_VALUE - var distributionGroupAliases: List? = Constants.FABRIC_DEPLOY_DISTRIBUTION_GROUP_ALIASES_DEFAULT_VALUE + var distributionEmails: String? = Constants.FABRIC_DEPLOY_DISTRIBUTION_EMAILS_DEFAULT_VALUE + var distributionGroupAliases: String? = Constants.FABRIC_DEPLOY_DISTRIBUTION_GROUP_ALIASES_DEFAULT_VALUE var distributionNotifications: Boolean = Constants.FABRIC_DEPLOY_DISTRIBUTION_NOTIFICATIONS_DEFAULT_VALUE } diff --git a/src/main/kotlin/com/xmartlabs/snapshotpublisher/task/PrepareFabricReleaseTask.kt b/src/main/kotlin/com/xmartlabs/snapshotpublisher/task/PrepareFabricReleaseTask.kt index afddd33..9b1e67a 100644 --- a/src/main/kotlin/com/xmartlabs/snapshotpublisher/task/PrepareFabricReleaseTask.kt +++ b/src/main/kotlin/com/xmartlabs/snapshotpublisher/task/PrepareFabricReleaseTask.kt @@ -28,8 +28,10 @@ open class PrepareFabricReleaseTask : DefaultTask() { fun action() { val fabric = project.snapshotReleaseExtension.fabric with(releaseFabricTask.extensions) { - add(BETA_DISTRIBUTION_EMAILS_EXTENSION_NAME, fabric.distributionEmails.toFabricStringList()) - add(BETA_DISTRIBUTION_GROUP_ALIASES_EXTENSION_NAME, fabric.distributionGroupAliases.toFabricStringList()) + fabric.distributionEmails + ?.let { add(BETA_DISTRIBUTION_EMAILS_EXTENSION_NAME, it) } + fabric.distributionGroupAliases + ?.let { add(BETA_DISTRIBUTION_GROUP_ALIASES_EXTENSION_NAME, it) } add(BETA_DISTRIBUTION_NOTIFICATIONS_EXTENSION_NAME, fabric.distributionNotifications) add(BETA_DISTRIBUTION_RELEASE_NOTES_EXTENSION_NAME, getReleaseNotes()) } @@ -37,6 +39,4 @@ open class PrepareFabricReleaseTask : DefaultTask() { private fun getReleaseNotes() = ReleaseNotesGenerator.truncateReleaseNotesIfNeeded(generatedReleaseNotesFile.readText(), MAX_RELEASE_NOTES_LENGTH) - - private fun List?.toFabricStringList() = this?.joinToString(",") ?: "" }