Skip to content

Commit df76f89

Browse files
authored
add a warning if a build.yml file is found in the doctor command (#3616)
1 parent 7f5b103 commit df76f89

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

build_runner/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## 2.4.7-wip
1+
## 2.4.7
22

33
- Fix broken link in README.md.
44
- Bump the min sdk to 3.0.0.
5+
- Add a warning to the `doctor` command if a `build.yml` file is found (instead
6+
of a `build.yaml` file).
57

68
## 2.4.6
79

build_runner/lib/src/entrypoint/doctor.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:io';
67

78
import 'package:build/build.dart';
89
import 'package:build_config/build_config.dart';
@@ -11,6 +12,7 @@ import 'package:build_runner_core/build_runner_core.dart';
1112
import 'package:build_runner_core/src/generate/phase.dart';
1213
import 'package:io/io.dart';
1314
import 'package:logging/logging.dart';
15+
import 'package:path/path.dart' as p;
1416

1517
import '../logging/std_io_logging.dart';
1618
import '../package_graph/build_config_overrides.dart';
@@ -40,6 +42,14 @@ class DoctorCommand extends BuildRunnerCommand {
4042
isOk = isOk && builderOk;
4143
}
4244

45+
if (File(p.join(p.current, 'build.yml')).existsSync() &&
46+
!File(p.join(p.current, 'build.yaml')).existsSync()) {
47+
logger.warning(
48+
'Found a `build.yml` file but no `build.yaml` file, rename it with '
49+
'the `.yaml` extension for it to take effect.');
50+
isOk = false;
51+
}
52+
4353
if (isOk) {
4454
logger.info('No problems found!\n');
4555
}

build_runner/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_runner
2-
version: 2.4.7-wip
2+
version: 2.4.7
33
description: A build system for Dart code generation and modular compilation.
44
repository: https://github.com/dart-lang/build/tree/master/build_runner
55

0 commit comments

Comments
 (0)