Skip to content

Commit e72e187

Browse files
authored
[native_assets_cli] Fix download_asset example (#2105)
1 parent 329b975 commit e72e187

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/workflows/native.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,13 @@ jobs:
184184
working-directory: pkgs/${{ matrix.package }}/example/build/use_dart_api/
185185
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
186186

187-
# TODO(https://github.com/dart-lang/native/issues/1879): Enable this when the fix has rolled into Dart.
188-
# - run: dart --enable-experiment=native-assets test
189-
# working-directory: pkgs/${{ matrix.package }}/example/build/system_library/
190-
# if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
187+
- run: dart --enable-experiment=native-assets test
188+
working-directory: pkgs/${{ matrix.package }}/example/build/download_asset/
189+
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
190+
191+
- run: dart --enable-experiment=native-assets test
192+
working-directory: pkgs/${{ matrix.package }}/example/build/system_library/
193+
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
191194

192195
- name: Install coverage
193196
run: dart pub global activate coverage

pkgs/native_assets_cli/example/build/download_asset/hook/build.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ void main(List<String> args) async {
3333
);
3434
final fileHash = await hashAsset(file);
3535
final expectedHash =
36-
assetHashes[createTargetName(
37-
targetOS.name,
38-
targetArchitecture.name,
39-
iOSSdk?.type,
36+
assetHashes[input.config.code.targetOS.dylibFileName(
37+
createTargetName(
38+
targetOS.name,
39+
targetArchitecture.name,
40+
iOSSdk?.type,
41+
),
4042
)];
4143
if (fileHash != expectedHash) {
4244
throw Exception(

0 commit comments

Comments
 (0)