BreadMoirai / github-release-gradle-plugin

A Gradle Plugin to send Releases to Github
Apache License 2.0
108 stars 26 forks source link

Simplify interactions with githubRelease extension properties #63

Closed tylerbertrand closed 1 year ago

tylerbertrand commented 1 year ago

Hi 👋

This PR would make the change to use Strings over CharSequence for githubRelease extension properties.

Interacting with CharSequence githubRelease extension properties can result in some syntactical overhead. As an example, when using the tagName from the githubRelease extension, passing that value to another API requires converting that value to a String. This applies to both Groovy and Kotlin.

Groovy:

tagName = githubRelease.tagName.map { it.toString() }

Kotlin:

tagName.set(githubRelease.tagName.map { it.toString() })

This tends to add some amount of noise to the code as most APIs use Strings for such things. With this PR, the above code snippets would be simplified to the following:

Groovy:

tagName = githubRelease.tagName

Kotlin:

tagName.set(githubRelease.tagName)

Gradle build scan: https://scans.gradle.com/s/butpox5cvgpqo