From 84a3d222c604c05ff50f0489a9c5a2a41a39bbd1 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 18 Oct 2022 16:48:52 +0000 Subject: [PATCH 1/2] Bump dependency on frontend_server_client Rely on non-null result from `compile`. --- build_runner/CHANGELOG.md | 4 ++++ build_runner/lib/src/build_script_generate/bootstrap.dart | 6 ++---- build_runner/pubspec.yaml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build_runner/CHANGELOG.md b/build_runner/CHANGELOG.md index 388701ca8..732ce6d31 100644 --- a/build_runner/CHANGELOG.md +++ b/build_runner/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.1 + +- Upgrade to `frontend_service_client` version 3. + ## 2.3.0 - Add `-d` as a shorthand for `--delete-conflicting-outputs`. diff --git a/build_runner/lib/src/build_script_generate/bootstrap.dart b/build_runner/lib/src/build_script_generate/bootstrap.dart index 97bb290d8..364dbd189 100644 --- a/build_runner/lib/src/build_script_generate/bootstrap.dart +++ b/build_runner/lib/src/build_script_generate/bootstrap.dart @@ -165,13 +165,11 @@ Future _createKernelIfNeeded(Logger logger) async { await logTimedAsync(logger, 'Precompiling build script...', () async { try { final result = await client.compile(); - hadErrors = result == null || - result.errorCount > 0 || - !(await kernelCacheFile.exists()); + hadErrors = result.errorCount > 0 || !(await kernelCacheFile.exists()); // Note: We're logging all output with a single log call to keep // annotated source spans intact. - final logOutput = result?.compilerOutputLines.join('\n'); + final logOutput = result.compilerOutputLines.join('\n'); if (logOutput != null && logOutput.isNotEmpty) { hadOutput = true; if (hadErrors) { diff --git a/build_runner/pubspec.yaml b/build_runner/pubspec.yaml index 696e4e1d1..f3e014fa2 100644 --- a/build_runner/pubspec.yaml +++ b/build_runner/pubspec.yaml @@ -1,5 +1,5 @@ name: build_runner -version: 2.3.0 +version: 2.3.1 description: A build system for Dart code generation and modular compilation. repository: https://github.com/dart-lang/build/tree/master/build_runner @@ -19,7 +19,7 @@ dependencies: collection: ^1.15.0 crypto: ^3.0.0 dart_style: ^2.0.0 - frontend_server_client: ^2.1.0 + frontend_server_client: ^3.0.0 glob: ^2.0.0 graphs: ^2.0.0 http_multi_server: ^3.0.0 From 3e18bb7df38bcd37cda9bba204ab9a8cd52c6cc1 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Tue, 18 Oct 2022 17:06:14 +0000 Subject: [PATCH 2/2] Another non-null var --- build_runner/lib/src/build_script_generate/bootstrap.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_runner/lib/src/build_script_generate/bootstrap.dart b/build_runner/lib/src/build_script_generate/bootstrap.dart index 364dbd189..8fc9bdaba 100644 --- a/build_runner/lib/src/build_script_generate/bootstrap.dart +++ b/build_runner/lib/src/build_script_generate/bootstrap.dart @@ -170,7 +170,7 @@ Future _createKernelIfNeeded(Logger logger) async { // Note: We're logging all output with a single log call to keep // annotated source spans intact. final logOutput = result.compilerOutputLines.join('\n'); - if (logOutput != null && logOutput.isNotEmpty) { + if (logOutput.isNotEmpty) { hadOutput = true; if (hadErrors) { // Always show compiler output if there were errors