You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Coverage:** collects coverage over test suites (unit, integration, and functional) and generates a report. Uses the [`coverage` package](https://github.com/dart-lang/coverage).
92
86
-**Code Formatting:** runs the [`dartfmt` tool from the `dart_style` package](https://github.com/dart-lang/dart_style) over source code.
93
87
-**Static Analysis:** runs the [`dartanalyzer`](https://www.dartlang.org/tools/analyzer/) over source code.
94
-
-**Documentation Generation:** runs the tool from [the `dartdoc` package](https://github.com/dart-lang/dartdoc) to generate docs.
95
-
-**Serving Examples:** uses [`pub serve`](https://www.dartlang.org/tools/pub/cmd/pub-serve.html) to serve the project examples.
88
+
-(DEPRECATED) **Documentation Generation:** runs the tool from [the `dartdoc` package](https://github.com/dart-lang/dartdoc) to generate docs.
89
+
-(DEPRECATED) **Serving Examples:** uses [`pub serve`](https://www.dartlang.org/tools/pub/cmd/pub-serve.html) to serve the project examples.
96
90
-**Applying a License to Source Files:** copies a LICENSE file to all applicable files.
97
91
-**Generate a test runner file:** that allows for faster test execution.
98
92
-**Running dart unit tests on Sauce Labs:** compiles dart unit tests that can be run in the browser and executes them on various platforms using Sauce Labs.
@@ -247,23 +241,23 @@ running any of the following tasks:
247
241
ddev analyze
248
242
ddev copy-license
249
243
ddev coverage
250
-
ddev docs
251
-
ddev examples
244
+
ddev docs # (DEPRECATED)
245
+
ddev examples # (DEPRECATED)
252
246
ddev format
253
247
ddev gen-test-runner
254
-
ddev saucelabs
248
+
ddev saucelabs # (DEPRECATED)
255
249
ddev task-runner
256
250
ddev test
257
251
258
252
# without the alias
259
253
pub run dart_dev analyze
260
254
pub run dart_dev copy-license
261
255
pub run dart_dev coverage
262
-
pub run dart_dev docs
263
-
pub run dart_dev examples
256
+
pub run dart_dev docs # (DEPRECATED)
257
+
pub run dart_dev examples # (DEPRECATED)
264
258
pub run dart_dev format
265
259
pub run dart_dev gen-test-runner
266
-
pub run dart_dev saucelabs
260
+
pub run dart_dev saucelabs # (DEPRECATED)
267
261
pub run dart_dev task-runner
268
262
pub run dart_dev test
269
263
```
@@ -272,6 +266,33 @@ Add the `-h` flag to any of the above commands to receive additional help
272
266
information specific to that task.
273
267
274
268
269
+
#### Convenience Tasks for Targeting Dart1 and/or Dart2
270
+
271
+
To help with the transition from Dart1 to Dart2, you can leverage the `dart1-only`
272
+
and `dart2-only` tasks to conditionally run another dart_dev task or any executable.
273
+
274
+
```bash
275
+
# Run a dart_dev task only on Dart1:
276
+
$ ddev dart1-only test
277
+
278
+
# Run a dart_dev task with additional args only on Dart1:
279
+
$ ddev dart1-only -- format --check
280
+
281
+
# Run an shell script only on Dart1:
282
+
$ ddev dart1-only ./example.sh
283
+
284
+
# Run an executable with additional args only on Dart1:
285
+
$ ddev dart1-only -- pub serve web --port 8080
286
+
287
+
# The `dart2-only` task works exactly the same, but only runs on Dart2:
288
+
$ ddev dart2-only test
289
+
$ ddev dart2-only -- format --check
290
+
$ ddev dart2-only ./example.sh
291
+
$ ddev dart2-only -- pub run build_runner serve web:8080
292
+
```
293
+
294
+
295
+
275
296
## Project Configuration
276
297
Project configuration occurs in the `tool/dev.dart` file where the `config`
277
298
instance is imported from the `dart_dev` package. The bare minimum for this file
0 commit comments