Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a warning if a build.yml file is found in the doctor command #3616

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading