p-hatan/ mirror

pub repository

mirror.p-hatan.ir

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.ir
flutter pub add dylib
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.02021-01-09T17:58:32.967840ZDownload36273c736f27b9c1b1b745b00926ff76c541ef34a03bab4f7c3a5e4717c2cd4d
0.1.0-nullsafety.12021-01-10T11:16:17.389325ZDownload04c4bd44f7009741d6aa05d7b87d82304920bbc4f19fce04edd0128944f80179
0.2.0-nullsafety.02021-01-10T11:34:40.439406ZDownload6733af7d5d24903bf0bded8d8ad8519f1f45c6af1e7110678d1a40324b6c8ac2
0.2.1-nullsafety.02021-01-11T18:22:41.753704ZDownloada2a04834018f55c3d1f35d5b0586f95532fee9781e761b72f5726393ac1ec8fb
0.3.02021-03-08T18:52:44.223782ZDownloadbd2a7649270a50edee9a09b47cae014ff10941b613c8afc194e049b04c365029
0.3.12021-03-09T13:25:23.133804ZDownloade443e96453c265c9ae3dbaef26f4db96bfc054872955ebb726612dbf549c6c2d
0.3.22021-03-19T20:42:25.736024ZDownloadad7de95923507c27df6a0b687905a22748f5676962a587b5c449fe575f87e294
0.3.2+12021-04-14T20:16:49.738196ZDownload2421ffc8d6a85f173ab6f3f10538a3cc65b887d413c65cf7a3549cadbe4fdd0f
0.3.32023-01-17T12:34:26.703517ZDownloadbf609b3eb6492a3309b3d1dbe8f83a4031de5535dd7686be33487051cc760bb0

Dependencies

meta "^1.3.0"

path "^1.8.0"

platform "^3.0.0"