LinuxCommandLibrary

sfdk-build-init

Initialize SAP Fiori development kit project

TLDR

Initialize the current directory as the build directory

$ sfdk build-init
copy

Initialize the specified directory as the build directory
$ sfdk build-init [directory]
copy

SYNOPSIS

sfdk build-init [OPTIONS] [TARGET_OR_ENGINE_NAME]

PARAMETERS

--sdk <version>
    Specifies the Sailfish OS SDK version to associate with the new or existing build target/engine (e.g., '4.5.0.18').

--arch <architecture>
    Defines the target architecture for the build environment (e.g., 'armv7hl', 'i486', 'aarch64'). Essential for cross-compilation.

--create
    Explicitly instructs the command to create a new build target or SDK engine with the specified name and options.

--list
    Lists all currently configured build targets and SDK engines, showing their names, associated SDK versions, and architectures.

--delete
    Deletes the specified build target or SDK engine from the configuration. This action is irreversible for the environment.

--show-config
    Displays the detailed configuration for a specified build target or SDK engine, including paths and settings.

--default
    Sets the newly created or specified build target/engine as the default for subsequent sfdk build commands.

TARGET_OR_ENGINE_NAME
    The unique name for the build target or SDK engine being initialized, listed, deleted, or configured. Required for creation and specific operations.

DESCRIPTION

sfdk build-init is a crucial command within the Sailfish OS SDK, designed for setting up and managing build environments. It allows developers to initialize specific build targets (e.g., for different architectures like armv7hl or i486) or to create and configure SDK build engines. This command prepares the necessary environment for compiling applications and packages for Sailfish OS, ensuring compatibility with the target device or emulator.

It streamlines the initial setup phase, enabling developers to quickly switch between different SDK versions or hardware targets without manual configuration of build tools and dependencies. It's an essential first step before building projects with sfdk build or entering the sfdk shell.

CAVEATS

This command requires a pre-installed and functional Sailfish OS SDK. It modifies system-wide or user-specific SDK configurations, thus requiring appropriate file system permissions. Creating new SDK instances or targets can consume significant disk space and may involve downloading large components, requiring an active internet connection. Remember that sfdk build-init is a subcommand and must be invoked via the main sfdk wrapper.

USAGE CONTEXT

It's important to note that sfdk-build-init is not typically run as a standalone executable. Instead, it is invoked as a subcommand of the main sfdk tool, e.g., sfdk build-init. The sfdk wrapper manages the environment and directs commands to the appropriate SDK tools.

TARGET VS. ENGINE

In the context of sfdk build-init, a 'build target' typically refers to an environment configured for a specific device architecture (e.g., armv7hl for a phone), allowing compilation for that platform. An 'SDK build engine' usually refers to a specific version of the Sailfish OS SDK itself, potentially allowing multiple SDK versions to be installed and managed side-by-side. The command helps set up both.

HISTORY

The sfdk command-line tool, including its build-init subcommand, is a core component of the Sailfish OS SDK. It evolved from earlier SDK setups for platforms like MeeGo, designed to streamline cross-compilation and application development for mobile devices. build-init specifically abstracts complex configurations related to scratchbox2 (sb2) and QEMU, making it easier for developers to manage multiple SDK versions and hardware targets without deep knowledge of the underlying build systems.

SEE ALSO

sfdk build(1), sfdk shell(1), sfdk deploy(1), sfdk target(1)

Copied to clipboard