How to use the fbs.init function in fbs

To help you get started, we’ve selected a few fbs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mherrmann / fbs / tests / test_fbs / __init__.py View on Github external
def init_fbs(self, platform_name=None):
        if platform_name is not None:
            runtime_state.restore(platform_name, None, None)
        fbs.init(self._project_dir)
    def tearDown(self):
github mherrmann / fbs / fbs / cmdline.py View on Github external
def main(project_dir=None):
    """
    This function is executed when you run `fbs ...` on the command line. You
    can call this function from your own build script to run fbs as if it were
    called via the above command. For an example, see:
        https://build-system.fman.io/manual/#custom-commands
    """
    if project_dir is None:
        project_dir = getcwd()
    try:
        fbs.init(project_dir)
        # Load built-in commands:
        from fbs import builtin_commands
        from fbs.builtin_commands import _docker
        from fbs.builtin_commands import _gpg
        from fbs.builtin_commands import _account
        from fbs.builtin_commands import _licensing
        fn, args = _parse_cmdline()
        fn(*args)
    except KeyboardInterrupt:
        print('')
        sys.exit(-1)
    except FbsError as e:
        # Don't print a stack trace for FbsErrors, just their message:
        _LOG.error(str(e))
        sys.exit(-1)