Customizing SBuild and customizing SBuild projects

 

Back to Build developer
Back to SBuild manual home

Table of content
Introduction

Programmers like to have an overview of how their tool behaves, the 1000-feet view of the steps it takes behind the scene to perform some task. Especially, SBuild claiming that it is a highly programmable and a highly customizable tool for programmers, we need to provide this overview.

Back to top

Where do I place my settings?

Here are the obvious choice of settings:

  • Universal settings: in SBuild toolkits. These are settings that are independent of any particular user or usage of SBuild. They can be safely distributed with the SBuild tool or one of its toolkits without fear that they will break other people builds. The archetypical example is tgtplatform, an SBuild variant inside the C/C++ toolkit that describes what machine do you compile some C code for. These settings are placed in the directory tk_<toolkit_name>.
  • Product-wide settings: in the SBuild project of your product. These are settings that concern one software product. The archetypical example are SBuild variants that describe the flavours of that product. These are placed in the file _sb_vars.py in the directory of your SBuild project.

Now let's deal with the less obvious ones:

  • Site-wide settings: the sb.get_host() and _sb_site.py
  • User-specific settings the sb.get_user() and _sb_users.py

They are less obvious because SBuild doesn't mandate a place to store them, unlike the universal and product-wide above. Currently, SBuild expectation is that you code these settings in the _sb_custom.py file of the SBuild project. But SBuild lets you use whatever valid Python code you see fit, which means that they can physically be in some other file on disk or on the Web at the other end of the world, whatever is practical for your situation.

Back to top

Site-wide settings: the sb.get_host() and _sb_site.py

 

Back to top

User-specific settings: the sb.get_user() and _sb_users.py

 

Back to top

 

Back to Build developer
Back to SBuild manual home