-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
This section describes how to configure the Project Init system. You don't necessarily have to create an addon for it. This allows you to adjust certain behaviours and outputs on a per-user basis. All you need to do is create a configuration file and place it somewhere on your system. However, if you plan to integrate Project Init in your organisation, it's better to create an addon. That way you can centralize the changes, for example, in your own Git repository and make that available to all your organisation's members.
The main configuration file of the Project Init system is the 'project.properties' file. It is a simple .properties formatted text file containing key-value-pairs. A key and its corresponding value are separated by an '=' character. Comments must start with a '#' character. We recommend to only use plain ASCII characters.
If you want to add your own configuration values to Project Init, simply create a file named 'project.properties' in your user's home directory and add the desired key-value-pairs. For example, if your user on your system is called 'bob', then create a file '/home/bob/project.properties' and add your configuration there.
For example, add the following content to your user's 'project.properties' file to change the ownership parameters for newly created projects to your personal name or organisation:
# This is a comment.
# Put this content here in a 'project.properties' file in your user's home directory.
project.organisation.name=My Organisation
project.organisation.url=http://www.example.com
project.organisation.email[email protected]
project.slogan.string=My Slogan for New Projects
All available properties and their default value can be seen in the base project.properties file. You only have to put the properties that you want to change in your personal 'project.properties' file. The system will use the default values as defined in the base file for all properties that you don't override.
One important thing to note is that the order by which 'project.properties' files are loaded by the system is strictly defined. The base configuration is loaded first. Then, if an addon resource is available and also has a 'project.properties' file, it is loaded and any redefined properties take effect. Then, if the user who is running Project Init has a 'project.properties' file in his home directory (denoted by the $HOME shell environment variable), it is loaded and any redefined properties take effect, potentially overriding custom properties defined in the addon resource.
If you don't like having a 'project.properties' file visible in your home directory, you can also make it invisible by naming it '.project.properties' (precede a dot to the filename). It will still be recognised and loaded by the system.
Alternatively, you can place the main configuration file anywhere on your system and use the $PROJECT_INIT_USER_PROPERTIES environment variable to point to it.
For example, add the following line at the end of your user's .bashrc file:
export PROJECT_INIT_USER_PROPERTIES="path/to/your/project.properties";
When using the environment variable you don't even have to name the file 'project.properties'. You can name it whatever you want. However, please note that it still has to be a properties-formatted text file.
This is only useful when you create an addon. You can query all properties at any point in your addon code by using the get_property() or get_boolean_property() function. That way you can, for example, define your own properties and adjust the behaviour of your addon based on certain conditions.