Commit Graph

1123 Commits

Author SHA1 Message Date
Paul Berry 717efd357f Migration: do not add ? after the Null type
Fixes #42322.

Change-Id: I4c26985da520e024b8a6c335834dd0fc2a41d59d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151561
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 21:29:51 +00:00
Paul Berry 7cd5e1ecbd Sort declarations in fix_builder.dart
Change-Id: I914e6fb43f17d8b2c2f01ec83a13c0bb9ef1e729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151580
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-17 21:29:51 +00:00
John Ryan 8fe9dac0c8 add Dart logo to null safety migration tool
Change-Id: Ie9cd580fad0e596f1653e3a87cde75e133d1fe2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151360
Commit-Queue: John Ryan <ryjohn@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-17 20:17:21 +00:00
Paul Berry 82750c58f7 Update toList in analyzer's mock SDK
Fixes #42327.

Change-Id: Iecab55d0c97d439de02ac63ba53a0511532c773f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 17:20:57 +00:00
Sam Rawlins 8fcb9e4b0e Migrator: draw a hard edge when marking an AsExpression non-nullable
Fixes https://github.com/dart-lang/sdk/issues/41397

Change-Id: I03307f297954f97911ed501240df17e48ef2dfc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-17 14:38:24 +00:00
Paul Berry 0b12c1d775 Migration: fix crash when there is an extension in code not being migrated
Change-Id: Ie7d4daf827f7803ea4001a26e06aa58577b9d49a
Bug: https://buganizer.corp.google.com/issues/158730342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151443
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 14:03:44 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Paul Berry ed9112e862 Sort declarations in api_test.dart
Change-Id: Ibe2b078f6a38a79d304ad81b1625c72a65fe53c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-16 21:10:11 +00:00
Paul Berry a9bb706ce2 Migration: allow the client to specify which files to analyze/migrate.
Change-Id: Ie49f003640342a8c0d26b4f509a9268200955dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151302
Reviewed-by: Janice Collins <jcollins@google.com>
2020-06-16 21:10:11 +00:00
Mike Fairhurst e11eb2cd08 [nnbd_migration] Fix #42263, tool inserting ! on toString/hashCode
Fixed: 42263
Change-Id: Ia4c6d3543bc7628c76b85d986b9709de58925884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151441
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-16 20:21:31 +00:00
Paul Berry d1638508c1 Migration: streamline behavior injection in migration_cli_test.dart.
We now store both environmentVariables and injectArtificialException
in the _MigrationCliTestBase class, and refer to them wherever they
are needed, so we reduce the amount of plumbing we need to do.

In a follow up CL I'll be adding more behavior injection using the
same technique.

Change-Id: Ib736373f7a92a46922964d3c5c59d35bf72d618a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151300
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-16 17:52:10 +00:00
Sam Rawlins efcb8f9213 Migrator: Do not connect return values to return types on generators
Fixes https://github.com/dart-lang/sdk/issues/42299

Change-Id: I07b3955907efa3007ec146f4cb4170b117b58dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151328
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-16 14:08:54 +00:00
Sam Rawlins 61184814e2 Migrator: use dart pub to check outdated
Fixes #42343

This also prevents a crash if the binary-to-execute could not be found.

Change-Id: I19dd9f6dcbb41a5c8b4ef2a04a87c1fc83429120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151327
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-16 14:08:04 +00:00
Sam Rawlins 459255ab09 Migrator: Fix navigating to top-of-file
There is logic to navigate to the top of a newly-loaded page. It
broke with a visual redesign, in which the title of a page is always
sitting at the top of the screen. The new logic will scroll the page
to the first line of source text.

Change-Id: I685d1fb96c6ca1789f114871acd2bb8148e6ae7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151032
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-15 18:15:12 +00:00
Paul Berry 2fbe5c1f54 Migration: Make the three migration phases explicit in NonNullableFix API.
Previously the API was general, exposing a `numPhases` integer, and
providing a generic processing function with a `phase` argument.  This
was necessary back when migration was built into DartFix (because
different kinds of fixes had different numbers of phases), but now
that migration is a separate tool, it gets in the way because it makes
it difficult for the caller to have different behaviors in different
phases.

This is a prerequisite for making it possible to have some files
analyzed but not finalized (which is in turn necessary for handling
generated files).

Change-Id: I5993808eb3dace21d8b6cb9c5308f94a3b1f898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-15 15:26:48 +00:00
Paul Berry 9f8776f4a9 Migration: split out a MigrationCliRunner API from MigrationCli.
This API can be used by tools that wish to perform migration but want
to provide their own command-line argument parsing.

Change-Id: Ic54e993139c803ded5ac39229ae84980db12184e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-15 15:26:48 +00:00
Paul Berry a7c93201e4 Migration: rework how MigrationCli.run() reports an exit code.
Previously, MigrationCli.run() would always return, but it would set
MigrationCli.exitCode to indicate whether an error occurred.  This
made it necessary to thread a lot of tricky logic around to ensure
that we would exit quickly if an error occurred.  This CL switches to
using an exception, so we get the same effect automatically.

Change-Id: I2b885092dec551700900b118ec3d9acd2f3649d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150760
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-15 15:26:48 +00:00
Sam Rawlins 3dc27a55fa Migrator: Add a failing test for #42327
Bug: https://github.com/dart-lang/sdk/issues/42327
Change-Id: I5ac4dbaf95efdc7b54ea4009b78187e519cac92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151094
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-13 14:31:15 +00:00
Sam Rawlins 213f805294 Migrator: Bump highlight.js to 10.1.0
Fixes https://github.com/dart-lang/sdk/issues/41885

Change-Id: I2c19a36f0eb46e2941ca143c23e2b0be938b7d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151089
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-12 22:17:12 +00:00
Sam Rawlins b907f9928f Migrator: Begin flow analysis on top-level annotations
Fixes https://github.com/dart-lang/sdk/issues/42295

Change-Id: I9d224b5c8a3fa5d57f17e434a9e6dfbcebc14781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151026
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-12 22:01:32 +00:00
Paul Berry b1442a1f9a Remove unused import
Change-Id: I6d25e5ea3f1fdf320ec85d5f405789e6e8c2ddf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151084
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-12 20:25:39 +00:00
Paul Berry 43131b575e Migration: fix crashes with extension Foo<T extends ...> on T
Change-Id: I3a8f1be4f52a6a49bb57ab032fef668482f5acf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151002
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-12 18:21:15 +00:00
Devon Carew c607eb9637 [nnbd_migration] address an issue with the progress text written to stdout
Change-Id: I8bd4b4a291d1d64b48752c06f2ec7784e5bac819
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151040
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-12 00:18:46 +00:00
Mike Fairhurst 6b40b26044 [nnbd_migration] Print warning when SDK_PATH is set and things go wrong.
Also clean up sanity checking code a little bit.

Change-Id: I4274dad42687a4dc419090d656ec56168c982c29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150661
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-11 17:19:51 +00:00
Paul Berry 2a5c122d4a Migration: Fix EdgeBuilder._unimplemented if node==null
Change-Id: Id1a297f1ee5eaf4d7111ad081a0a8c49cb334303
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150801
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-11 16:14:42 +00:00
Sam Rawlins 6ac9749546 Update nnbd_migration README with more details.
* Use title case on all headings.
* Link to https://dart.dev/null-safety and
  https://dart.dev/tools/pub/cmd/pub-outdated
* Remove any text which suggests to publish. Official docs warn
  strongly against using in production.
* Mention `pub outdated --mode=null-safety`.
* Mention migrating a clean code repository.
* Add more text about committing along the way.
* Make clear that the tool provides no revert capability.

Change-Id: I7914dc904a93046ce2508c51cae158ac39e889af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150822
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-11 03:33:25 +00:00
Samuel Rawlins 5a32ff0d7f Revert "Bump cli_util to 0.2.0; implement new methods"
This reverts commit ebcc6dc2a2.

Reason for revert: Broke golem. I think there are more implementations of Logger than I realized.

Original change's description:
> Bump cli_util to 0.2.0; implement new methods
> 
> This fixes the issue of progress indicators being shown during tests.
> 
> Change-Id: I39fd68cfeca70a63d088aceb4325b42c53766afd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150669
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,jcollins@google.com,mfairhurst@google.com,srawlins@google.com

Change-Id: I52ac0f5d96a161534c28cc160c2a2b3b364ad511
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150693
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-10 23:59:05 +00:00
Sam Rawlins ebcc6dc2a2 Bump cli_util to 0.2.0; implement new methods
This fixes the issue of progress indicators being shown during tests.

Change-Id: I39fd68cfeca70a63d088aceb4325b42c53766afd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150669
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-10 22:10:06 +00:00
Paul Berry ae3b975373 Migration: exit early if an exception occurs
Change-Id: I108b64d75f9eb4ab376dfacaaeafcac1ef333755
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150580
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-10 13:50:27 +00:00
Paul Berry aa2566410f Migration: Add a flag to allow the user to ignore exceptions.
This should allow users to work around bugs while waiting for fixes
from the migration team.

Change-Id: I04fe08b4753ee1377a60ec60728a16560847536f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150542
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-10 13:50:27 +00:00
Mike Fairhurst 2a3d15e16f [nnbd_migration] Decorate Never type.
Both John and I have hit this in our own projects, seemed worth fixing.

Change-Id: Ic053287d365b92cbfd72448fe401ca627891f802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150663
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-06-10 04:24:17 +00:00
Paul Berry 3aad249fe2 Sort declarations in preview_site_test.dart
Change-Id: I6154bcff1b6421207ef3c76b5679a1d5d3b6a4ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150541
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-09 15:14:21 +00:00
Paul Berry 9907b0327b Migration: add an api_test of a14n's repro for #41397
Bug: https://github.com/dart-lang/sdk/issues/41397
Change-Id: I271b8d961faf12d84f5ebd28ac44ec1d8490b465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150540
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-09 13:58:16 +00:00
Paul Berry e4aaa1146b Sort declarations in migration_cli.dart
Change-Id: I05025f629080725f39a762c1d9f54d3aac7bf950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150463
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-08 23:44:50 +00:00
Paul Berry 96c2cc2589 Migration: fix class hierarchy handling in FixBuilder.
When running the FixBuilder we need to override the behavior of
ClassElement.interfaces so that it returns the post-migration
interface types.  We also need to override the behavior of
LibraryElement.isNonNullableByDefault so that the library being
migrated is considered opted in during FixBuilder analysis.  This
required adding hooks to the analyzer to allow those overrides.

Additionally, since the analyzer caches the InheritanceManager, we
need to clear that cache out just prior to running the FixBuilder, so
that no pre-migration interface types leak into the FixBuilder.

Fixes #40475.
Fixes #42139.

Change-Id: I45e2c30ebe8c12e4a599e2458d77a3731bad0f98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150260
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-08 17:26:41 +00:00
Paul Berry b7abe2cf00 Migration: change how migration_cli_test checks for a correct SDK.
When tests are run internally under bazel, there's no `version` file
we can look for to verify that we are looking at an SDK directory.
Looking for a `bin` directory works equally well.

Change-Id: Ib19350eaf90d105ebaa3d197fb45b5a41a10179d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150285
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-08 16:47:16 +00:00
Devon Carew 88f20ece1e [nnbd_migration] re-land a fix for migrating packages with multiple contexts
Change-Id: I60365e4a159f8696b17a8dd7f6d3fa0641a5afae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149889
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-06-04 17:05:57 +00:00
Paul Berry ac45f23134 Migration: Fix reporting of exceptions.
Permissive mode in the analyzer currently is broken, leading to a
useless stacktrace if an exception occurs.  As a quick fix, turn
permissive mode off, so the exception just bubbles up normally and
shows on the console.  In follow-up CLs I'll actually fix permissive
mode and add a user option to enable it.

Fixes #42138.

Change-Id: I59322ca9dd90b856c56a6ec335762b94ec6935b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149863
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-04 13:01:51 +00:00
Paul Berry af588af7de Prepare to publish package nnbd_migration
Change-Id: Ia56b262688c2eb1e0fd8edeef18de562a59c52b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149801
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-03 18:49:59 +00:00
Michael Thomsen ab2020725c Clarify migration guidance
Closes https://github.com/dart-lang/sdk/pull/42172
https://github.com/dart-lang/sdk/pull/42172

GitOrigin-RevId: af666ade7a03affc5210ddd644ac1f9ede682df1
Change-Id: I2cf627aab3d79c32025a2fd345d30dc97ef0cc02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149802
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-03 16:06:53 +00:00
creativecreatorormaybenot 1b886a806d [nnbd_migration] Fix typos/mistakes
The text says "We can fix this all by adding a single `/*!*/` hint.", but the code uses `/*?*/`. I am pretty sure that this is wrong.

Closes https://github.com/dart-lang/sdk/pull/42153
https://github.com/dart-lang/sdk/pull/42153

GitOrigin-RevId: f8b974b475bdaaa5c9c82204e2313d539a8247d7
Change-Id: I03a991b93bced2e24562f57128ef4bfb21eabf82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149685
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-03 16:06:01 +00:00
Devon Carew ceb08283df Revert "[nnbd_migration] handle multiple contexts"
This reverts commit 54adfeb93f.

Reason for revert: this breaks the windows bot

Original change's description:
> [nnbd_migration] handle multiple contexts
> 
> Bug: https://github.com/dart-lang/sdk/issues/42141
> Change-Id: I64179cd3fa0389397a8a9b3a763fbb1a3719294e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149664
> Commit-Queue: Devon Carew <devoncarew@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,devoncarew@google.com

Change-Id: I793d8f4a2832e7da0cb30565aee4a4806c0b0e02
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42141
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149803
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-06-03 16:04:53 +00:00
Mike Fairhurst e39568516b [nnbd_migration] Fix #42117, cannot load edit details on windows.
Change-Id: I5b10861b870d0d3d37a9abfacbc18152844e4ec9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149760
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-03 12:20:19 +00:00
Paul Berry b0df013ac8 Migration: fix pubspec deps.
The previous deps had never been validated and were wrong in many ways
(for some deps the constraint was too narrow or too wide; other deps
were missing or extraneous).  I did some experimenting with `pub get`
and `pub run test` to find the earliest version of each package for
which the version solve succeeds and the tests pass.

Note, however, that nnbd_migration currently depends on unpublished
functionality from the _fe_analyzer_shared and analyzer packges.  So
before publishing nnbd_migration we'll need to publish
_fe_analyzer_shared and analyzer and then update the pubspec one last
time.

Change-Id: If8453226bfcc5e94ac84f1a3fdc0d2f4ee150f54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149661
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-02 19:20:53 +00:00
Devon Carew 54adfeb93f [nnbd_migration] handle multiple contexts
Bug: https://github.com/dart-lang/sdk/issues/42141
Change-Id: I64179cd3fa0389397a8a9b3a763fbb1a3719294e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149664
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-02 18:40:43 +00:00
Sam Rawlins 93d39a5ef5 Migrator: Edit the package_config.json file
Bug: https://github.com/dart-lang/sdk/issues/41765
Change-Id: I019a97427b6faa4d4f5335b64424fab4bc3c5cde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149611
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-02 15:51:11 +00:00
Paul Berry 609b7f3735 Migration: change how we set the CLI exit code.
Setting exitCode (rather than calling exit) allows Observatory to keep
running, which makes for easier debugging.

Change-Id: If9812ead72ac04808030cd62467ba2f09b92b947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149609
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-01 21:21:48 +00:00
Sam Rawlins b9a89b223f Migrator: improve pubspec parsing
* Prevent cast exception crash when pubspec.yaml is not a map
* Prevent cast exception crash when pubspec sdk is not a string
* Test error cases for parsing pubspec.

Change-Id: Id392815207dc52719cfec5038d6fa2d09f952f08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149602
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-01 17:57:07 +00:00
Devon Carew 2c5739bd2b [nnbd_migration] update the CLI instructions of the migration tool
Change-Id: If42abe73b9a6640e3e1a7d2ecc23bd604c57238e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149603
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-06-01 16:25:04 +00:00
Sam Rawlins 258b6cb525 Migrator: tweaks to README
* Change the "Migrating a package" to be an ordered list of steps.
* Spell 'url' as 'URL'.
* Be consistent about capitalization and hyphenating "null-safe" and not
  hyphenating "null safety".
* Add text that the tool will edit pubspec.yaml.

Change-Id: Ief5eac682af2813d267568695f920445b0b79615
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149484
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-05-30 23:40:42 +00:00