Skip to content

Commit

Permalink
satisfy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes committed Jul 23, 2024
1 parent 8d453f2 commit c4f82be
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
21 changes: 10 additions & 11 deletions pkgs/native_assets_builder/test_data/add_asset_link/hook/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import 'package:native_assets_cli/native_assets_cli.dart';
void main(List<String> arguments) async {
await link(arguments, (config, output) async {
final builtDylib = config.assets.first as NativeCodeAsset;
output
..addAsset(
NativeCodeAsset(
package: 'add_asset_link',
name: 'dylib_add_link',
linkMode: builtDylib.linkMode,
os: builtDylib.os,
architecture: builtDylib.architecture,
file: builtDylib.file,
),
);
output.addAsset(
NativeCodeAsset(
package: 'add_asset_link',
name: 'dylib_add_link',
linkMode: builtDylib.linkMode,
os: builtDylib.os,
architecture: builtDylib.architecture,
file: builtDylib.file,
),
);
});
}
2 changes: 1 addition & 1 deletion pkgs/native_assets_cli/lib/src/api/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.

import '../../native_assets_cli_internal.dart';
import 'asset.dart';
import 'build_output.dart';
import 'link_config.dart';
import 'asset.dart';

/// Runs a native assets link.
///
Expand Down
8 changes: 4 additions & 4 deletions pkgs/native_assets_cli/lib/src/model/dependencies.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import 'dart:convert';

import 'package:collection/collection.dart';

import '../api/asset.dart';
import '../utils/file.dart';
import '../utils/json.dart';
import '../utils/uri.dart';
import '../api/asset.dart';

class Dependencies {
/// The dependencies a hook relied on.
///
/// Combines all dependencies the [assetDependencies] and
/// [assetTypeDependencies].
List<Uri> get dependencies => [
List<Uri> get dependencies => {
for (final dependencies in [
...assetDependencies.values,
...assetTypeDependencies.values,
])
for (final dependency in dependencies) dependency,
].toSet().toList()
}.toList()
..sort(_uriCompare);

int _uriCompare(Uri u1, Uri u2) => u1.toString().compareTo(u2.toString());
Expand All @@ -45,7 +45,7 @@ class Dependencies {

final Map<String, Iterable<Uri>> assetTypeDependencies;

const Dependencies({
Dependencies({
required this.assetDependencies,
required this.assetTypeDependencies,
});
Expand Down
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/src/model/hook_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ final class HookOutputImpl implements BuildOutput, LinkOutput {
...?assets,
],
_assetsForLinking = assetsForLinking ?? {},
// ignore: prefer_const_constructors
_dependencies = dependencies ??
Dependencies(
assetDependencies: {},
Expand Down
2 changes: 1 addition & 1 deletion pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CBuilder implements Builder {
///
/// Resolved against [BuildConfig.packageRoot].
///
/// Used to output the [BuildOutput.dependencies].
/// Used to output the [BuildOutput.assetDependencies].
@Deprecated(
'Newer Dart and Flutter SDKs automatically add the Dart hook '
'sources as dependencies.',
Expand Down

0 comments on commit c4f82be

Please sign in to comment.