Skip to content

Commit

Permalink
[native_toolchain_c] Remove private dependency use (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes authored Jan 16, 2024
1 parent 1abfcfa commit 8f3e4c2
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
ndk-version: r26b
if: ${{ matrix.sdk == 'stable' }}

- run: dart run ../../tools/check_pubspec_overrides.dart

- run: dart run ../../tools/delete_pubspec_overrides.dart
if: ${{ matrix.dependencies == 'published' }}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
native_toolchain_c:
path: ../../../../native_toolchain_c/
1 change: 1 addition & 0 deletions pkgs/native_assets_builder/test/data/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- cyclic_package_2/pubspec_overrides.yaml
- dart_app/bin/dart_app.dart
- dart_app/pubspec.yaml
- dart_app/pubspec_overrides.yaml
- native_add/build.dart
- native_add/ffigen.yaml
- native_add/lib/native_add.dart
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependency_overrides:
native_assets_cli:
path: ../../../../native_assets_cli/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependency_overrides:
native_assets_cli:
path: ../../../native_assets_cli/
native_toolchain_c:
path: ../../../native_toolchain_c/
4 changes: 4 additions & 0 deletions pkgs/native_toolchain_c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.4+1

- Stop depending on private `package:native_assets_cli` `CCompilerConfig` fields.

## 0.3.4

- Bump `package:native_assets_cli` to 0.4.0.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/native_toolchain_c/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: native_toolchain_c
description: >-
A library to invoke the native C compiler installed on the host machine.
version: 0.3.4
version: 0.3.4+1
repository: https://github.com/dart-lang/native/tree/main/pkgs/native_toolchain_c

topics:
Expand Down
26 changes: 26 additions & 0 deletions tools/check_pubspec_overrides.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'dart:io';

void main(List<String> arguments) async {
final allPubspecs = await Directory.current
.list(recursive: true)
.where((f) => f.path.endsWith('pubspec.yaml'))
.map((f) => f as File)
.toList();
final nativePubspecs =
allPubspecs.where((f) => f.path.contains('pkgs/native_')).toList();
final missingOverrides = nativePubspecs
.map((element) =>
File.fromUri(element.uri.resolve('pubspec_overrides.yaml')))
.where((f) => !f.existsSync())
.where((f) =>
!f.path.endsWith('pkgs/native_assets_cli/pubspec_overrides.yaml'))
.toList()
.join('\n');
if (missingOverrides.isEmpty) {
print('No missing overrides.');
} else {
print('Missing overrides:');
print(missingOverrides);
exit(1);
}
}

0 comments on commit 8f3e4c2

Please sign in to comment.