| // Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| // dart format width=76 | |
| // snippet-start | |
| import 'package:hooks/hooks.dart'; | |
| import 'package:native_toolchain_c/native_toolchain_c.dart'; | |
| void main(List<String> args) async { | |
| await build(args, (input, output) async { | |
| final packageName = input.packageName; | |
| final cbuilder = CBuilder.library( | |
| name: packageName, | |
| assetName: '$packageName.dart', | |
| sources: ['src/$packageName.c'], | |
| ); | |
| await cbuilder.run(input: input, output: output); | |
| }); | |
| } | |
| // snippet-end |