What is your solution to get the version number for the about dialog? Is there a standard way like ...
s
What is your solution to get the version number for the about dialog? Is there a standard way like Androids "BuildConfig" or do I need to implement something on my own?
1
o
same solution as in above message shall work
🙏 1
m
BuildKonfig is working well for me in a multiplatform module https://github.com/yshrsmz/BuildKonfig
🙏 4
👍 5
t
@Stefan Oltmann I am using my own version and it works perfectly fine.
s
@ephemient I switched to this solution, but it's not quite clear when to execute it. I tried to let it depend on "preBuild", but that only works always for Android. Now I do it via project.afterEvaluate{}, but that is problematic with "clean build" task 😕
e
for Android, use
android.applicationVariants.all { registerJavaGeneratingTask(...) }
(or whatever needs to be tweaked for your situation) for JVM projects, that should work out of the box, the file collection given to the sourceset tracks the dependency automatically not sure why it would be interacting badly with
clean
, but you could try
mustRunAfter("clean")
s
Thank you, I will try that 🙂
e
ah, that seems to be just a gradle issue. https://github.com/gradle/gradle/issues/2488
👍 1