Skip to content

Commit f66f5e7

Browse files
committed
chore: add development environment setup script and move dependency overrides
1 parent c0025bf commit f66f5e7

3 files changed

Lines changed: 28 additions & 6 deletions

File tree

pubspec.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,3 @@ dev_dependencies:
3030
json_serializable: ^6.12.0
3131
lints: ^6.0.0
3232
test: ^1.25.6
33-
34-
dependency_overrides:
35-
grumpy:
36-
path: ../grumpy
37-
grumpy_annotations:
38-
path: ../grumpy_annotations

pubspec_overrides.dev.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is used for development overrides. Run `dart tool/dev.dart` to apply these overrides.
2+
# `pubspec_overrides.yaml` is ignored by git, so it won't affect CI or other developers.
3+
dependency_overrides:
4+
grumpy:
5+
path: ../grumpy
6+
grumpy_annotations:
7+
path: ../grumpy_annotations

tool/dev.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// this is a tool script so a logging framework is lowkey overkill.
2+
// ignore_for_file: avoid_print
3+
4+
import 'dart:io';
5+
6+
/// Sets up the development environment by copying `pubspec_overrides.dev.yaml` to `pubspec_overrides.yaml`.
7+
/// This expects all other packages to be checked out in a sibling directory to the main `grumpy` package.
8+
void main() async {
9+
final src = File('pubspec_overrides.dev.yaml');
10+
11+
if (!await src.exists()) {
12+
print('No pubspec_overrides.dev.yaml found. Skipping.');
13+
return;
14+
}
15+
16+
final dst = File('pubspec_overrides.yaml');
17+
18+
await src.copy(dst.path);
19+
20+
print('Copied pubspec_overrides.dev.yaml to pubspec_overrides.yaml');
21+
}

0 commit comments

Comments
 (0)