# qiBuild documentation

# qibuild.config – Managing qiBuild config files

Read and write qibuild XML configuration files

See
  - qibuild.xml configuration file syntax
  - qiproject.xml syntax

## qibuild.config.QiBuildConfig

A class to represent qibuild XML configuration

Typical usage is:

    qibuild_cfg = QiBuildConfig()
    qibuild_cfg.read()
    qibuild_cfg.read_local_config(".qi/qibuild.xml")

    # Then every config key is usable using objects
    # or dictionnaries:
    build_dir = qibuild_cfg.local.build.build_dir,
    win32_config = qibuild_cfg.configs['win32-vs2010']
    cmake_generator = win32_config.cmake.generator

    ide = IDE()
    ide.name = "QtCreator"
    ide.path = "/path/to/qtcreator"
    qibuild_cfg.add_ide(ide)

    qibuild_cfg.write()

    qibuild_cfg.local.defaults = "win32-vs2010"

    # save defaults in local xml file:
    qibuild_cfg.write_local_config()

class `qibuild.config.``QiBuildConfig`

  A class to represent both local and global qibuild.xml configuration files.

  `read`(cfg_path=None, create_if_missing=False)

    Read from a config location.

  `read_local_config`(local_xml_path)

    Apply a local configuration.

  `write_local_config`(local_xml_path)

    Dump local settings to a xml file.

  `set_active_config`(config)

    Merge various configs from <defaults> and the selected <config > tag.

  `set_default_config`(name)

    Set a new config to use by default.

  `set_default_ide`(name)

    Set a new IDE to use by default.

  `set_default_editor`(editor)

    Set a new editor to use by default (Useful for qibuild config –edit).

  `add_config`(config)

    A a new config to the list.

  `add_ide`(ide)

    Add a new IDE to the list.

  `add_to_default_path`(to_add)

    Add a path to the default env path.

  `add_worktree`(path)

    Add Worktree

  `get_server_access`(server_name)

    Return the access settings of a server.

  `set_server_access`(server_name, username, password=None, root=None)

    Configure access to a server.

  `get_default_config_for_worktree`(worktree_path)

    Return the default configuration associated with the given worktree.

  `set_default_config_for_worktree`(worktree_path, name)

    Set the default configuration for the given worktree.

  `set_host_config`(config_name)

    Set the config used to build host tools.

  `get_host_config`()

    Get the config to use when looking for host tools.

  `write`(xml_path=None)

    Write back the new config.

Changelog CMake index Python index Index