Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

New UserVarManager implementation

(1/4) > >>

BlueHazzard:
Hello,
since the  past view years i work on and off on the UserVariableManager... Now i am finally pleased to have a working patch against svn head...

From my point of view (correct me if i am wrong) global user variables should be used to configure external libraries (path, compiler and linker flags) that are different on each pc. On linux this is less used than on windows. To fulfil this functionality it should have the following properties:
1) Flexible naming (different sets, different variable names (ex. wx), different members of the variable (ex. include, library ecc.)
2) Definable over command line for batch builds
3) Inform the user if a variable is not defined and give some hints what the variable is used for

What it is NOT meant to do (at the moment)
*) Automatically detect a library or paths to a library

With the current implementation only 1) is implemented, 2) over a dirty hack and 3) partially and fails on headless batch builds. Batch building is tricky because when a variable is not defined no messages are logged and on headless servers the build simply was stuck....
With the attached patch 2 is possible and 3 partially (at least on informing the user), and with a follow up patch also 3 is better implemented.

What does this patch:
1) The attached patch does NOT modify the behaviour of global variables from a user perspective! Old projects should behave the same. If not it is a bug!
2) It adds the command line flag '-D variable[.member]=value' that can be repeated multiple times for different variables. If the variable is not stored in the current configuration it is temporary generated. This allows to set and override global variables via command line.
3) It adds the command line flag -S setname to activate a specific set (this would currently be possible with different personalities, but it is extremely cumbersome)
4) It stores the variables in memory and does not load them from configuration file every time they are used during compiling (should theoretically speed up compile times)
5) It adds an cancel/save button to the edit variable dialog, so the user can cancel a erroneous input
6) Adds a lot API and documentation to UserVariableManager so it can be used in other plugins or over scripting
6.1) Api for get and set variable sets, variables and members
6.2) Api to get and set the whole set of variables
6.3) Api to store the variables to configuration file
6.4) Api to parse variable names
6.5) Api to check if a variable exists in the first place
7) Moves all related dialogs from sdk to src
8) Introduces an UI interface so we can use different UIs for batch builds (console) and UI builds
9) More information is logged to the codeblocks log if something went wrong (this helps on headless servers A LOT)
10) Remove any config file writing that has happened in user variable dialogs to the new api of the UserVariableManager  so configuration file loading and storing are in one single place

I have looked over this patch 100 times, but i think i am now blind for any (format) errors...

I have not already incremented the SDK API number, because this api is not stable until after the next patch...

Any comments?



omlk:
Hi, it would be great if you could make a video showing all the possibilities.

BlueHazzard:
There are not really new features to see on a video (this is intended, no change the user behaviour), beside the command line arguments and not blocking on batch builds...

AndrewCot:
Now I have come up for air I will have a look at it in the next day or two as I am heavily using the global variables for my local builds.

I just merged my Linux and Mac project files and created yet more global variables in order for the merge to work as I kept having to make the change twice due to supporting two sets of project files when 95+% was common between the two sets.

AndrewCot:
First problem:

The patch file does not include the <Unit filename="src/resources/ask_global_uservar.xrc"> new that's in the project files and in the Github branch, but not in the patch.

Navigation

[0] Message Index

[#] Next page

Go to full version