dart_bclibc 0.1.0
dart_bclibc: ^0.1.0 copied to clipboard
Dart FFI bindings for the bclibc ballistics engine. Provides a thin, zero-copy Dart wrapper around libbclibc_ffi with full trajectory integration, zero-finding, and apex/max-range solvers.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
0.1.0 - 2026-07-03 #
First stable release. No functional changes since 0.1.0-beta.5 — the API, build system, and platform support are unchanged; this release marks the package as stable for pub.dev.
0.1.0-beta.5 - 2026-07-02 #
Fixed #
linux/CMakeLists.txt: beta.4 usedinstall(FILES "$<TARGET_LINKER_FILE:bclibc_ffi>"), which copies the.sonamelink itself (not its target) in cmake < 3.21 — producing a broken symlink in the Flutter bundle (libbclibc_ffi.so → libbclibc_ffi.so.0) with no real library present, causingDynamicLibrary.open()to fail at runtime. Fixed by switching toinstall(TARGETS bclibc_ffi LIBRARY DESTINATION lib), which installs the real versioned file together with its soname and namelink symlinks into the same directory — matching the standard Linux shared library layout and keeping the symlink chain valid.windows/CMakeLists.txt: beta.4 added a redundantinstall(FILES bclibc_ffi.dll DESTINATION .)that doubled up with the standardPLUGIN_BUNDLED_LIBRARIESinstall loop already present in every Flutter app'swindows/CMakeLists.txt. Removed the explicitinstall()call; the DLL is now delivered exclusively viadart_bclibc_bundled_libraries → PLUGIN_BUNDLED_LIBRARIES, matching the behaviour of the previousbclibc_ffilocal package.
0.1.0-beta.4 - 2026-07-02 #
Changed #
linux/CMakeLists.txtandwindows/CMakeLists.txtnow register their own CMakeinstall()rules forbclibc_ffi, so consuming Flutter apps no longer need to add manualinstall(TARGETS bclibc_ffi …)blocks to their platformCMakeLists.txt. On Windows,add_dependencies(flutter_assemble bclibc_ffi)is also registered automatically, preserving the correct build order in Visual Studio. Android is unaffected — the Gradle/AGP native build collects shared library targets from the CMake project withoutinstall().
0.1.0-beta.3 - 2026-07-01 #
Fixed #
bin/build_native.dartresolved its own package root viaPlatform.script, which points at a cached kernel snapshot in the caller's.dart_tool/pub/bin/— not this file's real location in pub-cache — when invoked asdart run dart_bclibc:build_nativefrom a consuming project (as opposed to running it directly from within this repo, which is how it was tested for 0.1.0-beta.2). Switched toIsolate.resolvePackageUri, which goes through the actualpackage_config.jsonresolution and works regardless of pub-cache vs. path dependency vs. snapshot caching.
0.1.0-beta.2 - 2026-07-01 #
Added #
bin/build_native.dart—dart run dart_bclibc:build_nativebuilds the standalonelibbclibc_ffishared library intobuild/bclibc/, for consumers runningflutter test/dart test, which never trigger the platform build that bundles the library automatically
Changed #
Makefile'sbuildtarget now delegates tobin/build_native.dartinstead of duplicating the CMake invocation- CI (
test-submodule,test-macos) builds the native library viadart run bin/build_native.dartinstead of raw CMake commands; dropped the now-unusedninja-buildsystem dependency fromtest-submodule
0.1.0-beta.1 - 2026-07-01 #
First public release as a standalone package.
Added #
BcLibC— main entry point; open withBcLibC.open()BcLibC.integrateShot— full trajectory integrationBcLibC.integrateAtShot— trajectory integration to a specific intercept keyBcLibC.findZeroAngleShot— barrel elevation for a given zero distanceBcLibC.findApexShot— apex point of a ballistic arcBcLibC.findMaxRangeShot— maximum range and angleBcLibC.calculateEnergy,calculateOgw,getCorrection— utility functionsBcShot— user-facing shot descriptor in natural units; all physics conversion (atmosphere density, Coriolis trig, PCHIP drag curve, cant sin/cos) delegated to C++ viaBCLIBCFFI_Shot::to_shot_props()BcTrajectoryRequest,BcTrajectoryData,BcBaseTrajData,BcHitResult,BcInterception,BcMaxRangeResult— result typesBcException— structured error with per-error-code extras (requestedDistanceFt,zeroFindingError, etc.)BcConfig— solver tuning parameters (step multiplier, accuracy, limits)BcWind,BcDragPoint— wind and drag table entry value types- Unit system (
lib/unit.dart):Distance,Velocity,Temperature,Pressure,Angular,Weight,Energywithin_()/toDouble()API - Smoke-test suite (
test/ffi_test.dart,test/unit_test.dart) Makefilewithbuild,ffigen,test,cleantargets- CI workflow (
.github/workflows/ci.yml): analyze, submodule build, FetchContent build, macOS build, pub.dev dry-run jobs
Notes #
- Platforms: Linux, Windows, Android (arm64-v8a, x86_64), iOS, macOS
- Native library:
libbclibc_ffi.so/bclibc_ffi.dll/libbclibc_ffi.dylib— compiled frombclibc/(v1.1.4, LGPL-3.0) - CMake build strategy (Linux/Windows/Android):
- submodule present →
add_subdirectory(pub.dev; rungit submodule update --initbefore publishing) - pre-installed library found → use it (Flatpak
/app/lib) - fallback →
FetchContentfrom GitHub (git dep viadart pub get)
- submodule present →