Skip to content

Commit e2fc5d1

Browse files
authored
add a bot to test Flutter (#1382)
1 parent 40938a0 commit e2fc5d1

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
build/
2-
doc/api/
3-
doc/sdk/
2+
doc/
43
testing/test_package/doc
54
testing/test_package_small/doc
65
packages

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ language: dart
22
sudo: false
33
dart:
44
- dev
5-
# Disabled - re-enable once dev goes stable (see #1290).
6-
# - stable
75
env:
8-
- GEN_SDK_DOCS=true
9-
- GEN_SDK_DOCS=false
6+
- DARTDOC_BOT=main
7+
# TODO(devoncarew): add angulardart support
8+
#- DARTDOC_BOT=angular
9+
- DARTDOC_BOT=flutter
10+
- DARTDOC_BOT=sdk-docs
1011
script: ./tool/travis.sh
1112
branches:
1213
only:

dartdoc.iml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
1010
<sourceFolder url="file://$MODULE_DIR$/tool" isTestSource="false" />
1111
<excludeFolder url="file://$MODULE_DIR$/.pub" />
12+
<excludeFolder url="file://$MODULE_DIR$/bin/packages" />
1213
<excludeFolder url="file://$MODULE_DIR$/build" />
1314
<excludeFolder url="file://$MODULE_DIR$/doc" />
1415
<excludeFolder url="file://$MODULE_DIR$/example/packages" />

tool/travis.sh

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,58 @@
44
# for details. All rights reserved. Use of this source code is governed by a
55
# BSD-style license that can be found in the LICENSE file.
66

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
139

1410
# add globally activated packages to the path
1511
export PATH="$PATH":"~/.pub-cache/bin"
1612

17-
if [ "$GEN_SDK_DOCS" = "true" ]
18-
then
13+
if [ "$DARTDOC_BOT" = "sdk-docs" ]; then
1914
# Build the SDK docs
2015
# silence stdout but echo stderr
2116
echo ""
2217
echo "Building and validating SDK docs..."
23-
grind validate-sdk-docs
18+
19+
pub run grinder validate-sdk-docs
20+
2421
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
2544
else
26-
echo ""
27-
echo "Skipping SDK docs, because GEN_SDK_DOCS is $GEN_SDK_DOCS"
28-
echo ""
45+
echo "Running main dartdoc bot"
2946

3047
# Verify that the libraries are error free.
31-
grind analyze
48+
pub run grinder analyze
3249

3350
# Run dartdoc on test_package.
3451
(cd testing/test_package; dart -c ../../bin/dartdoc.dart)
3552

36-
# checks the test_package results
37-
grind check-links
53+
# Checks the test_package results.
54+
pub run grinder check-links
3855

3956
# And on test_package_small.
4057
(cd testing/test_package_small; dart -c ../../bin/dartdoc.dart)
4158

4259
# Run the tests.
43-
grind test
60+
pub run grinder test
4461
fi

0 commit comments

Comments
 (0)