dartufbt 0.1.2 copy "dartufbt: ^0.1.2" to clipboard
dartufbt: ^0.1.2 copied to clipboard

Native Dart port of uFBT - Flipper Zero SDK deployment and FAP build tool.

example/dartufbt_example.dart

// Deploys the SDK and toolchain into ~/.ufbt, then builds every app declared by
// the application.fam of the directory passed as the first argument.
//
//   dart run example/dartufbt_example.dart my_app

import 'dart:io';

import 'package:dartufbt/dartufbt.dart';

Future<void> main(List<String> args) async {
  final appDir = Directory(args.isEmpty ? '.' : args.first);

  final logger = UfbtLogger(sink: UfbtConsoleSink().call);
  final ufbt = UfbtInstaller(logger: logger);

  await ufbt.install(SdkDeployTask.channel(channel: UfbtUpdateChannel.release));

  final status = ufbt.status();
  stdout.writeln('SDK: ${status.version} (${status.target}, ${status.mode})');

  final result = await FapBuilder(
    logger: logger,
    paths: ufbt.paths,
  ).build(appDir: appDir);

  if (!result.success) {
    stderr.writeln(result.error);
    exitCode = 1;
    return;
  }

  stdout.writeln(result.fap!.path);
}
0
likes
150
points
31
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Native Dart port of uFBT - Flipper Zero SDK deployment and FAP build tool.

Repository (GitHub)
View/report issues

Topics

#flipper-zero #embedded #sdk #build-tool

License

GPL-3.0 (license)

Dependencies

archive, crypto, image

More

Packages that depend on dartufbt