What's the easiest way to put a variable in the ap...
# compose-desktop
c
What's the easiest way to put a variable in the app showing that I'm running a "debug" build (or at least a build deployed from the IDE)? I basically just want to put a "debug" string in front of the version number in my app so that I know I'm using a local version vs one downloaded. I tried clause/chatGpt but didn't get anything that worked (there was a few system property things that it kept wanting me to try) I guess I'm just really used to BuildConfig.DEBUG in android land.
p
c
so i tried this today, but it doesn't seem to work. Yes it generate BuildConstants... but how do i get that buildConstant to know if it was built via the IDE (debug build) vs a build generated via command line for production?
p
You can have a
qa1.properties
file and
prod.properties
file, supply what file you want to load the properties from in the build command.
You are not limited to .properties files, you can have xml, json, yaml anything. And you are not limited to have them in the repo. They can be hosted remote and you fetch them from Gradle before setting up the build constants values
c
gotcha. but its still something i need to manually change though. i.e. i have to remember to pass in a different file at local build time vs build for external users.
my point moreso with this question was whether there was some "built in" property that lets me tell if this was built from ide
kinda like this
p
Ah, I see. I think there's one but forgot the name
❤️ 1
You probably have better luck asking in the Android Studio / Idea channel
Another option could be doing negative logic, instead of asking if(buildFromIde) you could do if(! buildFromPipeline) , you would set a property in the pipeline for this, which you won't set in the local environment.
But obviously won't be 100% accurate as if you read a specific IDE property