|
4 | 4 | # for details. All rights reserved. Use of this source code is governed by a
|
5 | 5 | # BSD-style license that can be found in the LICENSE file.
|
6 | 6 |
|
7 |
| -# Fast fail the script on failures. |
8 |
| -set -e |
9 |
| - |
10 |
| -pub global activate grinder |
11 |
| - |
12 |
| -pub global activate dart_style |
| 7 | +# Fast fail the script on failures, and echo commands as they execute. |
| 8 | +set -ex |
13 | 9 |
|
14 | 10 | # add globally activated packages to the path
|
15 | 11 | export PATH="$PATH":"~/.pub-cache/bin"
|
16 | 12 |
|
17 |
| -if [ "$GEN_SDK_DOCS" = "true" ] |
18 |
| -then |
| 13 | +if [ "$DARTDOC_BOT" = "sdk-docs" ]; then |
19 | 14 | # Build the SDK docs
|
20 | 15 | # silence stdout but echo stderr
|
21 | 16 | echo ""
|
22 | 17 | echo "Building and validating SDK docs..."
|
23 |
| - grind validate-sdk-docs |
| 18 | + |
| 19 | + pub run grinder validate-sdk-docs |
| 20 | + |
24 | 21 | echo "SDK docs process finished"
|
| 22 | +elif [ "$DARTDOC_BOT" = "flutter" ]; then |
| 23 | + echo "Running flutter dartdoc bot" |
| 24 | + |
| 25 | + # Verify that the libraries are error free. |
| 26 | + pub run grinder analyze |
| 27 | + |
| 28 | + # Set up dartdoc so the flutter doc script can locate it. |
| 29 | + pub global activate -spath . |
| 30 | + |
| 31 | + # Clone flutter. |
| 32 | + rm -rf doc/flutter |
| 33 | + git clone --depth 1 https://github.com/flutter/flutter.git doc/flutter |
| 34 | + |
| 35 | + # Build the flutter docs. |
| 36 | + cd doc/flutter |
| 37 | + ./bin/flutter --version |
| 38 | + ./bin/flutter precache |
| 39 | + ( cd dev/tools; pub get ) |
| 40 | + ./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart |
| 41 | + |
| 42 | + # The above script validates the generation; we echo the main file here. |
| 43 | + cat dev/docs/doc/index.html |
25 | 44 | else
|
26 |
| - echo "" |
27 |
| - echo "Skipping SDK docs, because GEN_SDK_DOCS is $GEN_SDK_DOCS" |
28 |
| - echo "" |
| 45 | + echo "Running main dartdoc bot" |
29 | 46 |
|
30 | 47 | # Verify that the libraries are error free.
|
31 |
| - grind analyze |
| 48 | + pub run grinder analyze |
32 | 49 |
|
33 | 50 | # Run dartdoc on test_package.
|
34 | 51 | (cd testing/test_package; dart -c ../../bin/dartdoc.dart)
|
35 | 52 |
|
36 |
| - # checks the test_package results |
37 |
| - grind check-links |
| 53 | + # Checks the test_package results. |
| 54 | + pub run grinder check-links |
38 | 55 |
|
39 | 56 | # And on test_package_small.
|
40 | 57 | (cd testing/test_package_small; dart -c ../../bin/dartdoc.dart)
|
41 | 58 |
|
42 | 59 | # Run the tests.
|
43 |
| - grind test |
| 60 | + pub run grinder test |
44 | 61 | fi
|
0 commit comments