-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test project adding assets in link
- Loading branch information
Showing
6 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
pkgs/native_assets_builder/test_data/add_dylib_link/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ | ||
bin/add_dylib_link/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This sample adds a native library in the link step. |
1 change: 1 addition & 0 deletions
1
pkgs/native_assets_builder/test_data/add_dylib_link/assets/test.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
My test text |
9 changes: 9 additions & 0 deletions
9
pkgs/native_assets_builder/test_data/add_dylib_link/bin/add_dylib_link.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
import 'dart:io'; | ||
|
||
void main(List<String> arguments) { | ||
print(File('assets/test.txt').readAsStringSync()); | ||
} |
19 changes: 19 additions & 0 deletions
19
pkgs/native_assets_builder/test_data/add_dylib_link/hook/link.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
import 'package:native_assets_cli/native_assets_cli.dart'; | ||
|
||
void main(List<String> arguments) async { | ||
await link(arguments, (config, output) async { | ||
output | ||
..addAsset( | ||
DataAsset( | ||
package: 'add_dylib_link', | ||
name: 'test_text_file', | ||
file: config.packageRoot.resolve('assets/test.txt'), | ||
), | ||
) | ||
..addDependency(config.packageRoot.resolve('hook/link.dart')); | ||
}); | ||
} |
19 changes: 19 additions & 0 deletions
19
pkgs/native_assets_builder/test_data/add_dylib_link/pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: add_dylib_link | ||
description: Add a dylib in the link step. | ||
version: 1.0.0 | ||
|
||
publish_to: none | ||
|
||
environment: | ||
sdk: ^3.0.0 | ||
|
||
dependencies: | ||
logging: ^1.1.1 | ||
# native_assets_cli: ^0.5.0 | ||
meta: ^1.12.0 | ||
native_assets_cli: | ||
path: ../../../native_assets_cli/ | ||
|
||
dev_dependencies: | ||
lints: ^3.0.0 | ||
test: ^1.24.0 |