-
Notifications
You must be signed in to change notification settings - Fork 4
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
Access semver version properties in Gradle build file. #8
Comments
@Kerooker If your project is in Java or Kotlin, you can use the SemVer Annotation Processor to create a version class that is accessible programmatically within your project. If you are trying to read the properties file in the Gradle build file, then what you suggested works. I've never really thought about exposing the properties file content. Maybe as project extensions? Is that what you're looking for? |
I have the need to embed the version to other gradle tasks, such as Google App Engine's I'm using the file approach, but I think that perhaps there should be a way to do it out-of-the-box. Something like
(This is actually pretty close to my use case) |
And then we can remove user's trouble on fetching these to use in build.gradle |
Have you tried?
That should work, if not try putting it in a As far as your |
@Kerooker I've released 1.0.3-beta. It implements a set of semver extension properties. Look at the documentation for a complete list. Your example should now work as-is. Give it a try and let me know if that works for you. |
That's exactly what I wanted! This works as expected |
Implemented by e1891c4 |
How to make sure to assign the |
@mochadwi I'm not quite sure what you're trying to accomplish. Do you have an example or a project that I can look at? |
In our case we need to assign the When updating to use no. 2, seems the We're ended up using the |
@mochadwi I have no idea if it'll work, but you could try: versionName = ${-> semver.version} It might work, let me know. |
Thanks, will let you know ASAP 🙏 |
is it Lambda argument? needs to find an alternative for
|
@mochadwi It's a lazy instantiation of a GString. I don't think there's an equivalent in Kotlin, unfortunately. Have you tried setting the version as a late variable? Might work, but I have my doubts. |
Thanks for the reference, will update you later. Currently still AFK 🙏 |
Does the |
Hey!
How can I read the version properties?
Currently I'm loading them manually
Is there an easy way to do it?
The text was updated successfully, but these errors were encountered: