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
Adding some APIs #93
Comments
I am doing something similar to that but outside of semver plugin, in Hubdle or Gradle Extensions. There is a Gradle issue to transform We can add a public val Project.isSnapshot: Boolean
get() = version.toString().endsWith("-SNAPSHOT", ignoreCase = true) Change to public val Project.isSnapshot: Provider<Boolean>
get() = provider { version.toString().endsWith("-SNAPSHOT", ignoreCase = true) } And in semver plugin I could just expose it: public val Project.isSnapshot: Provider<Boolean>
get() = com.javiersc.gradle.extensions.project.isSnapshot The reason to expose a Additionally, we could add more for common values like |
Fixed with 0b8156d |
Added those ones in isVersionExtension.kt:
|
Ah cool ! Also what about the API about reading the previous git tag, since it's used to compute the current version. Maybe also reading the commit hash of the related tag. And the current commit hash as a commodity (can be used to set an entry in the manifest). |
How would you consume those values? in a lambda in the plugin extension for example? |
I'm not sure how I would consume those, I think possibly accessing those values in a custom task, or from another task. |
Maybe the semver extension can have a provider with those values which can be mapped to another task input/s. What do you think? |
Fixed on f63fd5e |
I think that should be the right thing. |
In my build script depending, I wrote some tasks that depends on the computed version, and some on the old version.
Typically choosing the repository to upload artifacts weather the version is a snapshot or a release (alpha, beta, rc, final). In another project I'm working on there's the concept of EAP (early access preview).
Currently I have created my own functions that parse the version. But it would be useful if the plugin could provide those.
E.g.
Another thing that I'm currently doing differently is getting the last tag (and possibly the commit id), which could be used to trigger some tasks.
The text was updated successfully, but these errors were encountered: