Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Tweaks to Dart container #44

Merged
merged 9 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions containers/dart/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ FROM google/dart:2

ENV PATH="$PATH":"/root/.pub-cache/bin"

RUN pub global activate webdev

# Install git, process tools
RUN apt-get update && apt-get -y install git procps

Expand Down
5 changes: 2 additions & 3 deletions containers/dart/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"name": "Dart",
"dockerFile": "Dockerfile",
"extensions": [
"dart-code.dart-code",
"msjsdiag.debugger-for-chrome"
"dart-code.dart-code"
],

// Uncomment the next line if you want to publish any ports.
// "appPort": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "pub get"
// "postCreateCommand": ""
}
10 changes: 7 additions & 3 deletions containers/dart/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@
"name": "Launch Server",
"type": "dart",
"request": "launch",
"program": "server.dart",
"cwd": "${workspaceFolder}/test-project",
"preLaunchTask": "get"
"program": "bin/server.dart",
"cwd": "test-project",
"serverReadyAction": {
"pattern": "Listening on localhost:([0-9]+)",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}
13 changes: 0 additions & 13 deletions containers/dart/.vscode/tasks.json

This file was deleted.

8 changes: 3 additions & 5 deletions containers/dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ This definition includes some test code that will help you verify it is working
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/dart` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project. This will automatically run `pub get` and build the code before starting it.
6. Once the project is running, press <kbd>F1</kbd> and select **Remote-Containers: Forward Port from Container...**
7. Select port 8080 and click the "Open Browser" button in the notification that appears.
8. You should see "Hello remote world!" after the page loads.
9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project and launch the browser.
6. You should see "Hello remote world!" after the page loads.
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Expand Down
3 changes: 3 additions & 0 deletions containers/dart/test-project/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ build/

# Directory created by dartdoc
doc/api/

# Don't exclude bin/ folders for Dart projects
![Bb]in/
6 changes: 0 additions & 6 deletions containers/dart/test-project/analysis_options.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@
import 'dart:io';

Future main() async {


var server = await HttpServer.bind(
final server = await HttpServer.bind(
InternetAddress.loopbackIPv4,
8080,
);
print('*************************************************************************');
print('* Press F1, select "Remote-Containers: Forward Port from Container...", *');
print('* and select the server port listed below to access server. *');
print('*************************************************************************');

print('Listening on localhost:${server.port}');

await for (HttpRequest request in server) {
request.response
..write('Hello remote world!')
..close();
}
}
}
5 changes: 0 additions & 5 deletions containers/dart/test-project/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@ description: A test project

environment:
sdk: '>=2.1.0 <3.0.0'

dev_dependencies:
build_runner: ^1.1.2
build_web_compilers: ^1.0.0
pedantic: ^1.0.0