Skip to content

Commit

Permalink
add a warning if a build.yml file is found in the doctor command (#3616)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Nov 28, 2023
1 parent 7f5b103 commit df76f89
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build_runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 2.4.7-wip
## 2.4.7

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

## 2.4.6

Expand Down
10 changes: 10 additions & 0 deletions build_runner/lib/src/entrypoint/doctor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:build/build.dart';
import 'package:build_config/build_config.dart';
Expand All @@ -11,6 +12,7 @@ import 'package:build_runner_core/build_runner_core.dart';
import 'package:build_runner_core/src/generate/phase.dart';
import 'package:io/io.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;

import '../logging/std_io_logging.dart';
import '../package_graph/build_config_overrides.dart';
Expand Down Expand Up @@ -40,6 +42,14 @@ class DoctorCommand extends BuildRunnerCommand {
isOk = isOk && builderOk;
}

if (File(p.join(p.current, 'build.yml')).existsSync() &&
!File(p.join(p.current, 'build.yaml')).existsSync()) {
logger.warning(
'Found a `build.yml` file but no `build.yaml` file, rename it with '
'the `.yaml` extension for it to take effect.');
isOk = false;
}

if (isOk) {
logger.info('No problems found!\n');
}
Expand Down
2 changes: 1 addition & 1 deletion build_runner/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_runner
version: 2.4.7-wip
version: 2.4.7
description: A build system for Dart code generation and modular compilation.
repository: https://github.com/dart-lang/build/tree/master/build_runner

Expand Down

0 comments on commit df76f89

Please sign in to comment.