build library
Build orchestration for native libraries.
This library provides the high-level API for building native libraries from source, including:
- NativeProject - the central project definition
- NativeProjectBuilder - orchestrates the build pipeline
- NativeBuildContext - build configuration per target
- NativeBuildRecipe - build step recipes
- NativeBuildResult - build output artifacts
- runNativePrebuiltCli - unified CLI entry point
- nativePrebuiltBuild - convenience hook entry point
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.
- 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.
- 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.
- 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
targetand librarystem. -
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}) → 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> -
parseTarget(
String label) → NativeTarget? - Parse a target label into a NativeTarget.
-
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_prebuiltCLI. -
shouldBuildFromSource(
HookInput input) → bool -
Reads the
build_from_sourceuser-defined flag frominput. -
supportedTargetLabels(
NativeProject project) → List< String> -
supportedTargets(
NativeProject project) → Iterable< NativeTarget> -
targetFromPlatformLabel(
String label) → NativeTarget