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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+65-21Lines changed: 65 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,23 +241,23 @@ git checkout dev
241
241
242
242
### Installing Dart
243
243
244
-
This project requires using Dart version **2.13**, not the latest version. Click on a dropdown below for installation instructions for your operating system.
244
+
This project requires using Dart version **3.5.4**, not the latest version. Click on a dropdown below for installation instructions for your operating system.
245
245
246
246
<!--TODO: Find a way to use code blocks with syntax highlighting inside <details>-->
First, install <ahref="https://chocolatey.org/install">Chocolatey</a> if you haven't already. If <code>choco help</code> shows a help menu for using Chocolatey, then you've set it up correctly.
250
250
251
-
Then, install Dart 2.13.4:
251
+
Then, open a shell (cmd/Powershell) with Administrative privileges (go to Start type `cmd`, right-click on "Command Prompt", or type Powershell and right-click on "Powershell"; in both cases pick "Run as administrator") and install Dart 3.5.4:
252
252
253
253
<pre>
254
-
choco install dart-sdk --version 2.13.4
254
+
choco install dart-sdk --version 3.5.4
255
255
</pre>
256
256
257
257
To stop Chocolatey from automatically updating Dart to the latest version, pin it:
@@ -267,16 +267,16 @@ First, install <a href="https://brew.sh/">Homebrew</a> if you haven't already. I
267
267
268
268
It may help to run `brew tap dart-lang/dart` first.
269
269
270
-
Then, install Dart 2.13.4:
270
+
Then, install Dart 3.5.4:
271
271
272
272
<pre>
273
-
brew install dart@2.13.4
273
+
brew install dart@3.5.4
274
274
</pre>
275
275
276
276
To stop Homebrew from automatically updating Dart to the latest version, pin it:
277
277
278
278
<pre>
279
-
brew pin dart@2.13.4
279
+
brew pin dart@3.5.4
280
280
</pre>
281
281
282
282
If running `dart` in a terminal now does not work, you may need to follow <ahref="https://docs.brew.sh/FAQ#my-mac-apps-dont-find-homebrew-utilities">these instructions</a>.
Sometimes it may be necessary to clean out the generated files and cache if this has an error. See the file `clean.sh`, which has this line: `dart run build_runner clean`. Also see `remove_g.sh`, which removes all `.g.dart` files from the project, which can also help to fix compilation errors.
352
379
353
-
If that does not work, try `dart run build_runner clean --delete-conflicting-outputs`.
380
+
If that does not work, try `dart run build_runner build --delete-conflicting-outputs`, and then run `webdev serve`.
354
381
355
382
Running `webdev serve --release` will compile the project in production mode (instead of development mode), which is claimed to be faster in principle if you are not doing development and just want to run scadnano offline.
356
383
However, in scadnano, it doesn't appear to make a big difference whether development or production mode is used.
357
384
The webdev program will tell you which URL to enter in your browser; it will be something like
358
385
359
386
```
360
-
361
387
[INFO] Serving `web` on http://127.0.0.1:8080
362
-
363
388
```
364
389
365
390
Sometimes you may see an unexpected compilation error even if you haven't changed the code from a state where it was compiling okay. If you've really tried to fix an error and it doesn't seem to be due to a mistake in the code, then as a last resort, try running `./clean.sh`. This will clear out cached files and `.g.dart` files, which can sometimes become stale and need to be regenerated. If you run `./clean.sh`, and the project still does not compile, then it is a genuine syntax error that needs to be fixed.
@@ -384,12 +409,31 @@ extensions helpful for debugging and profiling.
384
409
385
410
### Running Tests
386
411
387
-
Unit tests are contained in the [test](test/) directory.
412
+
Unit tests are contained in the [test](test/) directory. To run them all type `dart run build_runner test`.
413
+
414
+
You can also run one file at a time like this:
415
+
416
+
```
417
+
dart run build_runner test -- test\assign_dna_unit_test.dart
418
+
```
419
+
420
+
or even one test at a time like this:
421
+
422
+
```
423
+
dart run build_runner test -- test\assign_dna_unit_test.dart --plain-name "Assign/remove dna test: AssignDNA"
424
+
```
425
+
426
+
That can be useful for debugging a test using the Chrome browser devtools like this:
427
+
428
+
```
429
+
dart run build_runner test -- test\assign_dna_unit_test.dart --plain-name "Assign/remove dna test: AssignDNA" -P debug
430
+
```
431
+
432
+
This opens a browser and lets you set a breakpoint if you open browser dev tools (type Ctrl+Shift+I). It can be a bit hard to find the files, look here:
0 commit comments