The app I am converting to Xojo has a bunch of folders in a Resources folder. A compiled app maintains the same structure.
I don’t think Xojo auto-mirrors the folder structure during the build stage. So how best to structure all the folders that a Xojo app will need? Best resources to study?
i would try a build step with subdirectory
or if the ressources are app neutral then create all the folders at start somewhere with FolderItem class.
everything the user can edit should not be in the app folder.
I saw that in the docs on build, so need to play with it a bit. Ideally, all things I need for the app, like icons, images, files, etc., are in a single resource file (both macOS and WIndows). Then how to get it to copy into the built app?
You can do with the with Insert → Build Step → Copy Files. Drag the files into the main part of the window. Then select if you want to have the files always (both), debug, build or not at all. Select Resources Folder as Destination.
I use this for files which are always there. For more complicated things I use scripts.
icons and images i dropped in the project tree contens. you can then use them by name.
i copied only the app manual pdf via copyfiles build step.
(Supports Hi-DPI is disabled in this project)
I’m also accessing a dynLib (Mac) and DLL (Windows) which are placed next to the project. I don’t see it anywhere within the built app folder hierarchy. So I am assuming that it is still looking in the raw project folder?
What if I have a file that I need to access. It’s a dynamic library. Apparently, the current path is:
/usr/local/lib/libSwEpLib.dylib
But I want it to be located next to my app project, preferably in the Resource folder (also next to project structure). I think that way it will be easy to keep it together when i build the app.
I need to send a path to the dynamic library so it knows where things are.
Not sure I understand. In the IDE script you can use files from anywhere. Make a copy of the dylib into a folder next to your project and copy the dylib there. I have a folder “build automation” with all the files I need to make my app and the helper apps:
Sorry, I wasn’t clear about that location. I’m building an app and the dynamic library needs to be in a reliable folder location. In the 4D world, plugins and images and icons, etc., were placed in the Resources folder. Easy management and building.
I showed that location because that appears to be where the dynamic library is being called from. Which is not what I want. I want the dynamic library files (Mac and Win) in the Resources folder, next to the app project, so they can be easily copied during the build.
Important because I need to set the paths to files and send the paths inside the dynamic library.
This is all new territory, and in a few weeks/months it will feel like an old pair of jeans.
You can’t place dylibs in the Resources folder of the app because this will make an error when notarising. Instead, the dylib needs to go to the Frameworks folder. Then you make a constant to talk to your dylib like this:
We had to set the dynamic library, in the build script, in the build destination, to App Parent Folder.
I didn’t understand that when I click on the Xojo Run button, it’s building as well. I thought the ‘Run’ and the ‘build’ were separate processes. Thus, my confusion with what Beatrix was sharing.
Hopefully this will help someone else down the road.
Just FYI - Notarization and Code Signing are not the same thing. Code Signing is what you do with your USB Token. DMGCanvas will create the DMG wrapper, sign it if you have an Apple certificate and I believe they support notarization now if you have an app-specific password, but none of that is done automatically.