Skip to content

Commit e627198

Browse files
Merge pull request #116 from Workiva/dart3
FEA-3240: Support Dart v3
2 parents 27d3084 + 9a90010 commit e627198

File tree

11 files changed

+246
-288
lines changed

11 files changed

+246
-288
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020

2121
snapshots:
2222
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
dir:
27+
- path: basic-project
28+
- path: diagnostics
29+
- path: dart3-features
30+
sdk: 3.7.2
2331
steps:
2432
- uses: actions/checkout@v4
2533
- name: Install scip cli
@@ -29,38 +37,31 @@ jobs:
2937
3038
- uses: dart-lang/setup-dart@v1
3139
with:
32-
# use a fixed version number so changes to 'stable', dont break snapshot diffs (language version is used in the scip symbol)
33-
sdk: 2.19.6
34-
- name: dart pub get scip-dart package
40+
sdk: ${{ matrix.dir.sdk != null && matrix.dir.sdk || '2.19.6' }}
41+
- name: pub get scip-dart package
3542
run: dart pub get
3643

37-
- name: dart pub get basic-project directory
44+
- name: pub get
45+
working-directory: ./snapshots/input/${{ matrix.dir.path }}
3846
run: dart pub get
39-
working-directory: ./snapshots/input/basic-project
40-
41-
- name: dart pub get diagnostics directory
42-
run: dart pub get
43-
working-directory: ./snapshots/input/diagnostics
4447

4548
- name: Snapshots Diff Check
4649
run: |
47-
dart run scip_dart ./snapshots/input/basic-project --index-pubspec
48-
./scip snapshot --to ./snapshots/output/basic-project
50+
dart run scip_dart ./snapshots/input/${{ matrix.dir.path }} --index-pubspec
51+
./scip snapshot --to ./snapshots/output/${{ matrix.dir.path }}
4952
50-
dart run scip_dart ./snapshots/input/diagnostics --index-pubspec
51-
./scip snapshot --to ./snapshots/output/diagnostics
52-
53-
if [[ -z "$(git status --porcelain ./snapshots/output)" ]];
53+
if [[ -z "$(git status --porcelain ./snapshots/output/${{ matrix.dir.path }})" ]];
5454
then
5555
echo "No changes to snapshot files"
5656
else
5757
echo
58-
echo "Snapshot diff detected differences, run 'make gen-snaps' to re-generate snapshots"
59-
git status --short ./snapshots/output
58+
echo "Snapshot diff detected differences, run 'make regen-snapshots' to re-generate snapshots"
59+
git --no-pager diff ./snapshots/output/${{ matrix.dir.path }}
6060
echo
6161
exit 1
6262
fi
6363
64+
6465
consumer:
6566
runs-on: ubuntu-latest
6667
strategy:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
.DS_Store
33
index.scip
44
snapshots/input/staging-project/lib/**
5-
snapshots/output/staging-project/lib/**
5+
snapshots/output/staging-project/lib/**
6+
7+
# Temporary while we support both dart 2 and 3
8+
pubspec.lock

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dart 2.19.6

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ regen-snapshots:
55
dart run scip_dart ./snapshots/input/diagnostics --index-pubspec
66
scip snapshot --to ./snapshots/output/diagnostics
77

8+
asdf set dart 3.7.2
9+
dart pub upgrade
10+
dart run scip_dart ./snapshots/input/dart3-features --index-pubspec
11+
scip snapshot --to ./snapshots/output/dart3-features
12+
asdf set dart 2.19.6
13+
814
run:
915
dart run scip_dart ./snapshots/input/staging-project --verbose
1016

pubspec.lock

Lines changed: 0 additions & 269 deletions
This file was deleted.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: generates scip bindings for dart files
44
repository: https://github.com/Workiva/scip-dart
55

66
environment:
7-
sdk: ">=2.19.6 <3.0.0"
7+
sdk: ">=2.19.6 <4.0.0"
88

99
executables:
1010
scip_dart:

0 commit comments

Comments
 (0)