Skip to content

Commit 8f3e4c2

Browse files
authored
[native_toolchain_c] Remove private dependency use (#894)
1 parent 1abfcfa commit 8f3e4c2

File tree

8 files changed

+47
-1
lines changed

8 files changed

+47
-1
lines changed

.github/workflows/native.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
ndk-version: r26b
6464
if: ${{ matrix.sdk == 'stable' }}
6565

66+
- run: dart run ../../tools/check_pubspec_overrides.dart
67+
6668
- run: dart run ../../tools/delete_pubspec_overrides.dart
6769
if: ${{ matrix.dependencies == 'published' }}
6870

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependency_overrides:
2+
native_assets_cli:
3+
path: ../../../../native_assets_cli/
4+
native_toolchain_c:
5+
path: ../../../../native_toolchain_c/

pkgs/native_assets_builder/test/data/manifest.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- cyclic_package_2/pubspec_overrides.yaml
99
- dart_app/bin/dart_app.dart
1010
- dart_app/pubspec.yaml
11+
- dart_app/pubspec_overrides.yaml
1112
- native_add/build.dart
1213
- native_add/ffigen.yaml
1314
- native_add/lib/native_add.dart
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependency_overrides:
2+
native_assets_cli:
3+
path: ../../../../native_assets_cli/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependency_overrides:
2+
native_assets_cli:
3+
path: ../../../native_assets_cli/
4+
native_toolchain_c:
5+
path: ../../../native_toolchain_c/

pkgs/native_toolchain_c/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.4+1
2+
3+
- Stop depending on private `package:native_assets_cli` `CCompilerConfig` fields.
4+
15
## 0.3.4
26

37
- Bump `package:native_assets_cli` to 0.4.0.

pkgs/native_toolchain_c/pubspec.yaml

Lines changed: 1 addition & 1 deletion
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.3.4
4+
version: 0.3.4+1
55
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c
66

77
topics:

tools/check_pubspec_overrides.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'dart:io';
2+
3+
void main(List<String> arguments) async {
4+
final allPubspecs = await Directory.current
5+
.list(recursive: true)
6+
.where((f) => f.path.endsWith('pubspec.yaml'))
7+
.map((f) => f as File)
8+
.toList();
9+
final nativePubspecs =
10+
allPubspecs.where((f) => f.path.contains('pkgs/native_')).toList();
11+
final missingOverrides = nativePubspecs
12+
.map((element) =>
13+
File.fromUri(element.uri.resolve('pubspec_overrides.yaml')))
14+
.where((f) => !f.existsSync())
15+
.where((f) =>
16+
!f.path.endsWith('pkgs/native_assets_cli/pubspec_overrides.yaml'))
17+
.toList()
18+
.join('\n');
19+
if (missingOverrides.isEmpty) {
20+
print('No missing overrides.');
21+
} else {
22+
print('Missing overrides:');
23+
print(missingOverrides);
24+
exit(1);
25+
}
26+
}

0 commit comments

Comments
 (0)