build library

Build orchestration for native libraries.

This library provides the high-level API for building native libraries from source, including:

Classes

AndroidBuildTarget
Platform-specific build configuration for Android.
AndroidNdkToolchain
Android NDK toolchain implementation.
AppleBuildTarget
Platform-specific build configuration for Apple platforms.
AppleSdkToolchain
Apple SDK toolchain implementation.
BuildCache
Persistent build cache for step-level caching.
BuiltLibrarySearchResult
A built library discovered in a platform-specific or legacy flat layout.
BuiltNativeArtifact
A built native artifact ready for packaging.
CmakeBuildStep
CMake build step for native libraries.
CmakeConfigureStep
CMake configure step.
CommandStep
Generic command execution step.
CopyStep
Copy files or directories.
DownloadArchiveStep
Download and extract an archive step.
ExportArtifactStep
Artifact export step for native builds.
GitApplyPatchStep
Apply a git patch.
GitCheckoutStep
Git checkout step.
ManifestArtifactHashes
Hashes recorded for one platform in a generated or lock manifest.
ManifestSnapshot
The integrity fields decoded from a generated Dart or lock manifest.
MsvcToolchain
MSVC toolchain implementation.
NativeArtifactCompanion
A companion entry in an artifact declaration.
NativeArtifactDeclaration
Declarative description of an artifact to export.
NativeArtifactEntry
An entry within a native artifact bundle.
NativeAssetSpec
Specification for a native asset to be built or resolved.
NativeBuildContext
Configuration for a native build.
NativeBuildDefinition
Definition of how to build a native project for different platforms.
NativeBuildDirectories
Directories used during a native build.
NativeBuildRecipe
Abstract interface for a native build recipe.
NativeBuildResult
Result of a native build operation.
NativeBuildStep
A single step in a native build recipe.
NativeHookConfiguration
Hook configuration for a native build.
NativeProject
A complete native project definition combining prebuilts, sources, and build logic.
NativeProjectBuilder
High-level builder that orchestrates the complete native build pipeline.
NativeProjectExecutor
Shared build entry point for CLI, hooks, CI, and tests.
NativeStepContext
Context passed to individual build steps.
NativeStepFingerprint
Fingerprint for a build step, used for caching.
NativeStepResult
Result of executing a single build step.
NativeTarget
Canonical representation of a native build target.
NativeTargetPattern
A pattern that matches native build targets.
NativeTargetRecipe
A recipe associated with a target pattern.
NativeToolchainResolver
Registry that resolves platform-appropriate binaries for cross-compilation.
PlatformToolchain
Platform toolchain interface for native builds.
PrebuiltPolicy
Policy for preferring prebuilt artifacts vs building from source.
ProcessResult
Result of a process execution.
ProcessRunner
Runs external processes with logging and error handling.
ProcessRunnerInterface
Abstract interface for running external processes.
StepBuildRecipe
Composable build recipe that executes a sequence of steps.
StripStep
Strip debug symbols from a binary.
ToolchainRegistry
Registry of available platform toolchains.
VcpkgToolchain
vcpkg toolchain implementation.
WindowsBuildTarget
Platform-specific build configuration for Windows.

Enums

NativeArtifactKind
Kind of native artifact produced by a build.
NativeArtifactRole
Role of an artifact entry within a native artifact bundle.

Functions

computeCacheKey(NativeProject project, NativeTarget target) String
Compute a project-scoped cache key for a target.
expectedLibraryName({required NativeTarget target, required String stem}) String
Expected library filename for a given target and library stem.
findBuiltLibraryFileWithMeta({required Directory builtLibraryDir, required String platform, required String canonicalName}) BuiltLibrarySearchResult?
Finds canonicalName below the platform directory, including nested build output directories, and optionally the legacy flat layout.
fingerprintHash(String input) String
Compute a reproducible SHA-256 hex digest for use in build fingerprints.
fingerprintHashMultiple(List<String> inputs) String
Compute a SHA-256 hex digest from multiple string inputs.
generateManifest({required NativePrebuiltConfig config, required String tag, required bool allowMissing, Directory? builtLibraryDir, Directory? releaseAssetsDir, bool toleratePartialBuiltLibrary = false, bool strict = false, void logger(String message)?}) Future<PrebuiltManifest>
isLockManifestOutput(String outputPath) bool
nativePrebuiltBuild(List<String> args, {NativeProject? project}) Future<void>
High-level convenience function for hook entrypoints.
packageBuiltLibrary({required File builtFile, required File archiveFile}) Future<void>
parseManifestSnapshot(String content, {required String path}) ManifestSnapshot
Decodes manifest content using path to select the lock or Dart format.
parseTarget(String label) NativeTarget?
Parse a target label into a NativeTarget.
readManifestSnapshot(File file) ManifestSnapshot
Decodes a generated manifest file without searching arbitrary text.
renderLockManifest(PrebuiltManifest manifest) String
renderManifest(NativePrebuiltConfig config, PrebuiltManifest manifest, String tag) String
renderManifestOutput(NativePrebuiltConfig config, PrebuiltManifest manifest, String tag, String outputPath) String
renderPayload(ArtifactPayload payload) String
renderReleaseSource(ReleaseSource source) String
runNativePrebuiltCli(List<String> args, {NativeProject? project}) Future<void>
Runs the native_prebuilt CLI.
shouldBuildFromSource(HookInput input) bool
Reads the build_from_source user-defined flag from input.
supportedTargetLabels(NativeProject project) List<String>
supportedTargets(NativeProject project) Iterable<NativeTarget>
targetFromPlatformLabel(String label) NativeTarget