Adding environment variables with gradle: yes
My v2.3.0 build broke on F-Droid and I have been working to get it back up running. The issue I am running into is that I need a couple of environment variables to be present during app build. I can't put these in a file since I am running a React Native app and it's the only way to pass in the variable. My current metadata file can be found here: https://gitlab.com/leinelissen/f-droid-data/-/blob/fix-fintunes-v2.3.0/metadata/nl.moeilijkedingen.jellyfinaudioplayer.yml.
I have tried the following approaches:
- putting
export BLAH=blahin eitherinitorprebuild. Doesn't work as those commands are run in a singlebash -cand the environment variables will disappear as soon as theinitorprebuildsection completes. - inserting the environment variables in
.bashrc. Doesn't work as whatever happens whengradle: yesisn't executed in a new shell. - custom build step without
gradle: yesincludingexport BLAH=blah. Doesn't work as the build step fails whenUpdating main projecthappens, eventually breaking onInvalid or unsupported command "update lib-project -p .". See https://gitlab.com/leinelissen/f-droid-data/-/jobs/6339095656. - custom build step with
gradle: yesincludingexport BLAH=blah.assembleReleaseexecutes twice, and fails the second time because the environment variables are not available: See https://gitlab.com/leinelissen/f-droid-data/-/jobs/6339831895.
I don't fully grok what happens when gradle: yes is set, and how I can influence it to pick up environment variables from e.g. prebuild. I see a lot of projects directly manipulating gradle files, but my current setup can only support environment variables, so this is not currently an option. Hope any of you can help out!