mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:45:06 +00:00
[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:
parent
e91e09d1e4
commit
3f8366363b
|
@ -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:
|
|
@ -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>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue