From 9e6f3e87087c3e1a7d06560c6331acdd21f5cee4 Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Wed, 8 Nov 2023 15:35:33 -0700 Subject: [PATCH 1/2] Now that dart_dev itself is null-safe, it should be able to generate a null-safe run script --- lib/src/executable.dart | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/src/executable.dart b/lib/src/executable.dart index 0a85377e..335d5bcd 100644 --- a/lib/src/executable.dart +++ b/lib/src/executable.dart @@ -107,9 +107,6 @@ bool get shouldWriteRunScript => !_runScript.existsSync() || _runScript.readAsStringSync() != buildDartDevRunScriptContents(); -/// Whether dart_dev itself has opted into null-safety. -const _isDartDevNullSafe = false; - String buildDartDevRunScriptContents() { final hasCustomToolDevDart = File(paths.config).existsSync(); // If the config has a dart version comment (e.g., if it opts out of null safety), @@ -117,11 +114,6 @@ String buildDartDevRunScriptContents() { var dartVersionComment = hasCustomToolDevDart ? getDartVersionComment(File(paths.config).readAsStringSync()) : null; - // If dart_dev itself is not null-safe, opt the entrypoint out of null-safety - // so the entrypoint doesn't fail to run in packages that have opted into null-safety. - if (!_isDartDevNullSafe && dartVersionComment == null) { - dartVersionComment = '// @dart=2.9'; - } return ''' ${dartVersionComment ?? ''} From 28b3beef564c54d3a19a74368865a083a4b72c1e Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Thu, 9 Nov 2023 10:17:50 -0700 Subject: [PATCH 2/2] Changelog entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc3d9e2a..22abab41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 4.0.3 + +- Fix generation of the run script that the `dart_dev` CLI uses so that it can +run with sound null safety (and thus run on Dart 3). + ## 4.0.1 - Fix type mismatch between the expected return type of the function passed to