File tree Expand file tree Collapse file tree 6 files changed +42
-2
lines changed
pkgs/native_assets_builder Expand file tree Collapse file tree 6 files changed +42
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.8.1-wip
2
+
3
+ - Add more data asset test files.
4
+
1
5
## 0.8.0
2
6
3
7
- ` BuildRunner.build ` and ` BuildRunner.buildDryRun ` now have a required
Original file line number Diff line number Diff line change 1
1
name : native_assets_builder
2
2
description : >-
3
3
This package is the backend that invokes build hooks.
4
- version : 0.8.0
4
+ version : 0.8.1-wip
5
5
repository : https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder
6
6
7
7
# publish_to: none
Original file line number Diff line number Diff line change 89
89
- simple_data_asset/README.md
90
90
- simple_data_asset/hook/build.dart
91
91
- simple_data_asset/bin/simple_data_asset.dart.debug
92
+ - simple_data_asset/bin/modify_data_asset.dart.debug
93
+ - simple_data_asset/bin/deep_modify_data_asset.dart.debug
92
94
- some_dev_dep/bin/some_dev_dep.dart
93
95
- some_dev_dep/pubspec.yaml
94
96
- wrong_build_output_2/hook/build.dart
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+ import 'dart:asset';
5
+ import 'dart:typed_data';
6
+
7
+ Future<void> main(List<String> args) async {
8
+ print('Hello ${await getWorld()}');
9
+ }
10
+
11
+ // Expect this to throw
12
+ Future<String> getWorld() async {
13
+ const asset = ByteAsset('package:simple_data_asset/assetId');
14
+ final byteBuffer = await asset.load();
15
+ byteBuffer.buffer.asFloat32List()[0] = 1.0;
16
+ return String.fromCharCodes(byteBuffer);
17
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+ import 'dart:asset';
5
+ import 'dart:typed_data';
6
+
7
+ Future<void> main(List<String> args) async {
8
+ print('Hello ${await getWorld()}');
9
+ }
10
+
11
+ // Expect this to throw
12
+ Future<String> getWorld() async {
13
+ const asset = ByteAsset('package:simple_data_asset/assetId');
14
+ final byteBuffer = await asset.load();
15
+ byteBuffer[0] = 42;
16
+ return String.fromCharCodes(byteBuffer);
17
+ }
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ Future<void> main(List<String> args) async {
10
10
Future<String> getWorld() async {
11
11
const asset = ByteAsset('package:simple_data_asset/assetId');
12
12
final byteBuffer = await asset.load();
13
- return String.fromCharCodes(byteBuffer.asUint8List() );
13
+ return String.fromCharCodes(byteBuffer);
14
14
}
You can’t perform that action at this time.
0 commit comments