Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffigen] Replace cli_util's getSdkPath() with sdkPath #1686

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkgs/ffigen/example/shared_bindings/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:io';
import 'package:cli_util/cli_util.dart';
import 'package:path/path.dart' as p;

ProcessResult runFfigenForConfig(String sdkPath, String configPath) {
ProcessResult runFfigenForConfig(String configPath) {
return Process.runSync(
p.join(sdkPath, 'bin', 'dart'),
[
Expand All @@ -16,14 +16,13 @@ ProcessResult runFfigenForConfig(String sdkPath, String configPath) {
}

void main() {
final sdkPath = getSdkPath();
final configPaths = [
'ffigen_configs/base.yaml',
'ffigen_configs/a.yaml',
'ffigen_configs/a_shared_base.yaml'
];
for (final configPath in configPaths) {
final res = runFfigenForConfig(sdkPath, configPath);
final res = runFfigenForConfig(configPath);
print(res.stdout.toString());
if (res.exitCode != 0) {
throw Exception('Some error occurred: ${res.stderr.toString()}');
Expand Down
2 changes: 1 addition & 1 deletion pkgs/ffigen/example/shared_bindings/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
sdk: '>=3.2.0 <4.0.0'

dependencies:
cli_util: ^0.4.0
cli_util: ^0.4.2
ffi: ^2.0.1
path: ^1.8.0

Expand Down
2 changes: 1 addition & 1 deletion pkgs/ffigen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ environment:

dependencies:
args: ^2.0.0
cli_util: ^0.4.0
cli_util: ^0.4.2
collection: ^1.18.0
ffi: ^2.0.1
file: ^7.0.0
Expand Down
2 changes: 1 addition & 1 deletion pkgs/ffigen/test/header_parser_tests/dart_handle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
${strings.name}: 'NativeLibrary'
${strings.description}: 'Dart_Handle Test'
${strings.output}: 'unused'
${strings.compilerOpts}: '-I${path.join(getSdkPath(), "include")}'
${strings.compilerOpts}: '-I${path.join(sdkPath, "include")}'

${strings.headers}:
${strings.entryPoints}:
Expand Down
Loading