Skip to content

Commit

Permalink
Merge branch 'master' into misc/minor-pub-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandercampbell-wk committed Mar 5, 2024
2 parents bf046f7 + 0faa15a commit a5bf10d
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 283 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches:
- 'master'
- 'test_consume_*'
pull_request:
branches:
- '**'

jobs:
dart:
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows ]
sdk: [ 2.19.6, stable ]
name: Dart ${{ matrix.sdk }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Install dependencies
run: dart pub get
- name: Validate dependencies
run: dart run dependency_validator
- name: Analysis
run: dart run dart_dev analyze
- name: Formatting
if: ${{ matrix.sdk == 'stable' && matrix.os == 'ubuntu' }}
run: dart run dart_dev format --check
- name: Tests
run: dart run dart_dev test ${{ matrix.sdk != '2.19.6' && '--test-args="--exclude-tags dart2"' || '' }}
55 changes: 0 additions & 55 deletions .github/workflows/dart_ci.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.1.0

- Raise maximum SDK to include Dart 3.

## 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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dart:2.18.7
FROM dart:2.19.6
WORKDIR /build
ADD pubspec.yaml /build
RUN dart pub get
Expand Down
10 changes: 1 addition & 9 deletions lib/src/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,13 @@ 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),
// copy it over to the entrypoint so the program is run in that language version.
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 ?? ''}
Expand Down Expand Up @@ -163,7 +155,7 @@ Future<void> runWithConfig(
' but it either does not exist or threw unexpectedly:')
..writeln(' $error')
..writeln()
..writeln('For more info: http://github.com/Workiva/dart_dev#TODO');
..writeln('For more info: https://github.com/Workiva/dart_dev');
exitCode = ExitCode.config.code;
return;
}
Expand Down
Loading

0 comments on commit a5bf10d

Please sign in to comment.