Skip to content

Commit 9ee4689

Browse files
authored
[native_toolchain_c] Rename assetName to assetId (#114)
1 parent 0187d0e commit 9ee4689

10 files changed

+17
-15
lines changed

pkgs/native_toolchain_c/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
## 0.1.1-wip
1+
## 0.2.0
22

33
- Added topics.
4+
- *Breaking change* Rename `assetName` to `assetId`
5+
([#100](https://github.com/dart-lang/native/issues/100)).
46

57
## 0.1.0
68

pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class CBuilder implements Builder {
3636
/// Used to output the [BuildOutput.assets].
3737
///
3838
/// If omitted, no asset will be added to the build output.
39-
final String? assetName;
39+
final String? assetId;
4040

4141
/// Sources to build the library or executable.
4242
///
@@ -59,7 +59,7 @@ class CBuilder implements Builder {
5959

6060
CBuilder.library({
6161
required this.name,
62-
required this.assetName,
62+
required this.assetId,
6363
this.sources = const [],
6464
this.dartBuildFiles = const ['build.dart'],
6565
@visibleForTesting this.installName,
@@ -70,7 +70,7 @@ class CBuilder implements Builder {
7070
this.sources = const [],
7171
this.dartBuildFiles = const ['build.dart'],
7272
}) : _type = _CBuilderType.executable,
73-
assetName = null,
73+
assetId = null,
7474
installName = null;
7575

7676
/// Runs the C Compiler with on this C build spec.
@@ -116,7 +116,7 @@ class CBuilder implements Builder {
116116
await task.run();
117117
}
118118

119-
if (assetName != null) {
119+
if (assetId != null) {
120120
final targets = [
121121
if (!buildConfig.dryRun)
122122
buildConfig.target
@@ -126,7 +126,7 @@ class CBuilder implements Builder {
126126
];
127127
for (final target in targets) {
128128
buildOutput.assets.add(Asset(
129-
name: assetName!,
129+
id: assetId!,
130130
linkMode: linkMode,
131131
target: target,
132132
path: AssetAbsolutePath(libUri),

pkgs/native_toolchain_c/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: native_toolchain_c
22
description: >-
33
A library to invoke the native C compiler installed on the host machine.
4-
version: 0.1.1-wip
4+
version: 0.2.0
55
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c
66

77
topics:
@@ -19,7 +19,7 @@ dependencies:
1919
glob: ^2.1.1
2020
logging: ^1.1.1
2121
meta: ^1.9.1
22-
native_assets_cli: ^0.1.0
22+
native_assets_cli: ^0.2.0
2323
pub_semver: ^2.1.3
2424

2525
dev_dependencies:

pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void main() {
4848
final cbuilder = CBuilder.library(
4949
sources: [addCUri.toFilePath()],
5050
name: name,
51-
assetName: name,
51+
assetId: name,
5252
);
5353
expect(
5454
() => cbuilder.run(

pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Future<Uri> buildLib(
127127

128128
final cbuilder = CBuilder.library(
129129
name: name,
130-
assetName: name,
130+
assetId: name,
131131
sources: [addCUri.toFilePath()],
132132
);
133133
await cbuilder.run(

pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void main() {
7171

7272
final cbuilder = CBuilder.library(
7373
name: name,
74-
assetName: name,
74+
assetId: name,
7575
sources: [addCUri.toFilePath()],
7676
installName: installName,
7777
);

pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void main() {
5656

5757
final cbuilder = CBuilder.library(
5858
name: name,
59-
assetName: name,
59+
assetId: name,
6060
sources: [addCUri.toFilePath()],
6161
);
6262
await cbuilder.run(

pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void main() {
5656

5757
final cbuilder = CBuilder.library(
5858
name: name,
59-
assetName: name,
59+
assetId: name,
6060
sources: [addCUri.toFilePath()],
6161
);
6262
await cbuilder.run(

pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void main() {
6868

6969
final cbuilder = CBuilder.library(
7070
name: name,
71-
assetName: name,
71+
assetId: name,
7272
sources: [addCUri.toFilePath()],
7373
);
7474
await cbuilder.run(

pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void main() {
106106
final cbuilder = CBuilder.library(
107107
sources: [addCUri.toFilePath()],
108108
name: name,
109-
assetName: name,
109+
assetId: name,
110110
);
111111
await cbuilder.run(
112112
buildConfig: buildConfig,

0 commit comments

Comments
 (0)