IDE Script for "Use Builds Folder"

While debugging, I want the “Use Builds folder” option off as certain files need to be accessed in that folder. Also, I’m managing about two dozen apps so manually turning this option on and off gets tiring and often forget to change it. When not debugging, I have a program that uses IDE scripting through an IPCSocket (IDE Communicator) to build the app for me and deploy it. I was doing this with the option turned off but trying to auto build a 64 bit program can get tricky to capture all the files as a few dlls don’t get moved to the Libs folder. I’ve noticed more in the later versions of xojo and don’t want to have to keep modifying my auto build program.

Is there a way to use IDE scripting to turn of the “Use Builds Folder” option in the Shared build settings?

When it’s off the build folder location still shows the build folder path so I have to basically go up the folder tree until a folder exists and then go down to find the exe and go from there. Was working well but as I start to upgrade xojo versions on the apps and changing over to 64bit is adding a lot more modifications and sometimes causes the auto build/update to fail.

My only other option is to permanently turn on the “Use Builds Folder” option and write build scripts to move the required files into the debug folders. I would rather avoid this as doing it for two dozen or so apps will be a pain and will require modifications if more files are needed.

This sounds like the classic mistake of ‘looking for files in the same folder as the app’
Put them instead into a folder in the the right place:

specialfolder.applicationdata.child(“com.yourcompany.yourapp”)

They aill be there for the debug or the build version of your app.
You need to unpack/install the files into this folder at startup if they do not already exist.

Another possibility is to use CopyFilesSteps. That’s what they’re made for and you don’t risk corrupting the originals.

3 Likes

Keeping the files together is done on purpose as I have other custom programs and dlls that integrate with my xojo programs to add functionality.

I was asking about turning on/off build step by IDE scripting. Sounds like the answer is a no… I will add a feature request.

Can you do the CopyFiles build step on debug only?

Yup. There’s a setting in the inspector for that.

You should REALLY use the copy step.

I think that your real necessity for whatever script needs you have, is to locate the places things will go (before building/copying), or are there already (after the copy step). The IDE script should have access to some values at build time, maybe using special functions or preset constants as:

BuiltAppPath           // string with the path where the app executable is 
BuiltLibraryPath       // string with the path where the app libs are 
BuiltResourcesPath     // string with the path where the app resources are

Request that and use them in your script.

So you don’t need to walk the tree looking for where things were placed (debugging or not), the build system will let your script to know.