Skip to content

Commit 92db676

Browse files
authored
Merge branch 'dart-lang:master' into fix/unexpected-prerelease-upgrades
2 parents 0ee5d3c + c2e27b8 commit 92db676

File tree

7 files changed

+613
-251
lines changed

7 files changed

+613
-251
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
sdk: [dev]
2626
steps:
27-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
2828
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
2929
with:
3030
sdk: ${{ matrix.sdk }}
@@ -52,7 +52,7 @@ jobs:
5252
sdk: [dev]
5353
shard: [0, 1, 2, 3, 4, 5, 6]
5454
steps:
55-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
55+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
5656
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
5757
with:
5858
sdk: ${{ matrix.sdk }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'dart:async';
6+
7+
import '../command.dart';
8+
import '../command_runner.dart';
9+
import '../entrypoint.dart';
10+
import '../log.dart' as log;
11+
import '../utils.dart';
12+
13+
class CheckResolutionUpToDateCommand extends PubCommand {
14+
@override
15+
String get name => 'check-resolution-up-to-date';
16+
17+
@override
18+
bool get hidden => true;
19+
20+
@override
21+
String get description => '''
22+
Do a fast timestamp-based check to see resolution is up-to-date and internally
23+
consistent.
24+
25+
If timestamps are correctly ordered, exit 0, and do not check the external sources for
26+
newer versions.
27+
Otherwise exit non-zero.
28+
''';
29+
30+
@override
31+
String get argumentsDescription => '';
32+
33+
CheckResolutionUpToDateCommand();
34+
35+
@override
36+
Future<void> runProtected() async {
37+
final result = Entrypoint.isResolutionUpToDate(directory, cache);
38+
if (result == null) {
39+
fail('Resolution needs updating. Run `$topLevelProgram pub get`');
40+
} else {
41+
log.message('Resolution is up-to-date');
42+
}
43+
}
44+
}

lib/src/command_runner.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'command.dart' show PubTopLevel, lineLength;
1313
import 'command/add.dart';
1414
import 'command/bump.dart';
1515
import 'command/cache.dart';
16+
import 'command/check_resolution_up_to_date.dart';
1617
import 'command/deps.dart';
1718
import 'command/downgrade.dart';
1819
import 'command/get.dart';
@@ -151,6 +152,7 @@ class PubCommandRunner extends CommandRunner<int> implements PubTopLevel {
151152
addCommand(OutdatedCommand());
152153
addCommand(RemoveCommand());
153154
addCommand(RunCommand());
155+
addCommand(CheckResolutionUpToDateCommand());
154156
addCommand(UpgradeCommand());
155157
addCommand(UnpackCommand());
156158
addCommand(UploaderCommand());

0 commit comments

Comments
 (0)