[firehose] Fix dart_apitool invocations with pub workspaces (#355)
diff --git a/.vscode/launch.json b/.vscode/launch.json
index cfe3049..dc4c34b 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -6,7 +6,7 @@
"configurations": [
{
"name": "health",
- "program": "pkgs/firehose/bin/health.dart",
+ "program": "${workspaceFolder}/pkgs/firehose/bin/health.dart",
"request": "launch",
"type": "dart",
"env": {
@@ -16,9 +16,9 @@
"GITHUB_STEP_SUMMARY": "/tmp/github_step_summary_mock.md",
},
"args": [
- "--checks",
- "version,changelog,license,coverage,do-not-submit,leaking"
- ]
+ "--check",
+ "breaking"
+ ],
}
]
-}
\ No newline at end of file
+}
diff --git a/pkgs/firehose/CHANGELOG.md b/pkgs/firehose/CHANGELOG.md
index 4988a36..5ca0551 100644
--- a/pkgs/firehose/CHANGELOG.md
+++ b/pkgs/firehose/CHANGELOG.md
@@ -1,4 +1,6 @@
-## 1.0.0-wip
+## 0.10.3
+
+- Fix dart_apitool invocation in pub workspaces.
## 0.10.2
diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart
index 6708911..695bb7c 100644
--- a/pkgs/firehose/lib/src/health/health.dart
+++ b/pkgs/firehose/lib/src/health/health.dart
@@ -158,8 +158,7 @@
log('This list of Flutter packages is $flutterPackages');
for (var package in packagesContaining(filesInPR, ignore: ignored)) {
log('Look for changes in $package');
- var relativePath =
- path.relative(package.directory.path, from: directory.path);
+ final absolutePath = package.directory.absolute.path;
var tempDirectory = Directory.systemTemp.createTempSync();
var reportPath = path.join(tempDirectory.path, 'report.json');
@@ -185,7 +184,7 @@
'diff',
'--no-check-sdk-version',
...['--old', getCurrentVersionOfPackage(package)],
- ...['--new', relativePath],
+ ...['--new', absolutePath],
...['--report-format', 'json'],
...['--report-file-path', reportPath],
],
@@ -273,8 +272,7 @@
log('');
log('--- ${package.name} ---');
log('Look for leaks in ${package.name}');
- var relativePath =
- path.relative(package.directory.path, from: directory.path);
+ final absolutePath = package.directory.absolute.path;
var tempDirectory = Directory.systemTemp.createTempSync();
var reportPath = path.join(tempDirectory.path, 'leaks.json');
@@ -295,7 +293,7 @@
...['pub', 'global', 'run'],
'dart_apitool:main',
'extract',
- ...['--input', relativePath],
+ ...['--input', absolutePath],
...['--output', reportPath],
];
var runApiTool = runDashProcess(
diff --git a/pkgs/firehose/pubspec.yaml b/pkgs/firehose/pubspec.yaml
index dde1a03..88375b9 100644
--- a/pkgs/firehose/pubspec.yaml
+++ b/pkgs/firehose/pubspec.yaml
@@ -1,6 +1,6 @@
name: firehose
description: A tool to automate publishing of Pub packages from GitHub actions.
-version: 1.0.0-wip
+version: 0.10.3
repository: https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose
environment: