0

I want to use one version across my MPP. I have defined a var in my gradle.properties version=0.1.0 Is there a way to read this from my commonMain src code so that i can read it or possibly the other way around to define a var in my src and have the build.gradle.kts read this value?

Thanks

user1634451
  • 5,133
  • 6
  • 30
  • 43
  • Something like this seems relevant here: https://stackoverflow.com/questions/17197636/is-it-possible-to-declare-a-variable-in-gradle-usable-in-java – Artyom Degtyarev Feb 28 '20 at 06:28
  • @ArtyomDegtyarev thanks for the reply but this seems to only work for android i was lookin for something that would work with mpp and be accessible by the common code – user1634451 Feb 28 '20 at 17:22
  • Setting build process variables from the source code make no sense IMHO. About the reverse - from build to the code. I think there is no easy option for this. Probably some magic can be done via environmental variables, as in the second answer. But with `expect` setter, actualized with platform-specific envvar readers. – Artyom Degtyarev Mar 02 '20 at 06:57

0 Answers0