Skip to content

Commit 3c5e2a0

Browse files
sigurdmcommit-bot@chromium.org
authored andcommitted
Bump pub to 0035a40f25d027130c0314571da53ffafc6d973b
Changes: ``` > git log --format="%C(auto) %h %s" 78bc50c..0035a40 https://dart.googlesource.com/pub.git/+/0035a40f Fix echo mode crash on `token add` (#3194) https://dart.googlesource.com/pub.git/+/a75a8c17 Don't warn against discontinued transitive dependencies (#3195) https://dart.googlesource.com/pub.git/+/cf2ed105 Fix analytics code (#3197) https://dart.googlesource.com/pub.git/+/08e13f7b Remove unused golden files (#3189) https://dart.googlesource.com/pub.git/+/b6293b80 Fix log message related to `pub global activate` (#3187) https://dart.googlesource.com/pub.git/+/94f6b477 Introducing command-line interface tests (#3161) https://dart.googlesource.com/pub.git/+/3ba8134f More details from getExecutableForCommand (#3186) https://dart.googlesource.com/pub.git/+/a2dbcfff Shorthand syntax for hosted dependencies (#3133) https://dart.googlesource.com/pub.git/+/435e4e3f Shuffle analytics (#3185) ``` Diff: https://dart.googlesource.com/pub.git/+/78bc50c7833451c24e531713362e46fd50621ff0~..0035a40f25d027130c0314571da53ffafc6d973b/ Change-Id: Idfd7c382985d1ad3e3ad87a621dc79d3b74e898e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218620 Reviewed-by: Jonas Jensen <[email protected]> Commit-Queue: Sigurd Meldgaard <[email protected]>
1 parent eaf7674 commit 3c5e2a0

File tree

4 files changed

+49
-29
lines changed

4 files changed

+49
-29
lines changed

CHANGELOG.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
#### Linter
496496

497497
Updated the Linter to `1.14.0`, which includes changes that
498-
- fix `omit_local_variable_types` to not flag a local type that is
498+
- fix `omit_local_variable_types` to not flag a local type that is
499499
required for inference.
500500
- allow `while (true) { ... }` in `literal_only_boolean_expressions`.
501501
- fix `file_names` to report at the start of the file (not the entire
@@ -538,14 +538,47 @@ Updated the Linter to `1.14.0`, which includes changes that
538538

539539
### Pub
540540

541-
- Adds support for token-based authorization to third party package-repositories
541+
- If you have analytics enabled `dart pub get` will send
542+
[usage metrics](https://github.com/dart-lang/pub/blob/0035a40f25d027130c0314571da53ffafc6d973b/lib/src/solver/result.dart#L131-L175)
543+
for packages from pub.dev, intended for popularity analysis.
544+
545+
- Adds support for token-based authorization to third-party package-repositories
542546
with the new command `dart pub token`.
543547
- Credentials are no longer stored in the pub-cache, but in a platform dependent
544548
config directory:
545549
* On Linux `$XDG_CONFIG_HOME/dart/pub-credentials.json` if `$XDG_CONFIG_HOME`
546550
is defined, otherwise `$HOME/.config/dart/pub-credentials.json`
547551
* On Mac OS: `$HOME/Library/Application Support/dart/pub-credentials.json`
548552
* On Windows: `%APPDATA%/dart/pub-credentials.json`
553+
- The syntax for dependencies hosted at a third-party package repository has
554+
been simplified. Before you would need to write:
555+
556+
```
557+
dependencies:
558+
colorizer:
559+
hosted:
560+
name: colorizer
561+
url: 'https://custom-pub-server.com'
562+
version: ^1.2.3
563+
environment:
564+
sdk: '>=2.14.0 < 3.0.0'
565+
```
566+
567+
Now you can write:
568+
569+
```
570+
dependencies:
571+
colorizer:
572+
hosted: 'https://custom-pub-server.com'
573+
version: ^1.2.3
574+
environment:
575+
sdk: '>=2.15.0 < 3.0.0'
576+
```
577+
578+
This feature requires
579+
[language-version](https://dart.dev/guides/language/evolution#language-versioning)
580+
2.15 or later, e.g. the `pubspec.yaml` should have an SDK constraint of
581+
`>=2.15 <3.0.0`.
549582

550583
- Detect potential leaks in `dart pub publish`.
551584
When publishing, pub will examine your files for potential secret keys, and

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ vars = {
139139
"pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
140140
"process_rev": "56ece43b53b64c63ae51ec184b76bd5360c28d0b",
141141
"protobuf_rev": "c1eb6cb51af39ccbaa1a8e19349546586a5c8e31",
142-
"pub_rev": "78bc50c7833451c24e531713362e46fd50621ff0",
142+
"pub_rev": "0035a40f25d027130c0314571da53ffafc6d973b",
143143
"pub_semver_rev": "a43ad72fb6b7869607581b5fedcb186d1e74276a",
144144
"root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
145145
"rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",

pkg/dartdev/lib/src/commands/run.dart

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,31 +228,18 @@ class RunCommand extends DartdevCommand {
228228
}
229229
}
230230

231-
String path;
232-
String packagesConfigOverride;
233-
234231
try {
235-
final filename = maybeUriToFilename(mainCommand);
236-
if (File(filename).existsSync()) {
237-
// TODO(sigurdm): getExecutableForCommand is able to figure this out,
238-
// but does not return a package config override.
239-
path = filename;
240-
packagesConfigOverride = null;
241-
} else {
242-
path = await getExecutableForCommand(mainCommand);
243-
packagesConfigOverride =
244-
join(current, '.dart_tool', 'package_config.json');
245-
}
232+
final executable = await getExecutableForCommand(mainCommand);
233+
VmInteropHandler.run(
234+
executable.executable,
235+
runArgs,
236+
packageConfigOverride: executable.packageConfig,
237+
);
238+
return 0;
246239
} on CommandResolutionFailedException catch (e) {
247240
log.stderr(e.message);
248241
return errorExitCode;
249242
}
250-
VmInteropHandler.run(
251-
path,
252-
runArgs,
253-
packageConfigOverride: packagesConfigOverride,
254-
);
255-
return 0;
256243
}
257244
}
258245

pkg/dartdev/lib/src/commands/test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'dart:async';
66

77
import 'package:args/args.dart';
8-
import 'package:path/path.dart';
98
import 'package:pub/pub.dart';
109

1110
import '../core.dart';
@@ -32,15 +31,16 @@ class TestCommand extends DartdevCommand {
3231
try {
3332
final testExecutable = await getExecutableForCommand('test:test');
3433
log.trace('dart $testExecutable ${argResults.rest.join(' ')}');
35-
VmInteropHandler.run(testExecutable, argResults.rest,
36-
packageConfigOverride:
37-
join(current, '.dart_tool', 'package_config.json'));
34+
VmInteropHandler.run(testExecutable.executable, argResults.rest,
35+
packageConfigOverride: testExecutable.packageConfig);
3836
return 0;
3937
} on CommandResolutionFailedException catch (e) {
4038
if (project.hasPubspecFile) {
4139
print(e.message);
42-
print('You need to add a dev_dependency on package:test.');
43-
print('Try running `dart pub add --dev test`.');
40+
if (e.issue == CommandResolutionIssue.packageNotFound) {
41+
print('You need to add a dev_dependency on package:test.');
42+
print('Try running `dart pub add --dev test`.');
43+
}
4444
} else {
4545
print(
4646
'No pubspec.yaml file found - run this command in your project folder.');

0 commit comments

Comments
 (0)