Skip to content

Commit

Permalink
Roll to Dart 2.10 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-mit authored Aug 27, 2020
1 parent a3cb09e commit b5e314d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 29 deletions.
5 changes: 5 additions & 0 deletions null_safety/calculate_lix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.0

- Roll to use Dart 2.10 dev-channel SDK
- Change `collection` dependency from git to pub.dev pre-release version

## 1.0.0

- Initial version
23 changes: 12 additions & 11 deletions null_safety/calculate_lix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ safety at its current tech preview stage.

## Running the example code

The code works only with the first tech preview of null safety, Dart SDK version
`2.9.0-14.0.dev`. You will need to download a copy of this Dart SDK even if you
have a Flutter or Dart SDK installed already, and you'll want to use this
preview SDK only for experimenting with null safety. Specifically, do not use it
for any kind of production coding.
The code works only with tech preview builds of null safety from the Dart dev
channel. You will need to download a copy of this Dart SDK even if you have a
Flutter or Dart SDK installed already, and you'll want to use this preview SDK
only for experimenting with null safety. Specifically, do not use it for any
kind of production coding.

### Dart preview SDK installation

1. Download the tech preview 1 build is version **`2.9.0-14.0.dev`** from the
dev-channel in the SDK archive:
https://dart.dev/tools/sdk/archive#dev-channel
1. Download the latest null safety preview build from the dev-channel in the
SDK archive: https://dart.dev/tools/sdk/archive#dev-channel. The
instructions below use `2.10.0-56.0.dev`; you get download a more recent
build.

1. Unzip the SDK to a folder, e.g. `/Users/michael/dev/preview/dart-sdk` or
`C:\Users\michael\dev\preview\dart-sdk\`
Expand All @@ -34,11 +35,11 @@ To run the main app, type these commands in the terminal/command-prompt:
- Windows:
- `cd <folder with samples repo>\null_safety\calculate_lix\`
- `C:\Users\michael\dev\preview\dart-sdk\bin\dart pub get`
- `C:\Users\michael\dev\preview\dart-sdk\bin\dart --enable-experiment=non-nullable bin\main.dart text\lorem-ipsum.txt`
- `C:\Users\michael\dev\preview\dart-sdk\bin\dart --enable-experiment=non-nullable run bin\main.dart text\lorem-ipsum.txt`
- macOS/Linux:
- `cd <folder with samples repo>/null_safety/calculate_lix/`
- `/Users/michael/dev/preview/dart-sdk/bin/dart pub get`
- `/Users/michael/dev/preview/dart-sdk/bin/dart --enable-experiment=non-nullable bin/main.dart text/lorem-ipsum.txt`
- `/Users/michael/dev/preview/dart-sdk/bin/dart --enable-experiment=non-nullable run bin/main.dart text/lorem-ipsum.txt`

### Running from VSCode

Expand All @@ -55,7 +56,7 @@ VSCode:

1. Tell VSCode to use the preview Dart SDK: Open `bin/main.dart` and then
locate the 'Dart: <version number>' selector in the status bar at the
bottom, and select `Dart: 2.9.0-14.0.dev`.
bottom, and select `Dart: 2.10.0-56.0.dev`.

1. Select **Run > Run** and the project should run and print a message in the Debug
Console.
Expand Down
12 changes: 5 additions & 7 deletions null_safety/calculate_lix/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ packages:
collection:
dependency: "direct main"
description:
path: "."
ref: null_safety
resolved-ref: "6ef56d3e8cfa4d347cbf70321251c5bb87acc9a1"
url: "https://github.com/dart-lang/collection"
source: git
version: "1.14.13-dev"
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.2"
sdks:
dart: ">=2.9.0-13.0.dev <3.0.0"
dart: ">=2.10.0-56.0.dev <2.10.0"
14 changes: 3 additions & 11 deletions null_safety/calculate_lix/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name: calculate_lix
description: A command-line application demonstrating use of null safety.
version: 1.0.0
version: 1.1.0

environment:
sdk: '>=2.9.0-13.0.dev <3.0.0'
sdk: '>=2.10.0-56.0.dev <2.11.0'

dependencies:
collection: 1.14.13-dev

# Temporary override as the null safety enabled versions of this package is
# not yet published to pub.dev.
dependency_overrides:
collection:
git:
url: https://github.com/dart-lang/collection
ref: null_safety
collection: 1.15.0-nullsafety.2

0 comments on commit b5e314d

Please sign in to comment.