Gambas Project Folders & Files
Posted
#1
(In Topic #704)
Expert

Is there a 'best practice' location to create these folders or is it just the project root?
This question is more around creating installation packages and where application data should go.
Anybody able to fill in the blanks and/or advise?
Folders:
.action - No idea ?
.connection - {DataBaseName}.connection if a connecton has been added.
.gambas - compiled gambas code (?)
.hidden - No idea ?
.lang - Assume translation files but not sure?
.src - Contains source files - Form.form, Form.class, {name}.class, {name}.module
Standard Project files included for completeness.
Files
.directory - Reference for the icon file
.gitignore - no idea ?
.icon.png - 256 X 256 png image file. - (If you set an icon for your project, it will be displayed in the centre of the existing icon)
.lock - No idea (locking a form in a project has no effect on this file that I can see)
.project - The base project data. Title, Start up form, a list of components in the project, etc…
.settings - Editor settings - Bookmarks, Forms Debug window Geometries,
.startup - Similar to the Project file - may be the order in which the components are to be loaded - unsure ?
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Guru

Quincunxian said
I want to create a set of folders to store various types of data in my Gambas project area.
Is there a 'best practice' location to create these folders or is it just the project root?
This question is more around creating installation packages and where application data should go.
Anybody able to fill in the blanks and/or advise?
Folders:
.action - No idea ?
.connection - {DataBaseName}.connection if a connecton has been added.
.gambas - compiled gambas code (?)
.hidden - No idea ?
.lang - Assume translation files but not sure?
.src - Contains source files - Form.form, Form.class, {name}.class, {name}.module
Standard Project files included for completeness.
Files
.directory - Reference for the icon file
.gitignore - no idea ?
.icon.png - 256 X 256 png image file. - (If you set an icon for your project, it will be displayed in the centre of the existing icon)
.lock - No idea (locking a form in a project has no effect on this file that I can see)
.project - The base project data. Title, Start up form, a list of components in the project, etc…
.settings - Editor settings - Bookmarks, Forms Debug window Geometries,
.startup - Similar to the Project file - may be the order in which the components are to be loaded - unsure ?
.hidden is where you'd put custom control info like my NCheckBox (it's got other uses too) this may do the job
.action get's filled when using the .Action property of controls
you are right on the other folders.
I have had issues with accessing data unless i put it in a folder called .public/ so that's what i generally do now
.gitignore is a list of filepatterns that will not upload when using "git push" to update your git repository
.project is the main project properties settings file.
not sure about the others.
check out the gambas IDE source folder app/src/gambas3 · master · Gambas / gambas · GitLab , it does not explain much but there is a bit more there for you to look at and go "aah , i see"
(if you d/l and compile gambas the .action folder is populated)
Posted
Expert

.Public sounds like the place to be root for all the folders I want to create.
That makes it easier for my folder creation routine as well.
I have a class that I instigate as 'Folder' from the main module.
I assign various paths based on need so I can get dotted reference to the folders in the application.
So I can use {MainModule}.Folder.Icon16x16 to reference that location.
The actual Path would look something like this : /home/{name}/Projects/{ProjectName}/.Public/Images/Icon16x16 {while in development mode only}
You only have to change a single variable in the global module to the required path when you want to deploy the application - makes it a lot easier.
Each time you start the application, the required folders are checked for existence and created if they don't.
Code (gambas)
- a'---------------------------------------------------------------------------------------------------------
- ' Purpose : To provide a single structure for Folder Management.
- ' Created : 13/08/2019
- ' Original Author : Quincunxian - Perth Western Australia
- ' Modifications Format - <Date><Modification><Date>
- '---------------------------------------------------------------------------------------------------------
- '----------------------Folders --------------------------------------------------------
- InitialiseApplicationFolders
- CheckFolderStructure(RootFolder)
- CheckFolderStructure(Data)
- CheckFolderStructure(SQLRefFiles)
- CheckFolderStructure(Help)
- CheckFolderStructure(Images)
- CheckFolderStructure(Icons16X16)
- CheckFolderStructure(Icons32X32)
- CheckFolderStructure(Pictures)
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Guru

Not trying to be pedantic but it might make a difference.
That looks like a cool way to store/get path names <EMOJI seq="1f642" tseq="1f642">🙂</EMOJI>
Posted
Expert

I've spent some time looking for a error only to find out I'd capitalised something in a file/folder name.
That's one of the main reason I prefer setting up dotted references. - Do it once, do it right.
Cheers - Quin.
I code therefore I am
I code therefore I am
1 guest and 0 members have just viewed this.


