Viewing version 0.3.2+1. Open the latest package page.

dylib

0.3.2+1

A set of helpers for resolving names and paths of dynamic libraries.

Download archive

Readme

dylib

pub license: MIT build codecov

A set of helpers for resolving names and paths of dynamic libraries.

Platform Name
Android libfoo.so
iOS libfoo.dylib
Linux libfoo.so
macOS libfoo.dylib
Windows foo.dll

Usage

A simple usage example:

import 'package:dylib/dylib.dart';

import 'foo_bindings.dart'; // LibFoo generated by ffigen, for example

LibFoo get libfoo {
  return _libfoo ??= LibFoo(ffi.DynamicLibrary.open(
    resolveDylibPath(
      'foo', // foo.dll vs. libfoo.so vs. libfoo.dylib
      dartDefine: 'LIBFOO_PATH',
      environmentVariable: 'LIBFOO_PATH',
    ),
  ));
}

void main() {
  libfoo.bar();
}
Changelog

[0.3.2+1] - 2021-04-14

  • A cosmetic description update.

[0.3.2] - 2021-03-19

  • Add tests, CI, coverage, and example.
  • Remove unused code to address pub.dev score.

[0.3.1] - 2021-03-09

  • Allow specifying plain file name via environment.

[0.3.0] - 2021-03-08

  • Upgrade to Dart SDK stable.
  • Upgrade dependencies.

[0.2.1-nullsafety.0] - 2021-01-11

  • Use environment variable as a fallback path.

[0.2.0-nullsafety.0] - 2021-01-10

  • Allow specifying path, dart define & environment variables separately.
  • Resolved missing dylib name prefix.

[0.1.0-nullsafety.1] - 2021-01-10

  • Dot-prefixed dylib suffix to be compatible with path.setExtension().

[0.1.0-nullsafety.0] - 2021-01-09

  • Initial release.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'dylib:0.3.2+1'
pubspec.yaml
name: dylib
description: A set of helpers for resolving names and paths of dynamic libraries.
version: 0.3.2+1
homepage: https://github.com/jpnurmi/dart_dylib
repository: https://github.com/jpnurmi/dart_dylib
issue_tracker: https://github.com/jpnurmi/dart_dylib/issues

environment:
  sdk: '>=2.12.0 <3.0.0'

dependencies:
  meta: ^1.3.0
  path: ^1.8.0
  platform: ^3.0.0

dev_dependencies:
  pedantic: ^1.11.0
  test: ^1.16.7
  test_coverage: #^0.5.0
    git: # https://github.com/pulyaevskiy/test-coverage/pull/41
      url: https://github.com/jpnurmi/test-coverage.git
      ref: deps

# dependency_overrides:
#   args: ^2.0.0
#   coverage: ^1.0.1
#   glob: ^2.0.0

Version history

VersionPublishedArchiveSHA-256
0.1.0-nullsafety.0Cached · Upstream SHA-256 matchedDownload36273c73…c2cd4d
0.1.0-nullsafety.1Cached · Upstream SHA-256 matchedDownload04c4bd44…f80179
0.2.0-nullsafety.0Cached · Upstream SHA-256 matchedDownload6733af7d…6c8ac2
0.2.1-nullsafety.0Cached · Upstream SHA-256 matchedDownloada2a04834…1ec8fb
0.3.0Cached · Upstream SHA-256 matchedDownloadbd2a7649…365029
0.3.1Cached · Upstream SHA-256 matchedDownloade443e964…9c6c2d
0.3.2Cached · Upstream SHA-256 matchedDownloadad7de959…87e294
0.3.2+1Cached · Upstream SHA-256 matchedDownload2421ffc8…4fdd0f
0.3.3Cached · Upstream SHA-256 matchedDownloadbf609b3e…760bb0

Dependencies

meta "^1.3.0"

path "^1.8.0"

platform "^3.0.0"