mirror of
https://github.com/dart-lang/sdk
synced 2024-10-02 23:39:19 +00:00
Bump pub
New commits: git log --format="%C(auto) %h %s" 900e796a37fd9f68de9dd183cf4798fe5f055eaa..4ca4767a6c00b2dadecdaee9a4866dae40ef25f2 4ca4767a Added a dart pub outdated --transitive option (#2731) 6b145bd6 Deprecate --server argument to `pub publish` and `pub uploader`. (#2697) 7737023a don't warn if previous prerelease was null safe (#2730) 62f92838 Improve outdated --mode=null-safety (#2724) cc589ec3 Change message for no Latest resolution (#2729) 656803e9 Require sdk constraint (#2718) 8309d877 Added test that dev_dependency does not trigger null-safety warnings when publishing (#2727) 332ea049 Remove warning about mixed mode. (#2723) a98a1f23 Simplify null-safety analysis in `pub outdated --mode=null-safety` (#2721) 5fba2015 Outdated null safety implies prereleases (#2722) fb9ec4af Fixed bug in yaml_edit (#2703) Change-Id: I22a084aee06542e04a272269fb0134f0ac62f779 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170690 Commit-Queue: Sigurd Meldgaard <sigurdm@google.com> Reviewed-by: Michael Thomsen <mit@google.com> Reviewed-by: Jonas Jensen <jonasfj@google.com>
This commit is contained in:
parent
391bc8d33d
commit
9d132ebba9
26
CHANGELOG.md
26
CHANGELOG.md
|
@ -85,15 +85,31 @@ Updated the Linter to `0.1.123`, which includes:
|
||||||
|
|
||||||
#### Pub
|
#### Pub
|
||||||
|
|
||||||
|
* **Breaking**: The Dart SDK constraint is now **required** in `pubspec.yaml`.
|
||||||
|
|
||||||
|
You now have to include a section like:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.10.0 <3.0.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
See [#44072][].
|
||||||
* The top level `pub` executable has been deprecated. Use `dart pub` instead.
|
* The top level `pub` executable has been deprecated. Use `dart pub` instead.
|
||||||
* New commands `dart pub add` and `dart pub remove` that adds and removes new
|
See [dart tool][].
|
||||||
dependencies to your `pubspec.yaml`.
|
* New command `dart pub add` that adds new dependencies to your `pubspec.yaml`.
|
||||||
* New option `dart pub outdated mode=null-safety` that will analyze your
|
|
||||||
|
And a corresponding `dart pub remove` that removes dependencies.
|
||||||
|
* New option `dart pub outdated --mode=null-safety` that will analyze your
|
||||||
dependencies for null-safety.
|
dependencies for null-safety.
|
||||||
* `dart pub publish` will now check your pubspec keys for likely typos.
|
* `dart pub publish` will now check your pubspec keys for likely typos.
|
||||||
* `dart pub get` will print a warning if the resolution is in mixed-mode requiring
|
|
||||||
the code to run with `dart --no-sound-null-safety`.
|
|
||||||
* New command `dart pub login` that logs in to pub.dev.
|
* New command `dart pub login` that logs in to pub.dev.
|
||||||
|
* The `--server` option to `dart pub publish` and `dart pub uploader` have been
|
||||||
|
deprecated. Use `publish_to` in your `pubspec.yaml` or set the
|
||||||
|
`$PUB_HOSTED_URL` environment variable.
|
||||||
|
|
||||||
|
[#44072]: https://github.com/dart-lang/sdk/issues/44072
|
||||||
|
[dart tool]: https://dart.dev/tools/dart-tool
|
||||||
|
|
||||||
## 2.10.3 - 2020-10-29
|
## 2.10.3 - 2020-10-29
|
||||||
|
|
||||||
|
|
2
DEPS
2
DEPS
|
@ -132,7 +132,7 @@ vars = {
|
||||||
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
|
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
|
||||||
"pool_rev": "eedbd5fde84f9a1a8da643b475305a81841da599",
|
"pool_rev": "eedbd5fde84f9a1a8da643b475305a81841da599",
|
||||||
"protobuf_rev": "3746c8fd3f2b0147623a8e3db89c3ff4330de760",
|
"protobuf_rev": "3746c8fd3f2b0147623a8e3db89c3ff4330de760",
|
||||||
"pub_rev": "900e796a37fd9f68de9dd183cf4798fe5f055eaa",
|
"pub_rev": "4ca4767a6c00b2dadecdaee9a4866dae40ef25f2",
|
||||||
"pub_semver_tag": "v1.4.4",
|
"pub_semver_tag": "v1.4.4",
|
||||||
"resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7",
|
"resource_rev": "6b79867d0becf5395e5819a75720963b8298e9a7",
|
||||||
"root_certificates_rev": "7e5ec82c99677a2e5b95ce296c4d68b0d3378ed8",
|
"root_certificates_rev": "7e5ec82c99677a2e5b95ce296c4d68b0d3378ed8",
|
||||||
|
|
89
pkg/dartdev/lib/src/commands/pub.dart
Normal file
89
pkg/dartdev/lib/src/commands/pub.dart
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:args/args.dart';
|
||||||
|
|
||||||
|
import '../core.dart';
|
||||||
|
import '../experiments.dart';
|
||||||
|
import '../sdk.dart';
|
||||||
|
import '../vm_interop_handler.dart';
|
||||||
|
|
||||||
|
class PubCommand extends DartdevCommand {
|
||||||
|
static const String cmdName = 'pub';
|
||||||
|
|
||||||
|
PubCommand() : super(cmdName, 'Work with packages.');
|
||||||
|
|
||||||
|
// TODO(jwren) as soon as pub commands are are implemented directly in
|
||||||
|
// dartdev, remove this static list.
|
||||||
|
/// A list of all subcommands, used only for the implementation of
|
||||||
|
/// [usagePath], see below.
|
||||||
|
static List<String> pubSubcommands = [
|
||||||
|
'cache',
|
||||||
|
'deps',
|
||||||
|
'downgrade',
|
||||||
|
'get',
|
||||||
|
'global',
|
||||||
|
'logout',
|
||||||
|
'outdated',
|
||||||
|
'publish',
|
||||||
|
'run',
|
||||||
|
'upgrade',
|
||||||
|
'uploader',
|
||||||
|
'version',
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
ArgParser createArgParser() => ArgParser.allowAnything();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void printUsage() {
|
||||||
|
// Override [printUsage] for invocations of 'dart help pub' which won't
|
||||||
|
// execute [run] below. Without this, the 'dart help pub' reports the
|
||||||
|
// command pub with no commands or flags.
|
||||||
|
if (!Sdk.checkArtifactExists(sdk.pubSnapshot)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final command = sdk.pubSnapshot;
|
||||||
|
final args = ['help'];
|
||||||
|
|
||||||
|
log.trace('$command ${args.first}');
|
||||||
|
|
||||||
|
// Call 'pub help'
|
||||||
|
VmInteropHandler.run(command, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<int> run() async {
|
||||||
|
if (!Sdk.checkArtifactExists(sdk.pubSnapshot)) {
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
final command = sdk.pubSnapshot;
|
||||||
|
var args = argResults.arguments;
|
||||||
|
|
||||||
|
// Pass any --enable-experiment options along.
|
||||||
|
if (args.isNotEmpty && wereExperimentsSpecified) {
|
||||||
|
List<String> experimentIds = specifiedExperiments;
|
||||||
|
|
||||||
|
if (args.first == 'run') {
|
||||||
|
args = [
|
||||||
|
...args.sublist(0, 1),
|
||||||
|
'--$experimentFlagName=${experimentIds.join(',')}',
|
||||||
|
...args.sublist(1),
|
||||||
|
];
|
||||||
|
} else if (args.length > 1 && args[0] == 'global' && args[0] == 'run') {
|
||||||
|
args = [
|
||||||
|
...args.sublist(0, 2),
|
||||||
|
'--$experimentFlagName=${experimentIds.join(',')}',
|
||||||
|
...args.sublist(2),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.trace('$command ${args.join(' ')}');
|
||||||
|
VmInteropHandler.run(command, args);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -86,8 +86,9 @@ void pub() {
|
||||||
expect(result.stdout, isEmpty);
|
expect(result.stdout, isEmpty);
|
||||||
expect(
|
expect(
|
||||||
result.stderr,
|
result.stderr,
|
||||||
contains('bin/main.dart:1:18: Error: This requires the \'non-nullable\''
|
contains('bin/main.dart:1:18: Error: This requires the null safety '
|
||||||
' language feature to be enabled.\n'));
|
'language feature, which requires language version of 2.12 or '
|
||||||
|
'higher.\n'));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('failure', () {
|
test('failure', () {
|
||||||
|
|
|
@ -69,7 +69,11 @@ void defineTest() {
|
||||||
|
|
||||||
test('no package:test dependency', () {
|
test('no package:test dependency', () {
|
||||||
p = project(mainSrc: 'int get foo => 1;\n');
|
p = project(mainSrc: 'int get foo => 1;\n');
|
||||||
p.file('pubspec.yaml', 'name: ${p.name}\n');
|
p.file('pubspec.yaml', '''
|
||||||
|
name: ${p.name}
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.10.0 <3.0.0'
|
||||||
|
''');
|
||||||
|
|
||||||
var result = p.runSync('pub', ['get']);
|
var result = p.runSync('pub', ['get']);
|
||||||
expect(result.exitCode, 0);
|
expect(result.exitCode, 0);
|
||||||
|
|
|
@ -42,7 +42,14 @@ class TestProject {
|
||||||
this.logAnalytics = false,
|
this.logAnalytics = false,
|
||||||
}) {
|
}) {
|
||||||
dir = Directory.systemTemp.createTempSync('dartdev');
|
dir = Directory.systemTemp.createTempSync('dartdev');
|
||||||
file('pubspec.yaml', 'name: $name\ndev_dependencies:\n test: any\n');
|
file('pubspec.yaml', '''
|
||||||
|
name: $name
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.10.0 <3.0.0'
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
test: any
|
||||||
|
''');
|
||||||
if (analysisOptions != null) {
|
if (analysisOptions != null) {
|
||||||
file('analysis_options.yaml', analysisOptions);
|
file('analysis_options.yaml', analysisOptions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
PUBSPEC = """name: pub_integration_test
|
PUBSPEC = """name: pub_integration_test
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.10.0 <=3.0.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
shelf:
|
shelf:
|
||||||
test:
|
test:
|
||||||
|
|
Loading…
Reference in a new issue