Configuration reference

From docs/config.md at 72c38f3 View on GitHub

Every key bindsmith.yaml accepts, written from the JSON Schema the loader validates against — so this page cannot drift away from what bindsmith enforces. bindsmith init writes that same schema next to your configuration and points the file at it, so an editor completes and checks these keys as you type them.

The schema settles shape: spelling, types, which keys exist. It cannot say which keys a particular driver reads — headers: means nothing to the JVM driver, include: {classes:} means nothing to the C driver — and the loader refuses those with a line and a column rather than ignoring them. See platforms.md for what each driver takes.

Top level

One config, six Flutter platforms.

KeyTypeNotes
namestringRequired. Base name of the generated library: my_sdk.dart.
outputstringRequired. Directory for the generated bindings, relative to this file. Under lib/, because a binding is reached by a package: URI.
facadeobject—
platformsobjectRequired. One entry per Flutter platform to generate for.
fixupslist of fixupDeclarative edits applied to the IR after the drivers.
verifyobject—

facade

KeyTypeNotes
librarystringPath of the facade library to write. Under lib/, because it is what callers import.
unsupportedstringWhat the facade does where a platform has no symbol. One of throw, stub, omit.

platforms

One entry per Flutter platform to generate for.

KeyTypeNotes
androidplatform—
iosplatform—
macosplatform—
windowsplatform—
linuxplatform—
webplatform—

fixup

KeyTypeNotes
matchobjectRequired.
renamestring—
hideboolean—
threadingstringOne of any, main.
nullabilityobject—
ackbooleanA human reviewed this symbol: drop its verify markers.

verify

KeyTypeNotes
markersstringWhether an unacknowledged verify marker fails. One of error, warn.
compilelist of stringPlatforms whose generated code must compile.
size_budgetobject—

platform

KeyTypeNotes
driverstringWhich generator reads the native API. One of c, objc, swift, jvm, winmd, dts, dbus.
inheritstringTake this platform's whole configuration from another one. One of android, ios, macos, windows, linux, web.
headerslist of stringEntry-point headers, for the c and objc drivers.
xmllist of stringD-Bus introspection XML files, for the dbus driver.
depsdeps—
includeinclude—
compile_sdkanyAndroid API level whose android.jar jnigen binds against.
modulestringSwift module the sources and generated wrapper compile into.
sourceslist of stringSwift or Kotlin sources the driver reads.
kotlinobjectHow Kotlin constructs cross into Dart.
wrapperstringGenerate a native bridge for members the driver cannot carry across. One of auto, off, only.
buildobject—

fixup.match

KeyTypeNotes
symbolstringRequired.
platformstringOne of android, ios, macos, windows, linux, web.

fixup.nullability

KeyTypeNotes
returnsstringOne of nonnull, nullable, unknown.

verify.size_budget

KeyTypeNotes
linesintegerAt least 1.

deps

Packages to resolve and pin in bindsmith.lock.

KeyTypeNotes
mavenlist of stringgroup:artifact:version coordinates.
repositorieslist of stringMaven repository URLs, searched in order, each https:// or a file:// directory. Defaults to Maven Central; an Android dependency usually needs Google's too.
swiftpmlist of object—
npmlist of string—
nugetlist of string—
pkg_configlist of string—

include

Glob patterns for the symbols to bind, by kind.

KeyTypeNotes
classeslist of string—
typeslist of string—
protocolslist of string—
functionslist of string—
structslist of string—
enumslist of string—
globalslist of string—
typedefslist of string—
exportslist of string—

platform.kotlin

How Kotlin constructs cross into Dart.

KeyTypeNotes
suspendstringOne of future, callback.
flowstringOne of stream, callback.

platform.build

KeyTypeNotes
hookstringOne of native_toolchain_c, native_toolchain_cmake.
sourceslist of string—

deps.swiftpm

KeyTypeNotes
urlstringRequired.
fromstringRequired.