Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify interactions with githubRelease extension properties #63

Conversation

tylerbertrand
Copy link
Contributor

@tylerbertrand tylerbertrand commented Apr 26, 2023

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

Interacting with CharSequence can result in some syntactical overhead compared to interacting with Strings.
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 tends to add some amount of noise to the code as most APIs use Strings for such things.
@tylerbertrand tylerbertrand force-pushed the tylerbertrand/use-string-over-charsequence branch from 32e359e to 96b7cfc Compare April 26, 2023 16:48
@BreadMoirai BreadMoirai merged commit fd8a82d into BreadMoirai:master Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants