[nnbd migration] move the docs for the NNBD migration tool

Change-Id: I932da23be10839b5bde6034f120763c54f63889f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140102
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
Devon Carew 2020-03-19 23:12:24 +00:00 committed by commit-bot@chromium.org
parent e91e09d1e4
commit 3f8366363b
4 changed files with 3441 additions and 3424 deletions

View file

@ -1,50 +0,0 @@
# Null Safety Migration Tooling
Note: the null safety migration tooling and workflow is in an early state;
this doc will be updated as the steps and workflow are simplified.
## Building the NNBD sdk
In order to run the tool currently you have to be able to build your own copy
of the Dart SDK.
To do this, run:
```
./tools/build.py -mrelease --nnbd create_sdk
```
The NNBD sdk now lives under the ReleaseX64NNBD sub-directory of your build
directory, e.g.
```
xcodebuild/ReleaseX64NNBD/dart-sdk/
```
## Migrating a package
- build a NNBD version of the SDK (see above)
- select a package to work on
- in that package, edit the `analysis_options.yaml` to enable the NNBD
experiment from the POV of the analyzer:
```yaml
analyzer:
enable-experiment:
- non-nullable
```
- run `pub get` for the package (and, verify that the
`.dart_tool/package_config.json` file was created)
Then, run the migration tool from the top-level of the package directory:
```
<sdk-repo>/xcodebuild/ReleaseX64NNBD/dart migrate .
```
The migration tool will run, print the proposed changes to the console, and
display a url for the preview tool. Open that url from a browser to see a rich
preview of the proposed null safety changes.
## Using the tool
TODO:

View file

@ -53,7 +53,7 @@
</div><!-- /panels -->
<footer>
<a target="_blank"
href="https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/lib/src/edit/nnbd_migration/README.md">Null
href="https://github.com/dart-lang/sdk/blob/master/pkg/nnbd_migration/README.md">Null
safety migration help</a>
<span class="wide"> </span>
<div>Based on {{ sdkVersion }}</div>

View file

@ -1,4 +1,54 @@
# NNBD Migration Engine
# Null Safety Migration Tooling
This package provides infrastructure for migrating code to be non-nullable by
default.
Note: the null safety migration tooling and workflow is in an early state;
this doc will be updated as the steps and workflow are simplified.
## Building the NNBD sdk
In order to run the tool currently you have to be able to build your own copy
of the Dart SDK.
To do this, run:
```
./tools/build.py -mrelease --nnbd create_sdk
```
The NNBD sdk now lives under the ReleaseX64NNBD sub-directory of your build
directory, e.g.
```
xcodebuild/ReleaseX64NNBD/dart-sdk/
```
## Trying this for Flutter devs
TODO:
## Migrating a package
- build a NNBD version of the SDK (see above)
- select a package to work on
- in that package, edit the `analysis_options.yaml` to enable the NNBD
experiment from the POV of the analyzer:
```yaml
analyzer:
enable-experiment:
- non-nullable
```
- run `pub get` for the package (and, verify that the
`.dart_tool/package_config.json` file was created)
Then, run the migration tool from the top-level of the package directory:
```
<sdk-repo>/xcodebuild/ReleaseX64NNBD/dart migrate .
```
The migration tool will run, print the proposed changes to the console, and
display a url for the preview tool. Open that url from a browser to see a rich
preview of the proposed null safety changes.
## Using the tool
TODO: